[dpdk-stable] patch 'net/ice: add action number check for switch' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:55 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 175dc210ad7793de6ce5d1d1522642bb58f61e9a Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1 at intel.com>
Date: Fri, 3 Apr 2020 12:46:02 +0800
Subject: [PATCH] net/ice: add action number check for switch

[ upstream commit 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b ]

The action number can only be one for DCF or PF
switch filter, not support multiple actions.

Fixes: 47d460d63233 ("net/ice: rework switch filter")

Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 48 +++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 1db3db43c2..0d88e0bd7e 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -997,6 +997,46 @@ error:
 	return -rte_errno;
 }
 
+static int
+ice_switch_check_action(const struct rte_flow_action *actions,
+			    struct rte_flow_error *error)
+{
+	const struct rte_flow_action *action;
+	enum rte_flow_action_type action_type;
+	uint16_t actions_num = 0;
+
+	for (action = actions; action->type !=
+				RTE_FLOW_ACTION_TYPE_END; action++) {
+		action_type = action->type;
+		switch (action_type) {
+		case RTE_FLOW_ACTION_TYPE_VF:
+		case RTE_FLOW_ACTION_TYPE_RSS:
+		case RTE_FLOW_ACTION_TYPE_QUEUE:
+		case RTE_FLOW_ACTION_TYPE_DROP:
+			actions_num++;
+			break;
+		case RTE_FLOW_ACTION_TYPE_VOID:
+			continue;
+		default:
+			rte_flow_error_set(error,
+					   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
+					   actions,
+					   "Invalid action type");
+			return -rte_errno;
+		}
+	}
+
+	if (actions_num > 1) {
+		rte_flow_error_set(error,
+				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
+				   actions,
+				   "Invalid action number");
+		return -rte_errno;
+	}
+
+	return 0;
+}
+
 static int
 ice_switch_parse_pattern_action(struct ice_adapter *ad,
 		struct ice_pattern_match_item *array,
@@ -1082,6 +1122,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
 		goto error;
 	}
 
+	ret = ice_switch_check_action(actions, error);
+	if (ret) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+				   "Invalid input action number");
+		goto error;
+	}
+
 	ret = ice_switch_parse_action(pf, actions, error, &rule_info);
 	if (ret) {
 		rte_flow_error_set(error, EINVAL,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:46.196659181 +0100
+++ 0040-net-ice-add-action-number-check-for-switch.patch	2020-05-19 14:04:44.176647647 +0100
@@ -1,13 +1,14 @@
-From 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b Mon Sep 17 00:00:00 2001
+From 175dc210ad7793de6ce5d1d1522642bb58f61e9a Mon Sep 17 00:00:00 2001
 From: Wei Zhao <wei.zhao1 at intel.com>
 Date: Fri, 3 Apr 2020 12:46:02 +0800
 Subject: [PATCH] net/ice: add action number check for switch
 
+[ upstream commit 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b ]
+
 The action number can only be one for DCF or PF
 switch filter, not support multiple actions.
 
 Fixes: 47d460d63233 ("net/ice: rework switch filter")
-Cc: stable at dpdk.org
 
 Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
 Acked-by: Qi Zhang <qi.z.zhang at intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 48 insertions(+)
 
 diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
-index d9bdf9637e..cc48f22dde 100644
+index 1db3db43c2..0d88e0bd7e 100644
 --- a/drivers/net/ice/ice_switch_filter.c
 +++ b/drivers/net/ice/ice_switch_filter.c
-@@ -1073,6 +1073,46 @@ error:
+@@ -997,6 +997,46 @@ error:
  	return -rte_errno;
  }
  
@@ -66,7 +67,7 @@
  static int
  ice_switch_parse_pattern_action(struct ice_adapter *ad,
  		struct ice_pattern_match_item *array,
-@@ -1158,6 +1198,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
+@@ -1082,6 +1122,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
  		goto error;
  	}
  
@@ -78,9 +79,9 @@
 +		goto error;
 +	}
 +
- 	if (ad->hw.dcf_enabled)
- 		ret = ice_switch_parse_dcf_action(actions, error, &rule_info);
- 	else
+ 	ret = ice_switch_parse_action(pf, actions, error, &rule_info);
+ 	if (ret) {
+ 		rte_flow_error_set(error, EINVAL,
 -- 
 2.20.1
 


More information about the stable mailing list