[dpdk-stable] patch 'net/hns3: fix error type when validating RSS flow action' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:38 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 e9c49642bda64e099b8c137a919f3be45df744fb Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Tue, 29 Sep 2020 20:01:11 +0800
Subject: [PATCH] net/hns3: fix error type when validating RSS flow action

[ upstream commit f8f8df765f5f9a983f20a9a4f061f5a02672f693 ]

Because the macro named RTE_FLOW_ERROR_TYPE_ACTION_CONF indicates a
action configuration and the macro named RTE_FLOW_ERROR_TYPE_ACTION
indicates a specific action, the driver needs to return
RTE_FLOW_ERROR_ACTION_CONF type and notify the user when a RSS
configuration is invalid with actions list in the internal function
named hns3_parse_rss_filter called by the '.validate' ops implementation
function named hns3_flow_validate.

Besides, this patch removes some unnecessary judgment lines in
hns3_parse_rss_filter.

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 | 34 +++++++++-------------------------
 1 file changed, 9 insertions(+), 25 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 4bc6812283..1137cb24e8 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1261,7 +1261,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 	const struct rte_flow_action_rss *rss;
 	const struct rte_flow_action *act;
 	uint32_t act_index = 0;
-	uint64_t flow_types;
 	uint16_t n;
 
 	NEXT_ITEM_OF_ACTION(act, actions, act_index);
@@ -1269,7 +1268,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 
 	if (rss == NULL) {
 		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  act, "no valid queues");
 	}
 
@@ -1277,47 +1276,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 		if (rss->queue[n] < dev->data->nb_rx_queues)
 			continue;
 		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  act,
 					  "queue id > max number of queues");
 	}
 
-	/* Parse flow types of RSS */
 	if (!(rss->types & HNS3_ETH_RSS_SUPPORT) && rss->types)
 		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  act,
 					  "Flow types is unsupported by "
 					  "hns3's RSS");
-
-	flow_types = rss->types & HNS3_ETH_RSS_SUPPORT;
-	if (flow_types != rss->types)
-		hns3_warn(hw, "RSS flow types(%" PRIx64 ") include unsupported "
-			  "flow types", rss->types);
-
-	/* Parse RSS related parameters from RSS configuration */
-	switch (rss->func) {
-	case RTE_ETH_HASH_FUNCTION_DEFAULT:
-	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		break;
-	default:
+	if (rss->func >= RTE_ETH_HASH_FUNCTION_MAX)
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION, act,
-					  "input RSS hash functions are not supported");
-	}
-
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
+					  "RSS hash func are not supported");
 	if (rss->level)
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION, act,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "a nonzero RSS encapsulation level is not supported");
 	if (rss->key_len && rss->key_len != RTE_DIM(rss_conf->key))
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION, act,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "RSS hash key must be exactly 40 bytes");
 	if (rss->queue_num > RTE_DIM(rss_conf->queue))
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION, act,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "too many queues for RSS context");
 
 	act_index++;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:15.443754562 +0000
+++ 0119-net-hns3-fix-error-type-when-validating-RSS-flow-act.patch	2020-10-28 10:35:11.676832556 +0000
@@ -1,8 +1,10 @@
-From f8f8df765f5f9a983f20a9a4f061f5a02672f693 Mon Sep 17 00:00:00 2001
+From e9c49642bda64e099b8c137a919f3be45df744fb Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
 Date: Tue, 29 Sep 2020 20:01:11 +0800
 Subject: [PATCH] net/hns3: fix error type when validating RSS flow action
 
+[ upstream commit f8f8df765f5f9a983f20a9a4f061f5a02672f693 ]
+
 Because the macro named RTE_FLOW_ERROR_TYPE_ACTION_CONF indicates a
 action configuration and the macro named RTE_FLOW_ERROR_TYPE_ACTION
 indicates a specific action, the driver needs to return
@@ -15,19 +17,18 @@
 hns3_parse_rss_filter.
 
 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>
 ---
- drivers/net/hns3/hns3_flow.c | 35 +++++++++--------------------------
- 1 file changed, 9 insertions(+), 26 deletions(-)
+ drivers/net/hns3/hns3_flow.c | 34 +++++++++-------------------------
+ 1 file changed, 9 insertions(+), 25 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
-index f8e5f05d38..a6676d650d 100644
+index 4bc6812283..1137cb24e8 100644
 --- a/drivers/net/hns3/hns3_flow.c
 +++ b/drivers/net/hns3/hns3_flow.c
-@@ -1356,7 +1356,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1261,7 +1261,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
  	const struct rte_flow_action_rss *rss;
  	const struct rte_flow_action *act;
  	uint32_t act_index = 0;
@@ -35,7 +36,7 @@
  	uint16_t n;
  
  	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-@@ -1364,7 +1363,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1269,7 +1268,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
  
  	if (rss == NULL) {
  		return rte_flow_error_set(error, EINVAL,
@@ -44,7 +45,7 @@
  					  act, "no valid queues");
  	}
  
-@@ -1372,48 +1371,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1277,47 +1276,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
  		if (rss->queue[n] < dev->data->nb_rx_queues)
  			continue;
  		return rte_flow_error_set(error, EINVAL,
@@ -73,7 +74,6 @@
 -	case RTE_ETH_HASH_FUNCTION_DEFAULT:
 -	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
 -	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
--	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
 -		break;
 -	default:
 +	if (rss->func >= RTE_ETH_HASH_FUNCTION_MAX)
@@ -100,7 +100,7 @@
 +					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
  					  "too many queues for RSS context");
  
- 	if (rss->types & (ETH_RSS_L4_DST_ONLY | ETH_RSS_L4_SRC_ONLY) &&
+ 	act_index++;
 -- 
 2.20.1
 


More information about the stable mailing list