DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver
@ 2020-05-22  9:21 Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 1/5] net/hns3: replace PF vport id zero with private macro Wei Hu (Xavier)
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

This series are improvement and bugfixes for hns3 PMD driver.

Chengchang Tang (2):
  net/hns3: replace PF vport id zero with private macro
  net/hns3: fix promiscuous config not clear for PF on uninit

Lijun Ou (2):
  net/hns3: add RSS hash offload to port Rx configuration
  net/hns3: fix key length when configuring RSS

Wei Hu (Xavier) (1):
  net/hns3: fix preparing sending packets less than 60 bytes

 drivers/net/hns3/hns3_ethdev.c    | 102 ++++++++++++++++++++++++--------------
 drivers/net/hns3/hns3_ethdev.h    |   3 ++
 drivers/net/hns3/hns3_ethdev_vf.c |   1 +
 drivers/net/hns3/hns3_flow.c      |   8 +++
 drivers/net/hns3/hns3_rxtx.c      |   6 ---
 5 files changed, 78 insertions(+), 42 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH 1/5] net/hns3: replace PF vport id zero with private macro
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
@ 2020-05-22  9:21 ` Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 2/5] net/hns3: fix promiscuous config not clear for PF on uninit Wei Hu (Xavier)
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

From: Chengchang Tang <tangchengchang@huawei.com>

In hns3 PMD driver, the vport id 0 denote PF, and the vport id 1 denote
the first VF device of the port.

This patch adds two macros named HNS3_PF_FUNC_ID and HNS3_1ST_VF_FUNC_ID,
and replaces this two numbers to improve code readability.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 48 +++++++++++++++++++-----------------------
 drivers/net/hns3/hns3_ethdev.h |  3 +++
 2 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index a09ac08..06c4886 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -474,10 +474,9 @@ hns3_set_vlan_rx_offload_cfg(struct hns3_adapter *hns,
 
 	/*
 	 * In current version VF is not supported when PF is driven by DPDK
-	 * driver, the PF-related vf_id is 0, just need to configure parameters
-	 * for vport_id 0.
+	 * driver, just need to configure parameters for PF vport.
 	 */
-	vport_id = 0;
+	vport_id = HNS3_PF_FUNC_ID;
 	req->vf_offset = vport_id / HNS3_VF_NUM_PER_CMD;
 	bitmap = 1 << (vport_id % HNS3_VF_NUM_PER_BYTE);
 	req->vf_bitmap[req->vf_offset] = bitmap;
@@ -564,14 +563,16 @@ hns3_vlan_filter_init(struct hns3_adapter *hns)
 	int ret;
 
 	ret = hns3_set_vlan_filter_ctrl(hw, HNS3_FILTER_TYPE_VF,
-					HNS3_FILTER_FE_EGRESS, false, 0);
+					HNS3_FILTER_FE_EGRESS, false,
+					HNS3_PF_FUNC_ID);
 	if (ret) {
 		hns3_err(hw, "failed to init vf vlan filter, ret = %d", ret);
 		return ret;
 	}
 
 	ret = hns3_set_vlan_filter_ctrl(hw, HNS3_FILTER_TYPE_PORT,
-					HNS3_FILTER_FE_INGRESS, false, 0);
+					HNS3_FILTER_FE_INGRESS, false,
+					HNS3_PF_FUNC_ID);
 	if (ret)
 		hns3_err(hw, "failed to init port vlan filter, ret = %d", ret);
 
@@ -585,7 +586,8 @@ hns3_enable_vlan_filter(struct hns3_adapter *hns, bool enable)
 	int ret;
 
 	ret = hns3_set_vlan_filter_ctrl(hw, HNS3_FILTER_TYPE_PORT,
-					HNS3_FILTER_FE_INGRESS, enable, 0);
+					HNS3_FILTER_FE_INGRESS, enable,
+					HNS3_PF_FUNC_ID);
 	if (ret)
 		hns3_err(hw, "failed to %s port vlan filter, ret = %d",
 			 enable ? "enable" : "disable", ret);
@@ -674,10 +676,9 @@ hns3_set_vlan_tx_offload_cfg(struct hns3_adapter *hns,
 
 	/*
 	 * In current version VF is not supported when PF is driven by DPDK
-	 * driver, the PF-related vf_id is 0, just need to configure parameters
-	 * for vport_id 0.
+	 * driver, just need to configure parameters for PF vport.
 	 */
-	vport_id = 0;
+	vport_id = HNS3_PF_FUNC_ID;
 	req->vf_offset = vport_id / HNS3_VF_NUM_PER_CMD;
 	bitmap = 1 << (vport_id % HNS3_VF_NUM_PER_BYTE);
 	req->vf_bitmap[req->vf_offset] = bitmap;
@@ -1425,10 +1426,9 @@ hns3_add_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 
 	/*
 	 * In current version VF is not supported when PF is driven by DPDK
-	 * driver, the PF-related vf_id is 0, just need to configure parameters
-	 * for vf_id 0.
+	 * driver, just need to configure parameters for PF vport.
 	 */
-	vf_id = 0;
+	vf_id = HNS3_PF_FUNC_ID;
 	hns3_set_field(egress_port, HNS3_MAC_EPORT_VFID_M,
 		       HNS3_MAC_EPORT_VFID_S, vf_id);
 
@@ -1781,10 +1781,9 @@ hns3_add_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 
 	/*
 	 * In current version VF is not supported when PF is driven by DPDK
-	 * driver, the PF-related vf_id is 0, just need to configure parameters
-	 * for vf_id 0.
+	 * driver, just need to configure parameters for PF vport.
 	 */
-	vf_id = 0;
+	vf_id = HNS3_PF_FUNC_ID;
 	hns3_update_desc_vfid(desc, vf_id, false);
 	ret = hns3_add_mac_vlan_tbl(hw, &req, desc);
 	if (ret) {
@@ -1824,10 +1823,9 @@ hns3_remove_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 		/*
 		 * This mac addr exist, remove this handle's VFID for it.
 		 * In current version VF is not supported when PF is driven by
-		 * DPDK driver, the PF-related vf_id is 0, just need to
-		 * configure parameters for vf_id 0.
+		 * DPDK driver, just need to configure parameters for PF vport.
 		 */
-		vf_id = 0;
+		vf_id = HNS3_PF_FUNC_ID;
 		hns3_update_desc_vfid(desc, vf_id, true);
 
 		/* All the vfid is zero, so need to delete this entry */
@@ -2926,8 +2924,8 @@ hns3_map_tqp(struct hns3_hw *hw)
 	 */
 	tqp_id = 0;
 	num = DIV_ROUND_UP(hw->total_tqps_num, HNS3_MAX_TQP_NUM_PER_FUNC);
-	for (func_id = 0; func_id < num; func_id++) {
-		is_pf = func_id == 0 ? true : false;
+	for (func_id = HNS3_PF_FUNC_ID; func_id < num; func_id++) {
+		is_pf = func_id == HNS3_PF_FUNC_ID ? true : false;
 		for (i = 0;
 		     i < HNS3_MAX_TQP_NUM_PER_FUNC && tqp_id < tqps_num; i++) {
 			ret = hns3_map_tqps_to_func(hw, func_id, tqp_id++, i,
@@ -3819,10 +3817,9 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc)
 
 	/*
 	 * In current version VF is not supported when PF is driven by DPDK
-	 * driver, the PF-related vf_id is 0, just need to configure parameters
-	 * for vf_id 0.
+	 * driver, just need to configure parameters for PF vport.
 	 */
-	vf_id = 0;
+	vf_id = HNS3_PF_FUNC_ID;
 
 	hns3_promisc_param_init(&param, en_uc_pmc, en_mc_pmc, en_bc_pmc, vf_id);
 	return hns3_cmd_set_promisc_mode(hw, &param);
@@ -3837,8 +3834,7 @@ hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
 	uint16_t func_id;
 	int ret;
 
-	/* func_id 0 is denoted PF, the VFs start from 1 */
-	for (func_id = 1; func_id < pf->func_num; func_id++) {
+	for (func_id = HNS3_1ST_VF_FUNC_ID; func_id < pf->func_num; func_id++) {
 		hns3_promisc_param_init(&param, false, false, false, func_id);
 		ret = hns3_cmd_set_promisc_mode(hw, &param);
 		if (ret)
@@ -5056,7 +5052,7 @@ hns3_prepare_reset(struct hns3_adapter *hns)
 
 	switch (hw->reset.level) {
 	case HNS3_FUNC_RESET:
-		ret = hns3_func_reset_cmd(hw, 0);
+		ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
 		if (ret)
 			return ret;
 
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 06a1864..bc458cb 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -30,6 +30,9 @@
 #define HNS3_PCI_REVISION_ID			0x08
 #define HNS3_PCI_REVISION_ID_LEN		1
 
+#define HNS3_PF_FUNC_ID			0
+#define HNS3_1ST_VF_FUNC_ID		1
+
 #define HNS3_UC_MACADDR_NUM		128
 #define HNS3_VF_UC_MACADDR_NUM		48
 #define HNS3_MC_MACADDR_NUM		128
-- 
2.7.4


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

* [dpdk-dev] [PATCH 2/5] net/hns3: fix promiscuous config not clear for PF on uninit
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 1/5] net/hns3: replace PF vport id zero with private macro Wei Hu (Xavier)
@ 2020-05-22  9:21 ` Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 3/5] net/hns3: fix preparing sending packets less than 60 bytes Wei Hu (Xavier)
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

From: Chengchang Tang <tangchengchang@huawei.com>

Currently, promiscuous mode configuration are not cleared during
unintialziation based on hns3 PF device. The residual entries may cause
unnecessary bandwidth usage.

So, we need clear the PF's promisc mode status during the uninit.

Fixes: a45fd0aa0ea1 ("net/hns3: fix Rx queue search with broadcast packet")
Fixes: d51867db65c1 ("net/hns3: add initialization")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 53 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 43 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 06c4886..1c06b8f 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3826,7 +3826,7 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc)
 }
 
 static int
-hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
+hns3_promisc_init(struct hns3_hw *hw)
 {
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	struct hns3_pf *pf = &hns->pf;
@@ -3834,16 +3834,54 @@ hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
 	uint16_t func_id;
 	int ret;
 
+	ret = hns3_set_promisc_mode(hw, false, false);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "failed to set promisc mode, ret = %d", ret);
+		return ret;
+	}
+
+	/*
+	 * In current version VFs are not supported when PF is driven by DPDK
+	 * driver. After PF has been taken over by DPDK, the original VF will
+	 * be invalid. So, there is a possibility of entry residues. It should
+	 * clear VFs's promisc mode to avoid unnecessary bandwidth usage
+	 * during init.
+	 */
 	for (func_id = HNS3_1ST_VF_FUNC_ID; func_id < pf->func_num; func_id++) {
 		hns3_promisc_param_init(&param, false, false, false, func_id);
 		ret = hns3_cmd_set_promisc_mode(hw, &param);
-		if (ret)
+		if (ret) {
+			PMD_INIT_LOG(ERR, "failed to clear vf:%d promisc mode,"
+					" ret = %d", func_id, ret);
 			return ret;
+		}
 	}
 
 	return 0;
 }
 
+static void
+hns3_promisc_uninit(struct hns3_hw *hw)
+{
+	struct hns3_promisc_param param;
+	uint16_t func_id;
+	int ret;
+
+	func_id = HNS3_PF_FUNC_ID;
+
+	/*
+	 * In current version VFs are not supported when PF is driven by
+	 * DPDK driver, and VFs' promisc mode status has been cleared during
+	 * init and their status will not change. So just clear PF's promisc
+	 * mode status during uninit.
+	 */
+	hns3_promisc_param_init(&param, false, false, false, func_id);
+	ret = hns3_cmd_set_promisc_mode(hw, &param);
+	if (ret)
+		PMD_INIT_LOG(ERR, "failed to clear promisc status during"
+				" uninit, ret = %d", ret);
+}
+
 static int
 hns3_dev_promiscuous_enable(struct rte_eth_dev *dev)
 {
@@ -4186,15 +4224,9 @@ hns3_init_hardware(struct hns3_adapter *hns)
 		goto err_mac_init;
 	}
 
-	ret = hns3_set_promisc_mode(hw, false, false);
-	if (ret) {
-		PMD_INIT_LOG(ERR, "Failed to set promisc mode: %d", ret);
-		goto err_mac_init;
-	}
-
-	ret = hns3_clear_all_vfs_promisc_mode(hw);
+	ret = hns3_promisc_init(hw);
 	if (ret) {
-		PMD_INIT_LOG(ERR, "Failed to clear all vfs promisc mode: %d",
+		PMD_INIT_LOG(ERR, "Failed to init promisc: %d",
 			     ret);
 		goto err_mac_init;
 	}
@@ -4353,6 +4385,7 @@ hns3_uninit_pf(struct rte_eth_dev *eth_dev)
 
 	hns3_enable_hw_error_intr(hns, false);
 	hns3_rss_uninit(hns);
+	hns3_promisc_uninit(hw);
 	hns3_fdir_filter_uninit(hns);
 	hns3_uninit_umv_space(hw);
 	hns3_pf_disable_irq0(hw);
-- 
2.7.4


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

* [dpdk-dev] [PATCH 3/5] net/hns3: fix preparing sending packets less than 60 bytes
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 1/5] net/hns3: replace PF vport id zero with private macro Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 2/5] net/hns3: fix promiscuous config not clear for PF on uninit Wei Hu (Xavier)
@ 2020-05-22  9:21 ` Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 4/5] net/hns3: add RSS hash offload to port Rx configuration Wei Hu (Xavier)
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

Currently, when running testpmd application based on hns3 network engine
with csum fwd mode by "set fwd csum" command in the prompt line, sending
42 consecutive bytes of arp packets to network port with packets generator,
But in fact hardware can't send the arp packets and the related logs as
below:
"Preparing packet burst to failed: Invalid argument"

The hardware doesn't support transmit packets less than 60 bytes, and in
the '.tx_pkt_burst' ops implementation function named hns3_xmit_pkts
appending operation has been added for less than 60 bytes packets. So the
interception needs to be removed in the '.tx_pkt_prepare' ops
implementation function named hns3_prep_pkts.

Fixes: de620754a109 ("net/hns3: fix sending packets less than 60 bytes")
Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 8b3ced1..25ba3b8 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2313,12 +2313,6 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	for (i = 0; i < nb_pkts; i++) {
 		m = tx_pkts[i];
 
-		/* check the size of packet */
-		if (m->pkt_len < RTE_ETHER_MIN_LEN) {
-			rte_errno = EINVAL;
-			return i;
-		}
-
 		if (hns3_pkt_is_tso(m) &&
 		    (hns3_pkt_need_linearized(m, m->nb_segs) ||
 		     hns3_check_tso_pkt_valid(m))) {
-- 
2.7.4


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

* [dpdk-dev] [PATCH 4/5] net/hns3: add RSS hash offload to port Rx configuration
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
                   ` (2 preceding siblings ...)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 3/5] net/hns3: fix preparing sending packets less than 60 bytes Wei Hu (Xavier)
@ 2020-05-22  9:21 ` Wei Hu (Xavier)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 5/5] net/hns3: fix key length when configuring RSS Wei Hu (Xavier)
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

From: Lijun Ou <oulijun@huawei.com>

Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`. The hns3 PMD driver
already can notify the validity of `rte_mbuf::hash:rss` to the application
by enabling `PKT_RX_RSS_HASH` flag in `rte_mbuf::ol_flags`.

Fixes: 19a3ca4c99cf ("net/hns3: add start/stop and configure operations")
Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 1 +
 drivers/net/hns3/hns3_ethdev_vf.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 1c06b8f..33d7c5c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2312,6 +2312,7 @@ hns3_dev_configure(struct rte_eth_dev *dev)
 
 	/* When RSS is not configured, redirect the packet queue 0 */
 	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {
+		conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 		rss_conf = conf->rx_adv_conf.rss_conf;
 		if (rss_conf.rss_key == NULL) {
 			rss_conf.rss_key = rss_cfg->key;
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 904562e..16d6012 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -784,6 +784,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)
 
 	/* When RSS is not configured, redirect the packet queue 0 */
 	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {
+		conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 		rss_conf = conf->rx_adv_conf.rss_conf;
 		if (rss_conf.rss_key == NULL) {
 			rss_conf.rss_key = rss_cfg->key;
-- 
2.7.4


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

* [dpdk-dev] [PATCH 5/5] net/hns3: fix key length when configuring RSS
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
                   ` (3 preceding siblings ...)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 4/5] net/hns3: add RSS hash offload to port Rx configuration Wei Hu (Xavier)
@ 2020-05-22  9:21 ` Wei Hu (Xavier)
  2020-05-22 11:20 ` [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Ferruh Yigit
  2020-05-27 15:36 ` Ferruh Yigit
  6 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-22  9:21 UTC (permalink / raw)
  To: dev

From: Lijun Ou <oulijun@huawei.com>

When users set the length of rss hash key greater than the supported
length by hardware, the pmd driver should intercept and can not
configure the wrong key into the hardware.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index aef301a..e3c2392 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1475,6 +1475,14 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
+	if (rss_flow_conf.key_len &&
+	    rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
+		hns3_err(hw,
+			"input hash key(%u) greater than supported len(%lu)",
+			rss_flow_conf.key_len, RTE_DIM(rss_info->key));
+		return -EINVAL;
+	}
+
 	/* Filter the unsupported flow types */
 	flow_types = rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT;
 	if (flow_types != rss_flow_conf.types)
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
                   ` (4 preceding siblings ...)
  2020-05-22  9:21 ` [dpdk-dev] [PATCH 5/5] net/hns3: fix key length when configuring RSS Wei Hu (Xavier)
@ 2020-05-22 11:20 ` Ferruh Yigit
  2020-05-23  1:33   ` Wei Hu (Xavier)
  2020-05-27 15:36 ` Ferruh Yigit
  6 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2020-05-22 11:20 UTC (permalink / raw)
  To: Wei Hu (Xavier), dev; +Cc: Thomas Monjalon

On 5/22/2020 10:21 AM, Wei Hu (Xavier) wrote:
> This series are improvement and bugfixes for hns3 PMD driver.

Hi Xavier,

We are planning to have the -rc4 this weekend and the release on Tuesday. So we
are literally a few days away from the release.

It is definitely not good idea to change the code this close to the release,
that is why we are saying -rc4 for the critical defects only.

I will postpone this series to the next release, fyi.

> 
> Chengchang Tang (2):
>   net/hns3: replace PF vport id zero with private macro
>   net/hns3: fix promiscuous config not clear for PF on uninit
> 
> Lijun Ou (2):
>   net/hns3: add RSS hash offload to port Rx configuration
>   net/hns3: fix key length when configuring RSS
> 
> Wei Hu (Xavier) (1):
>   net/hns3: fix preparing sending packets less than 60 bytes
> 
>  drivers/net/hns3/hns3_ethdev.c    | 102 ++++++++++++++++++++++++--------------
>  drivers/net/hns3/hns3_ethdev.h    |   3 ++
>  drivers/net/hns3/hns3_ethdev_vf.c |   1 +
>  drivers/net/hns3/hns3_flow.c      |   8 +++
>  drivers/net/hns3/hns3_rxtx.c      |   6 ---
>  5 files changed, 78 insertions(+), 42 deletions(-)
> 


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

* Re: [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver
  2020-05-22 11:20 ` [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Ferruh Yigit
@ 2020-05-23  1:33   ` Wei Hu (Xavier)
  0 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-23  1:33 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Thomas Monjalon



On 2020/5/22 19:20, Ferruh Yigit wrote:
> On 5/22/2020 10:21 AM, Wei Hu (Xavier) wrote:
>> This series are improvement and bugfixes for hns3 PMD driver.
> Hi Xavier,
>
> We are planning to have the -rc4 this weekend and the release on Tuesday. So we
> are literally a few days away from the release.
>
> It is definitely not good idea to change the code this close to the release,
> that is why we are saying -rc4 for the critical defects only.
>
> I will postpone this series to the next release, fyi.
Hi, Ferruh Yigit
   I got it.  I will adjust the frequency of sending patches to the 
community in future.
   Thank you.

   Regards
Xavier
>> Chengchang Tang (2):
>>    net/hns3: replace PF vport id zero with private macro
>>    net/hns3: fix promiscuous config not clear for PF on uninit
>>
>> Lijun Ou (2):
>>    net/hns3: add RSS hash offload to port Rx configuration
>>    net/hns3: fix key length when configuring RSS
>>
>> Wei Hu (Xavier) (1):
>>    net/hns3: fix preparing sending packets less than 60 bytes
>>
>>   drivers/net/hns3/hns3_ethdev.c    | 102 ++++++++++++++++++++++++--------------
>>   drivers/net/hns3/hns3_ethdev.h    |   3 ++
>>   drivers/net/hns3/hns3_ethdev_vf.c |   1 +
>>   drivers/net/hns3/hns3_flow.c      |   8 +++
>>   drivers/net/hns3/hns3_rxtx.c      |   6 ---
>>   5 files changed, 78 insertions(+), 42 deletions(-)
>>
>



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

* Re: [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver
  2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
                   ` (5 preceding siblings ...)
  2020-05-22 11:20 ` [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Ferruh Yigit
@ 2020-05-27 15:36 ` Ferruh Yigit
  2020-05-28  1:35   ` Wei Hu (Xavier)
  6 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2020-05-27 15:36 UTC (permalink / raw)
  To: Wei Hu (Xavier), dev

On 5/22/2020 10:21 AM, Wei Hu (Xavier) wrote:
> This series are improvement and bugfixes for hns3 PMD driver.
> 
> Chengchang Tang (2):
>   net/hns3: replace PF vport id zero with private macro
>   net/hns3: fix promiscuous config not clear for PF on uninit
> 
> Lijun Ou (2):
>   net/hns3: add RSS hash offload to port Rx configuration
>   net/hns3: fix key length when configuring RSS
> 
> Wei Hu (Xavier) (1):
>   net/hns3: fix preparing sending packets less than 60 bytes
> 

Series applied to dpdk-next-net/master, thanks.

A minor modification done [1] to fix 32-bit build error [2].


[1]
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index e3c239286a..c7851b235c 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1478,7 +1478,7 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
        if (rss_flow_conf.key_len &&
            rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
                hns3_err(hw,
-                       "input hash key(%u) greater than supported len(%lu)",
+                       "input hash key(%u) greater than supported len(%zu)",
                        rss_flow_conf.key_len, RTE_DIM(rss_info->key));
                return -EINVAL;
        }



[2]
In file included from .../drivers/net/hns3/hns3_flow.c:12:
.../drivers/net/hns3/hns3_flow.c: In function ‘hns3_config_rss_filter’:
.../drivers/net/hns3/hns3_logs.h:16:38: error: format ‘%lu’ expects argument of
type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Werror=format=]
   16 |  rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
      |                                      ^~~~~~~~~~~
.../drivers/net/hns3/hns3_logs.h:20:2: note: in expansion of macro ‘PMD_DRV_LOG_RAW’
   20 |  PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
      |  ^~~~~~~~~~~~~~~
.../drivers/net/hns3/hns3_flow.c:1480:3: note: in expansion of macro ‘hns3_err’
 1480 |   hns3_err(hw,
      |   ^~~~~~~~
.../drivers/net/hns3/hns3_flow.c:1481:53: note: format string is defined here
 1481 |    "input hash key(%u) greater than supported len(%lu)",
      |                                                   ~~^
      |                                                     |
      |                                                     long unsigned int
      |                                                   %u
cc1: all warnings being treated as errors



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

* Re: [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver
  2020-05-27 15:36 ` Ferruh Yigit
@ 2020-05-28  1:35   ` Wei Hu (Xavier)
  0 siblings, 0 replies; 10+ messages in thread
From: Wei Hu (Xavier) @ 2020-05-28  1:35 UTC (permalink / raw)
  To: Ferruh Yigit, dev

Hi, Ferruh Yigit


On 2020/5/27 23:36, Ferruh Yigit wrote:
> On 5/22/2020 10:21 AM, Wei Hu (Xavier) wrote:
>> This series are improvement and bugfixes for hns3 PMD driver.
>>
>> Chengchang Tang (2):
>>    net/hns3: replace PF vport id zero with private macro
>>    net/hns3: fix promiscuous config not clear for PF on uninit
>>
>> Lijun Ou (2):
>>    net/hns3: add RSS hash offload to port Rx configuration
>>    net/hns3: fix key length when configuring RSS
>>
>> Wei Hu (Xavier) (1):
>>    net/hns3: fix preparing sending packets less than 60 bytes
>>
> Series applied to dpdk-next-net/master, thanks.
>
> A minor modification done [1] to fix 32-bit build error [2].
>
>
> [1]
> diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
> index e3c239286a..c7851b235c 100644
> --- a/drivers/net/hns3/hns3_flow.c
> +++ b/drivers/net/hns3/hns3_flow.c
> @@ -1478,7 +1478,7 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
>          if (rss_flow_conf.key_len &&
>              rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
>                  hns3_err(hw,
> -                       "input hash key(%u) greater than supported len(%lu)",
> +                       "input hash key(%u) greater than supported len(%zu)",
>                          rss_flow_conf.key_len, RTE_DIM(rss_info->key));
>                  return -EINVAL;
>          }
>
>
>
> [2]
> In file included from .../drivers/net/hns3/hns3_flow.c:12:
> .../drivers/net/hns3/hns3_flow.c: In function ‘hns3_config_rss_filter’:
> .../drivers/net/hns3/hns3_logs.h:16:38: error: format ‘%lu’ expects argument of
> type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Werror=format=]
>     16 |  rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
>        |                                      ^~~~~~~~~~~
> .../drivers/net/hns3/hns3_logs.h:20:2: note: in expansion of macro ‘PMD_DRV_LOG_RAW’
>     20 |  PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
>        |  ^~~~~~~~~~~~~~~
> .../drivers/net/hns3/hns3_flow.c:1480:3: note: in expansion of macro ‘hns3_err’
>   1480 |   hns3_err(hw,
>        |   ^~~~~~~~
> .../drivers/net/hns3/hns3_flow.c:1481:53: note: format string is defined here
>   1481 |    "input hash key(%u) greater than supported len(%lu)",
>        |                                                   ~~^
>        |                                                     |
>        |                                                     long unsigned int
>        |                                                   %u
> cc1: all warnings being treated as errors
>
>
   Thank you very much!
Xavier


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

end of thread, other threads:[~2020-05-28  1:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  9:21 [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Wei Hu (Xavier)
2020-05-22  9:21 ` [dpdk-dev] [PATCH 1/5] net/hns3: replace PF vport id zero with private macro Wei Hu (Xavier)
2020-05-22  9:21 ` [dpdk-dev] [PATCH 2/5] net/hns3: fix promiscuous config not clear for PF on uninit Wei Hu (Xavier)
2020-05-22  9:21 ` [dpdk-dev] [PATCH 3/5] net/hns3: fix preparing sending packets less than 60 bytes Wei Hu (Xavier)
2020-05-22  9:21 ` [dpdk-dev] [PATCH 4/5] net/hns3: add RSS hash offload to port Rx configuration Wei Hu (Xavier)
2020-05-22  9:21 ` [dpdk-dev] [PATCH 5/5] net/hns3: fix key length when configuring RSS Wei Hu (Xavier)
2020-05-22 11:20 ` [dpdk-dev] [PATCH 0/5] misc updates for hns3 PMD driver Ferruh Yigit
2020-05-23  1:33   ` Wei Hu (Xavier)
2020-05-27 15:36 ` Ferruh Yigit
2020-05-28  1:35   ` Wei Hu (Xavier)

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git