[dpdk-stable] patch 'net/hns3: fix flow RSS queue number 0' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:57 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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 56023b9778ce6f1722a425809f1bbcc6efbb9616 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Tue, 22 Sep 2020 20:03:26 +0800
Subject: [PATCH] net/hns3: fix flow RSS queue number 0

[ upstream commit b03ddaadc0e9776a05b73de14701f0cf2730885e ]

When user specifies RSS queue num for 0 in action list by flow create API,
it should create a valid flow rule. The following flow rule should be
success in the command line of the testpmd application:
flow create 0 <pattern> actions rss queues  / end

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_flow.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 94819bd42c..9904918110 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1265,10 +1265,9 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 	uint16_t n;
 
 	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-	/* Get configuration args from APP cmdline input */
 	rss = act->conf;
 
-	if (rss == NULL || rss->queue_num == 0) {
+	if (rss == NULL) {
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION,
 					  act, "no valid queues");
@@ -1433,11 +1432,6 @@ hns3_update_indir_table(struct rte_eth_dev *dev,
 	uint8_t queue_id;
 	uint32_t i;
 
-	if (num == 0) {
-		hns3_err(hw, "No PF queues are configured to enable RSS");
-		return -ENOTSUP;
-	}
-
 	allow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max);
 	/* Fill in redirection table */
 	memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
@@ -1545,10 +1539,11 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
 	hns3_info(hw, "Max of contiguous %u PF queues are configured", num);
 
 	rte_spinlock_lock(&hw->lock);
-	/* Update redirection talbe of rss */
-	ret = hns3_update_indir_table(dev, &rss_flow_conf, num);
-	if (ret)
-		goto rss_config_err;
+	if (num) {
+		ret = hns3_update_indir_table(dev, &rss_flow_conf, num);
+		if (ret)
+			goto rss_config_err;
+	}
 
 	/* Set hash algorithm and flow types by the user's config */
 	ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf);
@@ -1574,9 +1569,6 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
 
-	if (hw->rss_info.conf.queue_num == 0)
-		return 0;
-
 	return hns3_config_rss_filter(dev, &hw->rss_info, false);
 }
 
@@ -1587,9 +1579,6 @@ hns3_restore_rss_filter(struct rte_eth_dev *dev)
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
 
-	if (hw->rss_info.conf.queue_num == 0)
-		return 0;
-
 	/* When user flush all rules, it doesn't need to restore RSS rule */
 	if (hw->rss_info.conf.func == RTE_ETH_HASH_FUNCTION_MAX)
 		return 0;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:14.196865956 +0000
+++ 0078-net-hns3-fix-flow-RSS-queue-number-0.patch	2020-10-28 10:35:11.588831261 +0000
@@ -1,15 +1,16 @@
-From b03ddaadc0e9776a05b73de14701f0cf2730885e Mon Sep 17 00:00:00 2001
+From 56023b9778ce6f1722a425809f1bbcc6efbb9616 Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
 Date: Tue, 22 Sep 2020 20:03:26 +0800
 Subject: [PATCH] net/hns3: fix flow RSS queue number 0
 
+[ upstream commit b03ddaadc0e9776a05b73de14701f0cf2730885e ]
+
 When user specifies RSS queue num for 0 in action list by flow create API,
 it should create a valid flow rule. The following flow rule should be
 success in the command line of the testpmd application:
 flow create 0 <pattern> actions rss queues  / end
 
 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>
@@ -18,10 +19,10 @@
  1 file changed, 6 insertions(+), 17 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
-index 6f2ff87496..5b5124c196 100644
+index 94819bd42c..9904918110 100644
 --- a/drivers/net/hns3/hns3_flow.c
 +++ b/drivers/net/hns3/hns3_flow.c
-@@ -1360,10 +1360,9 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1265,10 +1265,9 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
  	uint16_t n;
  
  	NEXT_ITEM_OF_ACTION(act, actions, act_index);
@@ -33,7 +34,7 @@
  		return rte_flow_error_set(error, EINVAL,
  					  RTE_FLOW_ERROR_TYPE_ACTION,
  					  act, "no valid queues");
-@@ -1537,11 +1536,6 @@ hns3_update_indir_table(struct rte_eth_dev *dev,
+@@ -1433,11 +1432,6 @@ hns3_update_indir_table(struct rte_eth_dev *dev,
  	uint8_t queue_id;
  	uint32_t i;
  
@@ -45,7 +46,7 @@
  	allow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max);
  	/* Fill in redirection table */
  	memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
-@@ -1632,10 +1626,11 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
+@@ -1545,10 +1539,11 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
  	hns3_info(hw, "Max of contiguous %u PF queues are configured", num);
  
  	rte_spinlock_lock(&hw->lock);
@@ -61,7 +62,7 @@
  
  	/* Set hash algorithm and flow types by the user's config */
  	ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf);
-@@ -1661,9 +1656,6 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
+@@ -1574,9 +1569,6 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
  	struct hns3_adapter *hns = dev->data->dev_private;
  	struct hns3_hw *hw = &hns->hw;
  
@@ -71,7 +72,7 @@
  	return hns3_config_rss_filter(dev, &hw->rss_info, false);
  }
  
-@@ -1674,9 +1666,6 @@ hns3_restore_rss_filter(struct rte_eth_dev *dev)
+@@ -1587,9 +1579,6 @@ hns3_restore_rss_filter(struct rte_eth_dev *dev)
  	struct hns3_adapter *hns = dev->data->dev_private;
  	struct hns3_hw *hw = &hns->hw;
  


More information about the stable mailing list