All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2021-02-02 12:39 Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 1/7] net: hns3: add api capability bits for firmware Huazhong Tan
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Huazhong Tan

This series includes some updates for the HNS3 ethernet driver.

#1~#6 add some code optimizations and compatibility handlings.
#7 fixes a clang warning.

Guangbin Huang (3):
  net: hns3: RSS indirection table and key use device specifications
  net: hns3: debugfs add max tm rate specification print
  net: hns3: replace macro of max qset number with specification

GuoJia Liao (1):
  net: hns3: optimize the code when update the tc info

Huazhong Tan (1):
  net: hns3: remove unnecessary check in hns3_dbg_read()

Jian Shen (1):
  net: hns3: add api capability bits for firmware

Yufeng Mo (1):
  net: hns3: add support for obtaining the maximum frame length

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  8 +---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |  5 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 ++---
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 10 ++++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |  9 +++-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c |  8 ++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 53 ++++++++++++----------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    | 14 ++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  | 15 ++++--
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   | 10 ++++
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h   |  6 ++-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 44 ++++++++----------
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  | 11 +++--
 13 files changed, 115 insertions(+), 90 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 1/7] net: hns3: add api capability bits for firmware
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications Huazhong Tan
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Jian Shen, Huazhong Tan

From: Jian Shen <shenjian15@huawei.com>

To improve the compatibility of firmware for driver, help firmware
to deal with different api commands, add api capability bits when
initialization the command queue.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c   | 10 ++++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h   |  6 +++++-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 10 ++++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h |  6 +++++-
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
index b728be4..6546b47 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
@@ -363,6 +363,15 @@ static void hclge_parse_capability(struct hclge_dev *hdev,
 		set_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, ae_dev->caps);
 }
 
+static __le32 hclge_build_api_caps(void)
+{
+	u32 api_caps = 0;
+
+	hnae3_set_bit(api_caps, HCLGE_API_CAP_FLEX_RSS_TBL_B, 1);
+
+	return cpu_to_le32(api_caps);
+}
+
 static enum hclge_cmd_status
 hclge_cmd_query_version_and_capability(struct hclge_dev *hdev)
 {
@@ -373,6 +382,7 @@ hclge_cmd_query_version_and_capability(struct hclge_dev *hdev)
 
 	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_FW_VER, 1);
 	resp = (struct hclge_query_version_cmd *)desc.data;
+	resp->api_caps = hclge_build_api_caps();
 
 	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
 	if (ret)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index f861bdb..9ceb059 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -386,11 +386,15 @@ enum HCLGE_CAP_BITS {
 	HCLGE_CAP_UDP_TUNNEL_CSUM_B,
 };
 
+enum HCLGE_API_CAP_BITS {
+	HCLGE_API_CAP_FLEX_RSS_TBL_B,
+};
+
 #define HCLGE_QUERY_CAP_LENGTH		3
 struct hclge_query_version_cmd {
 	__le32 firmware;
 	__le32 hardware;
-	__le32 rsv;
+	__le32 api_caps;
 	__le32 caps[HCLGE_QUERY_CAP_LENGTH]; /* capabilities of device */
 };
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
index e04c0cf..0f93c2d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
@@ -342,6 +342,15 @@ static void hclgevf_parse_capability(struct hclgevf_dev *hdev,
 		set_bit(HNAE3_DEV_SUPPORT_UDP_TUNNEL_CSUM_B, ae_dev->caps);
 }
 
+static __le32 hclgevf_build_api_caps(void)
+{
+	u32 api_caps = 0;
+
+	hnae3_set_bit(api_caps, HCLGEVF_API_CAP_FLEX_RSS_TBL_B, 1);
+
+	return cpu_to_le32(api_caps);
+}
+
 static int hclgevf_cmd_query_version_and_capability(struct hclgevf_dev *hdev)
 {
 	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
@@ -352,6 +361,7 @@ static int hclgevf_cmd_query_version_and_capability(struct hclgevf_dev *hdev)
 	resp = (struct hclgevf_query_version_cmd *)desc.data;
 
 	hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_QUERY_FW_VER, 1);
+	resp->api_caps = hclgevf_build_api_caps();
 	status = hclgevf_cmd_send(&hdev->hw, &desc, 1);
 	if (status)
 		return status;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h
index 82eed25..d591b33 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h
@@ -161,11 +161,15 @@ enum HCLGEVF_CAP_BITS {
 	HCLGEVF_CAP_UDP_TUNNEL_CSUM_B,
 };
 
+enum HCLGEVF_API_CAP_BITS {
+	HCLGEVF_API_CAP_FLEX_RSS_TBL_B,
+};
+
 #define HCLGEVF_QUERY_CAP_LENGTH		3
 struct hclgevf_query_version_cmd {
 	__le32 firmware;
 	__le32 hardware;
-	__le32 rsv;
+	__le32 api_caps;
 	__le32 caps[HCLGEVF_QUERY_CAP_LENGTH]; /* capabilities of device */
 };
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 1/7] net: hns3: add api capability bits for firmware Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-04  0:50   ` Jakub Kicinski
  2021-02-02 12:39 ` [PATCH net-next 3/7] net: hns3: optimize the code when update the tc info Huazhong Tan
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

As RSS indirection table size and RSS key size may be different in
different hardware. Instead of using macro, their values are better
to use device specifications which querying from firmware.

The arrays of RSS indirection table and RSS key are defined to the
max specification of all hardwares, so they can be used in each
device.

.get_rss_key_size and .get_rss_indir_size in struct hnae3_ae_ops
are not used now, so remove them as well.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  6 ---
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 ++----
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 41 ++++++++++----------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    | 10 ++---
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 44 +++++++++-------------
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  | 11 ++++--
 6 files changed, 53 insertions(+), 71 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index fe09cf6..f4c8d72 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -408,10 +408,6 @@ struct hnae3_ae_dev {
  *   Get regs dump
  * get_regs_len()
  *   Get the len of the regs dump
- * get_rss_key_size()
- *   Get rss key size
- * get_rss_indir_size()
- *   Get rss indirection table size
  * get_rss()
  *   Get rss table
  * set_rss()
@@ -554,8 +550,6 @@ struct hnae3_ae_ops {
 			 void *data);
 	int (*get_regs_len)(struct hnae3_handle *handle);
 
-	u32 (*get_rss_key_size)(struct hnae3_handle *handle);
-	u32 (*get_rss_indir_size)(struct hnae3_handle *handle);
 	int (*get_rss)(struct hnae3_handle *handle, u32 *indir, u8 *key,
 		       u8 *hfunc);
 	int (*set_rss)(struct hnae3_handle *handle, const u32 *indir,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index e2fc443..c4b308e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -849,21 +849,17 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
 static u32 hns3_get_rss_key_size(struct net_device *netdev)
 {
 	struct hnae3_handle *h = hns3_get_handle(netdev);
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
 
-	if (!h->ae_algo->ops->get_rss_key_size)
-		return 0;
-
-	return h->ae_algo->ops->get_rss_key_size(h);
+	return ae_dev->dev_specs.rss_key_size;
 }
 
 static u32 hns3_get_rss_indir_size(struct net_device *netdev)
 {
 	struct hnae3_handle *h = hns3_get_handle(netdev);
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
 
-	if (!h->ae_algo->ops->get_rss_indir_size)
-		return 0;
-
-	return h->ae_algo->ops->get_rss_indir_size(h);
+	return ae_dev->dev_specs.rss_ind_tbl_size;
 }
 
 static int hns3_get_rss(struct net_device *netdev, u32 *indir, u8 *key,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 16ccb1a..a8aa388 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -4232,16 +4232,6 @@ static int hclge_put_vector(struct hnae3_handle *handle, int vector)
 	return 0;
 }
 
-static u32 hclge_get_rss_key_size(struct hnae3_handle *handle)
-{
-	return HCLGE_RSS_KEY_SIZE;
-}
-
-static u32 hclge_get_rss_indir_size(struct hnae3_handle *handle)
-{
-	return HCLGE_RSS_IND_TBL_SIZE;
-}
-
 static int hclge_set_rss_algo_key(struct hclge_dev *hdev,
 				  const u8 hfunc, const u8 *key)
 {
@@ -4252,7 +4242,7 @@ static int hclge_set_rss_algo_key(struct hclge_dev *hdev,
 	int key_size;
 	int ret;
 
-	key_counts = HCLGE_RSS_KEY_SIZE;
+	key_counts = hdev->ae_dev->dev_specs.rss_key_size;
 	req = (struct hclge_rss_config_cmd *)desc.data;
 
 	while (key_counts) {
@@ -4283,6 +4273,7 @@ static int hclge_set_rss_indir_table(struct hclge_dev *hdev, const u16 *indir)
 {
 	struct hclge_rss_indirection_table_cmd *req;
 	struct hclge_desc desc;
+	int rss_cfg_tbl_num;
 	u8 rss_msb_oft;
 	u8 rss_msb_val;
 	int ret;
@@ -4291,8 +4282,10 @@ static int hclge_set_rss_indir_table(struct hclge_dev *hdev, const u16 *indir)
 	u32 j;
 
 	req = (struct hclge_rss_indirection_table_cmd *)desc.data;
+	rss_cfg_tbl_num = hdev->ae_dev->dev_specs.rss_ind_tbl_size /
+			  HCLGE_RSS_CFG_TBL_SIZE;
 
-	for (i = 0; i < HCLGE_RSS_CFG_TBL_NUM; i++) {
+	for (i = 0; i < rss_cfg_tbl_num; i++) {
 		hclge_cmd_setup_basic_desc
 			(&desc, HCLGE_OPC_RSS_INDIR_TABLE, false);
 
@@ -4398,6 +4391,7 @@ static int hclge_set_rss_input_tuple(struct hclge_dev *hdev)
 static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir,
 			 u8 *key, u8 *hfunc)
 {
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	int i;
 
@@ -4418,11 +4412,12 @@ static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir,
 
 	/* Get the RSS Key required by the user */
 	if (key)
-		memcpy(key, vport->rss_hash_key, HCLGE_RSS_KEY_SIZE);
+		memcpy(key, vport->rss_hash_key,
+		       ae_dev->dev_specs.rss_key_size);
 
 	/* Get indirect table */
 	if (indir)
-		for (i = 0; i < HCLGE_RSS_IND_TBL_SIZE; i++)
+		for (i = 0; i < ae_dev->dev_specs.rss_ind_tbl_size; i++)
 			indir[i] =  vport->rss_indirection_tbl[i];
 
 	return 0;
@@ -4431,6 +4426,7 @@ static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir,
 static int hclge_set_rss(struct hnae3_handle *handle, const u32 *indir,
 			 const  u8 *key, const  u8 hfunc)
 {
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	struct hclge_dev *hdev = vport->back;
 	u8 hash_algo;
@@ -4457,12 +4453,13 @@ static int hclge_set_rss(struct hnae3_handle *handle, const u32 *indir,
 			return ret;
 
 		/* Update the shadow RSS key with user specified qids */
-		memcpy(vport->rss_hash_key, key, HCLGE_RSS_KEY_SIZE);
+		memcpy(vport->rss_hash_key, key,
+		       ae_dev->dev_specs.rss_key_size);
 		vport->rss_algo = hash_algo;
 	}
 
 	/* Update the shadow RSS table with user specified qids */
-	for (i = 0; i < HCLGE_RSS_IND_TBL_SIZE; i++)
+	for (i = 0; i < ae_dev->dev_specs.rss_ind_tbl_size; i++)
 		vport->rss_indirection_tbl[i] = indir[i];
 
 	/* Update the hardware */
@@ -4703,7 +4700,7 @@ void hclge_rss_indir_init_cfg(struct hclge_dev *hdev)
 	int i, j;
 
 	for (j = 0; j < hdev->num_vmdq_vport + 1; j++) {
-		for (i = 0; i < HCLGE_RSS_IND_TBL_SIZE; i++)
+		for (i = 0; i < hdev->ae_dev->dev_specs.rss_ind_tbl_size; i++)
 			vport[j].rss_indirection_tbl[i] =
 				i % vport[j].alloc_rss_size;
 	}
@@ -4740,7 +4737,7 @@ static void hclge_rss_init_cfg(struct hclge_dev *hdev)
 		vport[i].rss_algo = rss_algo;
 
 		memcpy(vport[i].rss_hash_key, hclge_hash_key,
-		       HCLGE_RSS_KEY_SIZE);
+		       hdev->ae_dev->dev_specs.rss_key_size);
 	}
 
 	hclge_rss_indir_init_cfg(hdev);
@@ -11072,6 +11069,7 @@ static void hclge_get_tqps_and_rss_info(struct hnae3_handle *handle,
 static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
 			      bool rxfh_configured)
 {
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	struct hnae3_knic_private_info *kinfo = &vport->nic.kinfo;
 	u16 tc_offset[HCLGE_MAX_TC_NUM] = {0};
@@ -11115,11 +11113,12 @@ static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
 		goto out;
 
 	/* Reinitializes the rss indirect table according to the new RSS size */
-	rss_indir = kcalloc(HCLGE_RSS_IND_TBL_SIZE, sizeof(u32), GFP_KERNEL);
+	rss_indir = kcalloc(ae_dev->dev_specs.rss_ind_tbl_size, sizeof(u32),
+			    GFP_KERNEL);
 	if (!rss_indir)
 		return -ENOMEM;
 
-	for (i = 0; i < HCLGE_RSS_IND_TBL_SIZE; i++)
+	for (i = 0; i < ae_dev->dev_specs.rss_ind_tbl_size; i++)
 		rss_indir[i] = i % kinfo->rss_size;
 
 	ret = hclge_set_rss(handle, rss_indir, NULL, 0);
@@ -11798,8 +11797,6 @@ static const struct hnae3_ae_ops hclge_ops = {
 	.check_port_speed = hclge_check_port_speed,
 	.get_fec = hclge_get_fec,
 	.set_fec = hclge_set_fec,
-	.get_rss_key_size = hclge_get_rss_key_size,
-	.get_rss_indir_size = hclge_get_rss_indir_size,
 	.get_rss = hclge_get_rss,
 	.set_rss = hclge_set_rss,
 	.set_rss_tuple = hclge_set_rss_tuple,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index 32e5f82..2bb1dd4 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -90,15 +90,15 @@
 #define HCLGE_TQP_INTR_GL2_REG		0x20300
 #define HCLGE_TQP_INTR_RL_REG		0x20900
 
+#define HCLGE_RSS_IND_TBL_SIZE_MAX	512
 #define HCLGE_RSS_IND_TBL_SIZE		512
 #define HCLGE_RSS_SET_BITMAP_MSK	GENMASK(15, 0)
+#define HCLGE_RSS_KEY_SIZE_MAX		40
 #define HCLGE_RSS_KEY_SIZE		40
 #define HCLGE_RSS_HASH_ALGO_TOEPLITZ	0
 #define HCLGE_RSS_HASH_ALGO_SIMPLE	1
 #define HCLGE_RSS_HASH_ALGO_SYMMETRIC	2
 #define HCLGE_RSS_HASH_ALGO_MASK	GENMASK(3, 0)
-#define HCLGE_RSS_CFG_TBL_NUM \
-	(HCLGE_RSS_IND_TBL_SIZE / HCLGE_RSS_CFG_TBL_SIZE)
 
 #define HCLGE_RSS_INPUT_TUPLE_OTHER	GENMASK(3, 0)
 #define HCLGE_RSS_INPUT_TUPLE_SCTP	GENMASK(4, 0)
@@ -919,10 +919,10 @@ struct hclge_vf_info {
 
 struct hclge_vport {
 	u16 alloc_tqps;	/* Allocated Tx/Rx queues */
-
-	u8  rss_hash_key[HCLGE_RSS_KEY_SIZE]; /* User configured hash keys */
+	/* User configured hash keys */
+	u8  rss_hash_key[HCLGE_RSS_KEY_SIZE_MAX];
 	/* User configured lookup table entries */
-	u16 rss_indirection_tbl[HCLGE_RSS_IND_TBL_SIZE];
+	u16  rss_indirection_tbl[HCLGE_RSS_IND_TBL_SIZE_MAX];
 	int rss_algo;		/* User configured hash algorithm */
 	/* User configured rss tuple sets */
 	struct hclge_rss_tuple_cfg rss_tuple_sets;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 674b3a2..2578d9f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -607,7 +607,7 @@ static int hclgevf_set_rss_algo_key(struct hclgevf_dev *hdev,
 	int key_size;
 	int ret;
 
-	key_counts = HCLGEVF_RSS_KEY_SIZE;
+	key_counts = hdev->ae_dev->dev_specs.rss_key_size;
 	req = (struct hclgevf_rss_config_cmd *)desc.data;
 
 	while (key_counts) {
@@ -637,27 +637,20 @@ static int hclgevf_set_rss_algo_key(struct hclgevf_dev *hdev,
 	return 0;
 }
 
-static u32 hclgevf_get_rss_key_size(struct hnae3_handle *handle)
-{
-	return HCLGEVF_RSS_KEY_SIZE;
-}
-
-static u32 hclgevf_get_rss_indir_size(struct hnae3_handle *handle)
-{
-	return HCLGEVF_RSS_IND_TBL_SIZE;
-}
-
 static int hclgevf_set_rss_indir_table(struct hclgevf_dev *hdev)
 {
 	const u8 *indir = hdev->rss_cfg.rss_indirection_tbl;
 	struct hclgevf_rss_indirection_table_cmd *req;
 	struct hclgevf_desc desc;
+	int rss_cfg_tbl_num;
 	int status;
 	int i, j;
 
 	req = (struct hclgevf_rss_indirection_table_cmd *)desc.data;
+	rss_cfg_tbl_num = hdev->ae_dev->dev_specs.rss_ind_tbl_size /
+			  HCLGEVF_RSS_CFG_TBL_SIZE;
 
-	for (i = 0; i < HCLGEVF_RSS_CFG_TBL_NUM; i++) {
+	for (i = 0; i < rss_cfg_tbl_num; i++) {
 		hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_RSS_INDIR_TABLE,
 					     false);
 		req->start_table_index = i * HCLGEVF_RSS_CFG_TBL_SIZE;
@@ -721,6 +714,7 @@ static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev,  u16 rss_size)
 static int hclgevf_get_rss_hash_key(struct hclgevf_dev *hdev)
 {
 #define HCLGEVF_RSS_MBX_RESP_LEN	8
+	u16 rss_key_size = hdev->ae_dev->dev_specs.rss_key_size;
 	struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg;
 	u8 resp_msg[HCLGEVF_RSS_MBX_RESP_LEN];
 	struct hclge_vf_to_pf_msg send_msg;
@@ -729,7 +723,7 @@ static int hclgevf_get_rss_hash_key(struct hclgevf_dev *hdev)
 	int ret;
 
 	hclgevf_build_send_msg(&send_msg, HCLGE_MBX_GET_RSS_KEY, 0);
-	msg_num = (HCLGEVF_RSS_KEY_SIZE + HCLGEVF_RSS_MBX_RESP_LEN - 1) /
+	msg_num = (rss_key_size + HCLGEVF_RSS_MBX_RESP_LEN - 1) /
 			HCLGEVF_RSS_MBX_RESP_LEN;
 	for (index = 0; index < msg_num; index++) {
 		send_msg.data[0] = index;
@@ -745,8 +739,7 @@ static int hclgevf_get_rss_hash_key(struct hclgevf_dev *hdev)
 		hash_key_index = HCLGEVF_RSS_MBX_RESP_LEN * index;
 		if (index == msg_num - 1)
 			memcpy(&rss_cfg->rss_hash_key[hash_key_index],
-			       &resp_msg[0],
-			       HCLGEVF_RSS_KEY_SIZE - hash_key_index);
+			       &resp_msg[0], rss_key_size - hash_key_index);
 		else
 			memcpy(&rss_cfg->rss_hash_key[hash_key_index],
 			       &resp_msg[0], HCLGEVF_RSS_MBX_RESP_LEN);
@@ -781,7 +774,7 @@ static int hclgevf_get_rss(struct hnae3_handle *handle, u32 *indir, u8 *key,
 		/* Get the RSS Key required by the user */
 		if (key)
 			memcpy(key, rss_cfg->rss_hash_key,
-			       HCLGEVF_RSS_KEY_SIZE);
+			       hdev->ae_dev->dev_specs.rss_key_size);
 	} else {
 		if (hfunc)
 			*hfunc = ETH_RSS_HASH_TOP;
@@ -790,12 +783,12 @@ static int hclgevf_get_rss(struct hnae3_handle *handle, u32 *indir, u8 *key,
 			if (ret)
 				return ret;
 			memcpy(key, rss_cfg->rss_hash_key,
-			       HCLGEVF_RSS_KEY_SIZE);
+			       hdev->ae_dev->dev_specs.rss_key_size);
 		}
 	}
 
 	if (indir)
-		for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
+		for (i = 0; i < hdev->ae_dev->dev_specs.rss_ind_tbl_size; i++)
 			indir[i] = rss_cfg->rss_indirection_tbl[i];
 
 	return 0;
@@ -833,12 +826,12 @@ static int hclgevf_set_rss(struct hnae3_handle *handle, const u32 *indir,
 
 			/* Update the shadow RSS key with user specified qids */
 			memcpy(rss_cfg->rss_hash_key, key,
-			       HCLGEVF_RSS_KEY_SIZE);
+			       hdev->ae_dev->dev_specs.rss_key_size);
 		}
 	}
 
 	/* update the shadow RSS table with user specified qids */
-	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
+	for (i = 0; i < hdev->ae_dev->dev_specs.rss_ind_tbl_size; i++)
 		rss_cfg->rss_indirection_tbl[i] = indir[i];
 
 	/* update the hardware */
@@ -2494,7 +2487,7 @@ static void hclgevf_rss_init_cfg(struct hclgevf_dev *hdev)
 	if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
 		rss_cfg->hash_algo = HCLGEVF_RSS_HASH_ALGO_SIMPLE;
 		memcpy(rss_cfg->rss_hash_key, hclgevf_hash_key,
-		       HCLGEVF_RSS_KEY_SIZE);
+		       hdev->ae_dev->dev_specs.rss_key_size);
 
 		tuple_sets->ipv4_tcp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
 		tuple_sets->ipv4_udp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
@@ -2510,7 +2503,7 @@ static void hclgevf_rss_init_cfg(struct hclgevf_dev *hdev)
 	}
 
 	/* Initialize RSS indirect table */
-	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
+	for (i = 0; i < hdev->ae_dev->dev_specs.rss_ind_tbl_size; i++)
 		rss_cfg->rss_indirection_tbl[i] = i % rss_cfg->rss_size;
 }
 
@@ -3444,11 +3437,12 @@ static int hclgevf_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
 		goto out;
 
 	/* Reinitializes the rss indirect table according to the new RSS size */
-	rss_indir = kcalloc(HCLGEVF_RSS_IND_TBL_SIZE, sizeof(u32), GFP_KERNEL);
+	rss_indir = kcalloc(hdev->ae_dev->dev_specs.rss_ind_tbl_size,
+			    sizeof(u32), GFP_KERNEL);
 	if (!rss_indir)
 		return -ENOMEM;
 
-	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
+	for (i = 0; i < hdev->ae_dev->dev_specs.rss_ind_tbl_size; i++)
 		rss_indir[i] = i % kinfo->rss_size;
 
 	hdev->rss_cfg.rss_size = kinfo->rss_size;
@@ -3686,8 +3680,6 @@ static const struct hnae3_ae_ops hclgevf_ops = {
 	.update_stats = hclgevf_update_stats,
 	.get_strings = hclgevf_get_strings,
 	.get_sset_count = hclgevf_get_sset_count,
-	.get_rss_key_size = hclgevf_get_rss_key_size,
-	.get_rss_indir_size = hclgevf_get_rss_indir_size,
 	.get_rss = hclgevf_get_rss,
 	.set_rss = hclgevf_set_rss,
 	.get_rss_tuple = hclgevf_get_rss_tuple,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
index f6d817a..004e30d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
@@ -106,15 +106,16 @@
 #define HCLGEVF_VF_RST_ING		0x07008
 #define HCLGEVF_VF_RST_ING_BIT		BIT(16)
 
+#define HCLGEVF_RSS_IND_TBL_SIZE_MAX		512
 #define HCLGEVF_RSS_IND_TBL_SIZE		512
 #define HCLGEVF_RSS_SET_BITMAP_MSK	0xffff
+#define HCLGEVF_RSS_KEY_SIZE_MAX	40
 #define HCLGEVF_RSS_KEY_SIZE		40
 #define HCLGEVF_RSS_HASH_ALGO_TOEPLITZ	0
 #define HCLGEVF_RSS_HASH_ALGO_SIMPLE	1
 #define HCLGEVF_RSS_HASH_ALGO_SYMMETRIC	2
 #define HCLGEVF_RSS_HASH_ALGO_MASK	0xf
-#define HCLGEVF_RSS_CFG_TBL_NUM \
-	(HCLGEVF_RSS_IND_TBL_SIZE / HCLGEVF_RSS_CFG_TBL_SIZE)
+
 #define HCLGEVF_RSS_INPUT_TUPLE_OTHER	GENMASK(3, 0)
 #define HCLGEVF_RSS_INPUT_TUPLE_SCTP	GENMASK(4, 0)
 #define HCLGEVF_D_PORT_BIT		BIT(0)
@@ -213,11 +214,13 @@ struct hclgevf_rss_tuple_cfg {
 };
 
 struct hclgevf_rss_cfg {
-	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE]; /* user configured hash keys */
+	/* user configured hash keys */
+	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE_MAX];
 	u32 hash_algo;
 	u32 rss_size;
 	u8 hw_tc_map;
-	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE]; /* shadow table */
+	/* shadow table */
+	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE_MAX];
 	struct hclgevf_rss_tuple_cfg rss_tuple_sets;
 };
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 3/7] net: hns3: optimize the code when update the tc info
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 1/7] net: hns3: add api capability bits for firmware Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length Huazhong Tan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	GuoJia Liao, Huazhong Tan

From: GuoJia Liao <liaoguojia@huawei.com>

When update the TC info for NIC, there some differences
between PF and VF. Currently, four "vport->vport_id" are
used to distinguish PF or VF. So merge them into one to
improve readability and maintainability of code.

Signed-off-by: GuoJia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |  2 --
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h |  2 ++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c   | 15 ++++++++++-----
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index a8aa388..fcf1bca 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -55,8 +55,6 @@
 
 #define HCLGE_LINK_STATUS_MS	10
 
-#define HCLGE_VF_VPORT_START_NUM	1
-
 static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps);
 static int hclge_init_vlan_config(struct hclge_dev *hdev);
 static void hclge_sync_vlan_filter(struct hclge_dev *hdev);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index 2bb1dd4..e615ebf 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -17,6 +17,8 @@
 
 #define HCLGE_MAX_PF_NUM		8
 
+#define HCLGE_VF_VPORT_START_NUM	1
+
 #define HCLGE_RD_FIRST_STATS_NUM        2
 #define HCLGE_RD_OTHER_STATS_NUM        4
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 216ab1e..906d98e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -640,13 +640,18 @@ static void hclge_tm_vport_tc_info_update(struct hclge_vport *vport)
 	/* TC configuration is shared by PF/VF in one port, only allow
 	 * one tc for VF for simplicity. VF's vport_id is non zero.
 	 */
-	kinfo->tc_info.num_tc = vport->vport_id ? 1 :
+	if (vport->vport_id) {
+		kinfo->tc_info.num_tc = 1;
+		vport->qs_offset = HNAE3_MAX_TC +
+				   vport->vport_id - HCLGE_VF_VPORT_START_NUM;
+		vport_max_rss_size = hdev->vf_rss_size_max;
+	} else {
+		kinfo->tc_info.num_tc =
 			min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc);
-	vport->qs_offset = (vport->vport_id ? HNAE3_MAX_TC : 0) +
-				(vport->vport_id ? (vport->vport_id - 1) : 0);
+		vport->qs_offset = 0;
+		vport_max_rss_size = hdev->pf_rss_size_max;
+	}
 
-	vport_max_rss_size = vport->vport_id ? hdev->vf_rss_size_max :
-				hdev->pf_rss_size_max;
 	max_rss_size = min_t(u16, vport_max_rss_size,
 			     hclge_vport_get_max_rss_size(vport));
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
                   ` (2 preceding siblings ...)
  2021-02-02 12:39 ` [PATCH net-next 3/7] net: hns3: optimize the code when update the tc info Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-04  0:56   ` Jakub Kicinski
  2021-02-02 12:39 ` [PATCH net-next 5/7] net: hns3: debugfs add max tm rate specification print Huazhong Tan
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Yufeng Mo, Huazhong Tan

From: Yufeng Mo <moyufeng@huawei.com>

Since the newer hardware may supports different frame size,
so add support to obtain the capability from the firmware
instead of the fixed value.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h             | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h  | 3 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index f4c8d72..f27504e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -284,6 +284,7 @@ struct hnae3_dev_specs {
 	u16 int_ql_max; /* max value of interrupt coalesce based on INT_QL */
 	u16 max_int_gl; /* max value of interrupt coalesce based on INT_GL */
 	u8 max_non_tso_bd_num; /* max BD number of one non-TSO packet */
+	u16 max_pkt_len;
 };
 
 struct hnae3_client_ops {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index 9ceb059..0c8ac68 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -1131,7 +1131,8 @@ struct hclge_dev_specs_0_cmd {
 #define HCLGE_DEF_MAX_INT_GL		0x1FE0U
 
 struct hclge_dev_specs_1_cmd {
-	__le32 rsv0;
+	__le16 max_pkt_len;
+	__le16 rsv0;
 	__le16 max_int_gl;
 	u8 rsv1[18];
 };
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index fcf1bca..dd205c0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -1371,6 +1371,7 @@ static void hclge_set_default_dev_specs(struct hclge_dev *hdev)
 	ae_dev->dev_specs.rss_key_size = HCLGE_RSS_KEY_SIZE;
 	ae_dev->dev_specs.max_tm_rate = HCLGE_ETHER_MAX_RATE;
 	ae_dev->dev_specs.max_int_gl = HCLGE_DEF_MAX_INT_GL;
+	ae_dev->dev_specs.max_pkt_len = HCLGE_MAC_MAX_FRAME;
 }
 
 static void hclge_parse_dev_specs(struct hclge_dev *hdev,
@@ -1390,6 +1391,7 @@ static void hclge_parse_dev_specs(struct hclge_dev *hdev,
 	ae_dev->dev_specs.rss_key_size = le16_to_cpu(req0->rss_key_size);
 	ae_dev->dev_specs.max_tm_rate = le32_to_cpu(req0->max_tm_rate);
 	ae_dev->dev_specs.max_int_gl = le16_to_cpu(req1->max_int_gl);
+	ae_dev->dev_specs.max_pkt_len = le16_to_cpu(req1->max_pkt_len);
 }
 
 static void hclge_check_dev_specs(struct hclge_dev *hdev)
@@ -1406,6 +1408,8 @@ static void hclge_check_dev_specs(struct hclge_dev *hdev)
 		dev_specs->max_tm_rate = HCLGE_ETHER_MAX_RATE;
 	if (!dev_specs->max_int_gl)
 		dev_specs->max_int_gl = HCLGE_DEF_MAX_INT_GL;
+	if (!dev_specs->max_pkt_len)
+		dev_specs->max_pkt_len = HCLGE_MAC_MAX_FRAME;
 }
 
 static int hclge_query_dev_specs(struct hclge_dev *hdev)
@@ -9659,7 +9663,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
 	/* HW supprt 2 layer vlan */
 	max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
 	if (max_frm_size < HCLGE_MAC_MIN_FRAME ||
-	    max_frm_size > HCLGE_MAC_MAX_FRAME)
+	    max_frm_size > hdev->ae_dev->dev_specs.max_pkt_len)
 		return -EINVAL;
 
 	max_frm_size = max(max_frm_size, HCLGE_MAC_DEFAULT_FRAME);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 5/7] net: hns3: debugfs add max tm rate specification print
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
                   ` (3 preceding siblings ...)
  2021-02-02 12:39 ` [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 6/7] net: hns3: replace macro of max qset number with specification Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 7/7] net: hns3: remove unnecessary check in hns3_dbg_read() Huazhong Tan
  6 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

In order to add a method to check the specification of max tm rate
for debugging, function hns3_dbg_dev_specs() adds this value print.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 6978304..346f65f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -389,6 +389,7 @@ static void hns3_dbg_dev_specs(struct hnae3_handle *h)
 		 kinfo->tc_info.num_tc);
 	dev_info(priv->dev, "MAX INT QL: %u\n", dev_specs->int_ql_max);
 	dev_info(priv->dev, "MAX INT GL: %u\n", dev_specs->max_int_gl);
+	dev_info(priv->dev, "MAX TM RATE: %uMbps\n", dev_specs->max_tm_rate);
 }
 
 static ssize_t hns3_dbg_cmd_read(struct file *filp, char __user *buffer,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 6/7] net: hns3: replace macro of max qset number with specification
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
                   ` (4 preceding siblings ...)
  2021-02-02 12:39 ` [PATCH net-next 5/7] net: hns3: debugfs add max tm rate specification print Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  2021-02-02 12:39 ` [PATCH net-next 7/7] net: hns3: remove unnecessary check in hns3_dbg_read() Huazhong Tan
  6 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

The max qset number is a fixed value now and it is defined by a macro.
In order to support other value in different kinds of device, it is
better to use specification queried from frimware to replace macro.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h                | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c         | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h     | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 8 +++-----
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 4 ++++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h    | 2 ++
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index f27504e..10a3b72 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -285,6 +285,7 @@ struct hnae3_dev_specs {
 	u16 max_int_gl; /* max value of interrupt coalesce based on INT_GL */
 	u8 max_non_tso_bd_num; /* max BD number of one non-TSO packet */
 	u16 max_pkt_len;
+	u16 max_qset_num;
 };
 
 struct hnae3_client_ops {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 346f65f..448e7cd 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -390,6 +390,7 @@ static void hns3_dbg_dev_specs(struct hnae3_handle *h)
 	dev_info(priv->dev, "MAX INT QL: %u\n", dev_specs->int_ql_max);
 	dev_info(priv->dev, "MAX INT GL: %u\n", dev_specs->max_int_gl);
 	dev_info(priv->dev, "MAX TM RATE: %uMbps\n", dev_specs->max_tm_rate);
+	dev_info(priv->dev, "MAX QSET number: %u\n", dev_specs->max_qset_num);
 }
 
 static ssize_t hns3_dbg_cmd_read(struct file *filp, char __user *buffer,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index 0c8ac68..d7e7ea6 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -1132,7 +1132,7 @@ struct hclge_dev_specs_0_cmd {
 
 struct hclge_dev_specs_1_cmd {
 	__le16 max_pkt_len;
-	__le16 rsv0;
+	__le16 max_qset_num;
 	__le16 max_int_gl;
 	u8 rsv1[18];
 };
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 8f3fefe..113efd4 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -1599,8 +1599,6 @@ static void hclge_dbg_dump_qs_shaper_all(struct hclge_dev *hdev)
 static void hclge_dbg_dump_qs_shaper(struct hclge_dev *hdev,
 				     const char *cmd_buf)
 {
-#define HCLGE_MAX_QSET_NUM 1024
-
 	u16 qsid;
 	int ret;
 
@@ -1610,9 +1608,9 @@ static void hclge_dbg_dump_qs_shaper(struct hclge_dev *hdev,
 		return;
 	}
 
-	if (qsid >= HCLGE_MAX_QSET_NUM) {
-		dev_err(&hdev->pdev->dev, "qsid(%u) out of range[0-1023]\n",
-			qsid);
+	if (qsid >= hdev->ae_dev->dev_specs.max_qset_num) {
+		dev_err(&hdev->pdev->dev, "qsid(%u) out of range[0-%u]\n",
+			qsid, hdev->ae_dev->dev_specs.max_qset_num - 1);
 		return;
 	}
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index dd205c0..c4a3d32 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -1372,6 +1372,7 @@ static void hclge_set_default_dev_specs(struct hclge_dev *hdev)
 	ae_dev->dev_specs.max_tm_rate = HCLGE_ETHER_MAX_RATE;
 	ae_dev->dev_specs.max_int_gl = HCLGE_DEF_MAX_INT_GL;
 	ae_dev->dev_specs.max_pkt_len = HCLGE_MAC_MAX_FRAME;
+	ae_dev->dev_specs.max_qset_num = HCLGE_MAX_QSET_NUM;
 }
 
 static void hclge_parse_dev_specs(struct hclge_dev *hdev,
@@ -1390,6 +1391,7 @@ static void hclge_parse_dev_specs(struct hclge_dev *hdev,
 	ae_dev->dev_specs.int_ql_max = le16_to_cpu(req0->int_ql_max);
 	ae_dev->dev_specs.rss_key_size = le16_to_cpu(req0->rss_key_size);
 	ae_dev->dev_specs.max_tm_rate = le32_to_cpu(req0->max_tm_rate);
+	ae_dev->dev_specs.max_qset_num = le16_to_cpu(req1->max_qset_num);
 	ae_dev->dev_specs.max_int_gl = le16_to_cpu(req1->max_int_gl);
 	ae_dev->dev_specs.max_pkt_len = le16_to_cpu(req1->max_pkt_len);
 }
@@ -1406,6 +1408,8 @@ static void hclge_check_dev_specs(struct hclge_dev *hdev)
 		dev_specs->rss_key_size = HCLGE_RSS_KEY_SIZE;
 	if (!dev_specs->max_tm_rate)
 		dev_specs->max_tm_rate = HCLGE_ETHER_MAX_RATE;
+	if (!dev_specs->max_qset_num)
+		dev_specs->max_qset_num = HCLGE_MAX_QSET_NUM;
 	if (!dev_specs->max_int_gl)
 		dev_specs->max_int_gl = HCLGE_DEF_MAX_INT_GL;
 	if (!dev_specs->max_pkt_len)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index e615ebf..993d7aa 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -150,6 +150,8 @@
 /* Factor used to calculate offset and bitmap of VF num */
 #define HCLGE_VF_NUM_PER_CMD           64
 
+#define HCLGE_MAX_QSET_NUM		1024
+
 enum HLCGE_PORT_TYPE {
 	HOST_PORT,
 	NETWORK_PORT
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 7/7] net: hns3: remove unnecessary check in hns3_dbg_read()
  2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
                   ` (5 preceding siblings ...)
  2021-02-02 12:39 ` [PATCH net-next 6/7] net: hns3: replace macro of max qset number with specification Huazhong Tan
@ 2021-02-02 12:39 ` Huazhong Tan
  6 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-02 12:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, linuxarm,
	Huazhong Tan

Clang warns:

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:499:28: warning:
address of array 'filp->f_path.dentry->d_iname' will always evaluate
to 'true' [-Wpointer-bool-conversion]
        if (!filp->f_path.dentry->d_iname)

This check is unnecessary, so remove it.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 448e7cd..894b454 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -496,9 +496,6 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
 	ssize_t size = 0;
 	int ret = 0;
 
-	if (!filp->f_path.dentry->d_iname)
-		return -EINVAL;
-
 	read_buf = kzalloc(HNS3_DBG_READ_LEN, GFP_KERNEL);
 	if (!read_buf)
 		return -ENOMEM;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications
  2021-02-02 12:39 ` [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications Huazhong Tan
@ 2021-02-04  0:50   ` Jakub Kicinski
  2021-02-04  3:30     ` Huazhong Tan
  0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2021-02-04  0:50 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Guangbin Huang

On Tue, 2 Feb 2021 20:39:48 +0800 Huazhong Tan wrote:
>  struct hclgevf_rss_cfg {
> -	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE]; /* user configured hash keys */
> +	/* user configured hash keys */
> +	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE_MAX];
>  	u32 hash_algo;
>  	u32 rss_size;
>  	u8 hw_tc_map;
> -	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE]; /* shadow table */
> +	/* shadow table */
> +	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE_MAX];
>  	struct hclgevf_rss_tuple_cfg rss_tuple_sets;
>  };

What if the table sizes supported by the device grow beyond the
.._SIZE_MAX constants? Are you handling that case?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length
  2021-02-02 12:39 ` [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length Huazhong Tan
@ 2021-02-04  0:56   ` Jakub Kicinski
  2021-02-04  2:01     ` Huazhong Tan
  0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2021-02-04  0:56 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Yufeng Mo

On Tue, 2 Feb 2021 20:39:50 +0800 Huazhong Tan wrote:
> From: Yufeng Mo <moyufeng@huawei.com>
> 
> Since the newer hardware may supports different frame size,
> so add support to obtain the capability from the firmware
> instead of the fixed value.
> 
> Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>

> @@ -9659,7 +9663,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
>  	/* HW supprt 2 layer vlan */
>  	max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
>  	if (max_frm_size < HCLGE_MAC_MIN_FRAME ||
> -	    max_frm_size > HCLGE_MAC_MAX_FRAME)
> +	    max_frm_size > hdev->ae_dev->dev_specs.max_pkt_len)
>  		return -EINVAL;
>  
>  	max_frm_size = max(max_frm_size, HCLGE_MAC_DEFAULT_FRAME);

Don't you have to adjust netdev->max_mtu as well when device specifies
max_pkt_len different than HCLGE_MAC_MAX_FRAME?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length
  2021-02-04  0:56   ` Jakub Kicinski
@ 2021-02-04  2:01     ` Huazhong Tan
  0 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-04  2:01 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Yufeng Mo


On 2021/2/4 8:56, Jakub Kicinski wrote:
> On Tue, 2 Feb 2021 20:39:50 +0800 Huazhong Tan wrote:
>> From: Yufeng Mo <moyufeng@huawei.com>
>>
>> Since the newer hardware may supports different frame size,
>> so add support to obtain the capability from the firmware
>> instead of the fixed value.
>>
>> Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
>> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
>> @@ -9659,7 +9663,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
>>   	/* HW supprt 2 layer vlan */
>>   	max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
>>   	if (max_frm_size < HCLGE_MAC_MIN_FRAME ||
>> -	    max_frm_size > HCLGE_MAC_MAX_FRAME)
>> +	    max_frm_size > hdev->ae_dev->dev_specs.max_pkt_len)
>>   		return -EINVAL;
>>   
>>   	max_frm_size = max(max_frm_size, HCLGE_MAC_DEFAULT_FRAME);
> Don't you have to adjust netdev->max_mtu as well when device specifies
> max_pkt_len different than HCLGE_MAC_MAX_FRAME?

netdev->max_mtu should be adjusted as well, will fix it.

thanks.

> .


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications
  2021-02-04  0:50   ` Jakub Kicinski
@ 2021-02-04  3:30     ` Huazhong Tan
  0 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2021-02-04  3:30 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Guangbin Huang


On 2021/2/4 8:50, Jakub Kicinski wrote:
> On Tue, 2 Feb 2021 20:39:48 +0800 Huazhong Tan wrote:
>>   struct hclgevf_rss_cfg {
>> -	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE]; /* user configured hash keys */
>> +	/* user configured hash keys */
>> +	u8  rss_hash_key[HCLGEVF_RSS_KEY_SIZE_MAX];
>>   	u32 hash_algo;
>>   	u32 rss_size;
>>   	u8 hw_tc_map;
>> -	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE]; /* shadow table */
>> +	/* shadow table */
>> +	u8  rss_indirection_tbl[HCLGEVF_RSS_IND_TBL_SIZE_MAX];
>>   	struct hclgevf_rss_tuple_cfg rss_tuple_sets;
>>   };
> What if the table sizes supported by the device grow beyond the
> .._SIZE_MAX constants? Are you handling that case?

Sorry for missing this case, will allocate these tables by the queried 
size instead

of this fixed one, Since some verification job is needed, so this patch 
will resend later.

thanks.
> .


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/7] net: hns3: updates for -next
  2021-08-28  6:55 [PATCH net-next 0/7] net: hns3: updates for -next Guangbin Huang
@ 2021-08-28 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 21+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-28 11:30 UTC (permalink / raw)
  To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Sat, 28 Aug 2021 14:55:14 +0800 you wrote:
> This series includes some updates for the HNS3 ethernet driver.
> 
> #1 add a trace in  hclge_gen_resp_to_vf().
> #2~#4 refactor some functions.
> #5~#7 add some cleanups.
> 
> This series includes some optimizations, cleanups and one
> 
> [...]

Here is the summary with links:
  - [net-next,1/7] net: hns3: add trace event in hclge_gen_resp_to_vf()
    https://git.kernel.org/netdev/net-next/c/0fc36e37d5c0
  - [net-next,2/7] net: hns3: refactor function hclge_parse_capability()
    https://git.kernel.org/netdev/net-next/c/e1d93bc6ef3b
  - [net-next,3/7] net: hns3: refactor function hclgevf_parse_capability()
    https://git.kernel.org/netdev/net-next/c/81414ba71356
  - [net-next,4/7] net: hns3: add new function hclge_get_speed_bit()
    https://git.kernel.org/netdev/net-next/c/aec35aecc3cc
  - [net-next,5/7] net: hns3: don't config TM DWRR twice when set ETS
    https://git.kernel.org/netdev/net-next/c/7f2f8cf6ef66
  - [net-next,6/7] net: hns3: remove unnecessary "static" of local variables in function
    https://git.kernel.org/netdev/net-next/c/1026b1534fa1
  - [net-next,7/7] net: hns3: add required space in comment
    https://git.kernel.org/netdev/net-next/c/0cb0704149f0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2021-08-28  6:55 Guangbin Huang
  2021-08-28 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 21+ messages in thread
From: Guangbin Huang @ 2021-08-28  6:55 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2

This series includes some updates for the HNS3 ethernet driver.

#1 add a trace in  hclge_gen_resp_to_vf().
#2~#4 refactor some functions.
#5~#7 add some cleanups.

This series includes some optimizations, cleanups and one 

Guangbin Huang (4):
  net: hns3: refactor function hclge_parse_capability()
  net: hns3: refactor function hclgevf_parse_capability()
  net: hns3: add new function hclge_get_speed_bit()
  net: hns3: don't config TM DWRR twice when set ETS

Hao Chen (2):
  net: hns3: remove unnecessary "static" of local variables in function
  net: hns3: add required space in comment

Yufeng Mo (1):
  net: hns3: add trace event in hclge_gen_resp_to_vf()

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |  2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |  2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 51 ++++++++----------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |  8 ++-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c |  4 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 63 +++++++++++-----------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  5 ++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  2 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   | 29 +++++-----
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h   |  6 +++
 11 files changed, 92 insertions(+), 82 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2021-06-16  6:36 Guangbin Huang
  0 siblings, 0 replies; 21+ messages in thread
From: Guangbin Huang @ 2021-06-16  6:36 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, salil.mehta, lipeng321, huangguangbin2

This series includes some optimization in IO path for the HNS3 ethernet
driver.

Huazhong Tan (1):
  net: hns3: add support to query tx spare buffer size for pf

Yunsheng Lin (6):
  net: hns3: minor refactor related to desc_cb handling
  net: hns3: refactor for hns3_fill_desc() function
  net: hns3: use tx bounce buffer for small packets
  net: hns3: support dma_map_sg() for multi frags skb
  net: hns3: optimize the rx page reuse handling process
  net: hns3: use bounce buffer when rx page can not be reused

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |   8 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |  54 ++
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 575 ++++++++++++++++++---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  58 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |  66 +++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |   2 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  14 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |   2 +
 8 files changed, 680 insertions(+), 99 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/7] net: hns3: updates for -next
  2020-12-10  3:42 Huazhong Tan
@ 2020-12-10  4:34 ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2020-12-10  4:34 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, kuba, huangdaode

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Thu, 10 Dec 2020 11:42:05 +0800

> This patchset adds support for tc mqprio offload, hw tc
> offload of tc flower, and adpation for max rss size changes.

ZSeries applied, thanks.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2020-12-10  3:42 Huazhong Tan
  2020-12-10  4:34 ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Huazhong Tan @ 2020-12-10  3:42 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, kuba, huangdaode, Huazhong Tan

This patchset adds support for tc mqprio offload, hw tc
offload of tc flower, and adpation for max rss size changes.

Guojia Liao (3):
  net: hns3: add support for max 512 rss size
  net: hns3: adjust rss indirection table configure command
  net: hns3: adjust rss tc mode configure command

Jian Shen (4):
  net: hns3: refine the struct hane3_tc_info
  net: hns3: add support for tc mqprio offload
  net: hns3: add support for forwarding packet to queues of specified TC
    when flow director rule hit
  net: hns3: add support for hw tc offload of tc flower

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  34 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |   3 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 112 ++++-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |   2 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |  16 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 126 +++++-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c |   2 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 466 ++++++++++++++++++---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  28 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  98 +++--
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  21 +-
 12 files changed, 759 insertions(+), 151 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2020-11-27  8:47 Huazhong Tan
  0 siblings, 0 replies; 21+ messages in thread
From: Huazhong Tan @ 2020-11-27  8:47 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

This series includes some updates for the HNS3 ethernet driver.

#1~#6: add some updates related to the checksum offload.
#7: add support for multiple TCs' MAC pauce mode.

Huazhong Tan (6):
  net: hns3: add support for RX completion checksum
  net: hns3: add support for TX hardware checksum offload
  net: hns3: remove unsupported NETIF_F_GSO_UDP_TUNNEL_CSUM
  net: hns3: add udp tunnel checksum segmentation support
  net: hns3: add more info to hns3_dbg_bd_info()
  net: hns3: add a check for devcie's verion in hns3_tunnel_csum_bug()

Yonglong Liu (1):
  net: hns3: keep MAC pause mode when multiple TCs are enabled

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |   7 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |  62 ++++++++--
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 131 ++++++++++++++++-----
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  21 +++-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |   1 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |   4 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |   3 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  23 +++-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |   4 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h   |   3 +-
 10 files changed, 207 insertions(+), 52 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/7] net: hns3: updates for -next
  2020-09-29  9:31 Huazhong Tan
  2020-09-29 18:02 ` Jakub Kicinski
@ 2020-09-29 20:14 ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: David Miller @ 2020-09-29 20:14 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Tue, 29 Sep 2020 17:31:58 +0800

> There are some misc updates for the HNS3 ethernet driver.
> #1 uses the queried BD number as the limit for TSO.
> #2 renames trace event hns3_over_8bd since #1.
> #3 adds UDP segmentation offload support.
> #4 adds RoCE VF reset support.
> #5 is a minor cleanup.
> #6 & #7 add debugfs for device specifications and TQP enable status.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/7] net: hns3: updates for -next
  2020-09-29  9:31 Huazhong Tan
@ 2020-09-29 18:02 ` Jakub Kicinski
  2020-09-29 20:14 ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: Jakub Kicinski @ 2020-09-29 18:02 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

On Tue, 29 Sep 2020 17:31:58 +0800 Huazhong Tan wrote:
> There are some misc updates for the HNS3 ethernet driver.
> #1 uses the queried BD number as the limit for TSO.
> #2 renames trace event hns3_over_8bd since #1.
> #3 adds UDP segmentation offload support.
> #4 adds RoCE VF reset support.
> #5 is a minor cleanup.
> #6 & #7 add debugfs for device specifications and TQP enable status.

These patches look good to me, but please move away from the command
interface in debugfs and create a file for each thing you may want to
query.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 0/7] net: hns3: updates for -next
@ 2020-09-29  9:31 Huazhong Tan
  2020-09-29 18:02 ` Jakub Kicinski
  2020-09-29 20:14 ` David Miller
  0 siblings, 2 replies; 21+ messages in thread
From: Huazhong Tan @ 2020-09-29  9:31 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

There are some misc updates for the HNS3 ethernet driver.
#1 uses the queried BD number as the limit for TSO.
#2 renames trace event hns3_over_8bd since #1.
#3 adds UDP segmentation offload support.
#4 adds RoCE VF reset support.
#5 is a minor cleanup.
#6 & #7 add debugfs for device specifications and TQP enable status.

Guangbin Huang (2):
  net: hns3: debugfs add new command to query device specifications
  net: hns3: dump tqp enable status in debugfs

Guojia Liao (1):
  net: hns3: remove unused code in hns3_self_test()

Huazhong Tan (4):
  net: hns3: replace macro HNS3_MAX_NON_TSO_BD_NUM
  net: hns3: rename trace event hns3_over_8bd
  net: hns3: add UDP segmentation offload support
  net: hns3: Add RoCE VF reset support

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  3 +
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 50 ++++++++++++++-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 71 ++++++++++++++--------
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  8 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |  9 +--
 drivers/net/ethernet/hisilicon/hns3/hns3_trace.h   |  2 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 50 +++++++++++++++
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |  1 +
 8 files changed, 157 insertions(+), 37 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-08-28 11:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 12:39 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 1/7] net: hns3: add api capability bits for firmware Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 2/7] net: hns3: RSS indirection table and key use device specifications Huazhong Tan
2021-02-04  0:50   ` Jakub Kicinski
2021-02-04  3:30     ` Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 3/7] net: hns3: optimize the code when update the tc info Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length Huazhong Tan
2021-02-04  0:56   ` Jakub Kicinski
2021-02-04  2:01     ` Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 5/7] net: hns3: debugfs add max tm rate specification print Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 6/7] net: hns3: replace macro of max qset number with specification Huazhong Tan
2021-02-02 12:39 ` [PATCH net-next 7/7] net: hns3: remove unnecessary check in hns3_dbg_read() Huazhong Tan
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  6:55 [PATCH net-next 0/7] net: hns3: updates for -next Guangbin Huang
2021-08-28 11:30 ` patchwork-bot+netdevbpf
2021-06-16  6:36 Guangbin Huang
2020-12-10  3:42 Huazhong Tan
2020-12-10  4:34 ` David Miller
2020-11-27  8:47 Huazhong Tan
2020-09-29  9:31 Huazhong Tan
2020-09-29 18:02 ` Jakub Kicinski
2020-09-29 20:14 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.