[dpdk-stable] patch 'net/hns3: fix configuring RSS hash when rules are flushed' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:27 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 70b22c9ed2b55a3a523ec68734cd5435d1395a9a Mon Sep 17 00:00:00 2001
From: Lijun Ou <oulijun at huawei.com>
Date: Thu, 26 Mar 2020 15:14:31 +0800
Subject: [PATCH] net/hns3: fix configuring RSS hash when rules are flushed

[ upstream commit 5e782bc2570c5746b8190d1b5c717de8ee77d0bd ]

Currently, when performing test case as follow:
1. Run testpmd application based on hns3 network engine with multiple
   receive queues(--rxq=N --txq=N, N>1).
2. Create the special RSS rules by "create flow ..." command in the
   command prompt of the testpmd application.
3. Flush the RSS rules created in step 2 by "flow flush ..." command.
4. Enable RSS by "port config all rss all" command.
In step 4, the command exeuctes successfully. This phenomenon is
inconsistent with the expectation. The API function named
rte_eth_dev_rss_hash_update called in the command should return error
and the command should fail.

This patch fixes it by adding a flag for disabling RSS in the driver.
When RSS rules is flushed, we set the the flag with true, and the
'.rss_hash_update' ops implementation function named
hns3_dev_rss_hash_update return -EINVAL.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Lijun Ou <oulijun at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 1 +
 drivers/net/hns3/hns3_ethdev.h    | 1 +
 drivers/net/hns3/hns3_ethdev_vf.c | 1 +
 drivers/net/hns3/hns3_flow.c      | 1 +
 drivers/net/hns3/hns3_rss.c       | 3 +++
 5 files changed, 7 insertions(+)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 7c4c2e42c0..42ef33f4b9 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2541,6 +2541,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
 
 	hw->mac.media_type = cfg.media_type;
 	hw->rss_size_max = cfg.rss_size_max;
+	hw->rss_dis_flag = false;
 	hw->rx_buf_len = cfg.rx_buf_len;
 	memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
 	hw->mac.phy_addr = cfg.phy_addr;
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 975680ea21..03bbd24dac 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -358,6 +358,7 @@ struct hns3_hw {
 
 	/* The configuration info of RSS */
 	struct hns3_rss_conf rss_info;
+	bool rss_dis_flag; /* disable rss flag. true: disable, false: enable */
 
 	uint8_t num_tc;             /* Total number of enabled TCs */
 	uint8_t hw_tc_map;
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 2096ad6fcd..879851630d 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -784,6 +784,7 @@ hns3vf_get_configuration(struct hns3_hw *hw)
 	int ret;
 
 	hw->mac.media_type = HNS3_MEDIA_TYPE_NONE;
+	hw->rss_dis_flag = false;
 
 	/* Get queue configuration from PF */
 	ret = hns3vf_get_queue_info(hw);
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 207dd578a0..c7027a779a 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1328,6 +1328,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 
 	/* Disable RSS */
 	hw->rss_info.conf.types = 0;
+	hw->rss_dis_flag = true;
 
 	return 0;
 }
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index b8c20e6d9d..9b6b72908f 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -257,6 +257,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	uint8_t *key = rss_conf->rss_key;
 	int ret;
 
+	if (hw->rss_dis_flag)
+		return -EINVAL;
+
 	rte_spinlock_lock(&hw->lock);
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, tuple, rss_hf);
 	if (ret)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:45.078194896 +0100
+++ 0012-net-hns3-fix-configuring-RSS-hash-when-rules-are-flu.patch	2020-05-19 14:04:44.076645835 +0100
@@ -1,8 +1,10 @@
-From 5e782bc2570c5746b8190d1b5c717de8ee77d0bd Mon Sep 17 00:00:00 2001
+From 70b22c9ed2b55a3a523ec68734cd5435d1395a9a Mon Sep 17 00:00:00 2001
 From: Lijun Ou <oulijun at huawei.com>
 Date: Thu, 26 Mar 2020 15:14:31 +0800
 Subject: [PATCH] net/hns3: fix configuring RSS hash when rules are flushed
 
+[ upstream commit 5e782bc2570c5746b8190d1b5c717de8ee77d0bd ]
+
 Currently, when performing test case as follow:
 1. Run testpmd application based on hns3 network engine with multiple
    receive queues(--rxq=N --txq=N, N>1).
@@ -21,7 +23,6 @@
 hns3_dev_rss_hash_update return -EINVAL.
 
 Fixes: c37ca66f2b27 ("net/hns3: support RSS")
-Cc: stable at dpdk.org
 
 Signed-off-by: Lijun Ou <oulijun at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -34,10 +35,10 @@
  5 files changed, 7 insertions(+)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 1d19de0e67..86676390fe 100644
+index 7c4c2e42c0..42ef33f4b9 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -2663,6 +2663,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
+@@ -2541,6 +2541,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
  
  	hw->mac.media_type = cfg.media_type;
  	hw->rss_size_max = cfg.rss_size_max;
@@ -46,10 +47,10 @@
  	memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
  	hw->mac.phy_addr = cfg.phy_addr;
 diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
-index 28484188a6..0423e64ea0 100644
+index 975680ea21..03bbd24dac 100644
 --- a/drivers/net/hns3/hns3_ethdev.h
 +++ b/drivers/net/hns3/hns3_ethdev.h
-@@ -368,6 +368,7 @@ struct hns3_hw {
+@@ -358,6 +358,7 @@ struct hns3_hw {
  
  	/* The configuration info of RSS */
  	struct hns3_rss_conf rss_info;
@@ -58,10 +59,10 @@
  	uint8_t num_tc;             /* Total number of enabled TCs */
  	uint8_t hw_tc_map;
 diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
-index 3c72976f3d..08ae58a794 100644
+index 2096ad6fcd..879851630d 100644
 --- a/drivers/net/hns3/hns3_ethdev_vf.c
 +++ b/drivers/net/hns3/hns3_ethdev_vf.c
-@@ -1022,6 +1022,7 @@ hns3vf_get_configuration(struct hns3_hw *hw)
+@@ -784,6 +784,7 @@ hns3vf_get_configuration(struct hns3_hw *hw)
  	int ret;
  
  	hw->mac.media_type = HNS3_MEDIA_TYPE_NONE;
@@ -70,10 +71,10 @@
  	/* Get queue configuration from PF */
  	ret = hns3vf_get_queue_info(hw);
 diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
-index 53708d2054..aef301a8a7 100644
+index 207dd578a0..c7027a779a 100644
 --- a/drivers/net/hns3/hns3_flow.c
 +++ b/drivers/net/hns3/hns3_flow.c
-@@ -1333,6 +1333,7 @@ hns3_disable_rss(struct hns3_hw *hw)
+@@ -1328,6 +1328,7 @@ hns3_disable_rss(struct hns3_hw *hw)
  
  	/* Disable RSS */
  	hw->rss_info.conf.types = 0;
@@ -82,10 +83,10 @@
  	return 0;
  }
 diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
-index 737d5f1093..95a637ddc2 100644
+index b8c20e6d9d..9b6b72908f 100644
 --- a/drivers/net/hns3/hns3_rss.c
 +++ b/drivers/net/hns3/hns3_rss.c
-@@ -261,6 +261,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
+@@ -257,6 +257,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
  	uint8_t *key = rss_conf->rss_key;
  	int ret;
  


More information about the stable mailing list