patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [DPDK 1/2] net/ice: fix flow get inputset check
@ 2019-07-17  7:25 Wang Ying A
  2019-07-17  7:25 ` [dpdk-stable] [DPDK 2/2] net/ice: fix flow action validation Wang Ying A
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Ying A @ 2019-07-17  7:25 UTC (permalink / raw)
  To: qabuild; +Cc: Wang Ying A, stable

ice_get_flow_field should not set error if item->type is
RTE_FLOW_ITEM_TYPE_VOID.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index c2931a1..464f6ec 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -465,7 +465,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
 		case RTE_FLOW_ITEM_TYPE_NVGRE:
 			nvgre_spec = item->spec;
 			nvgre_mask = item->mask;
-			/* Check if VXLAN item is used to describe protocol.
+			/* Check if NVGRE item is used to describe protocol.
 			 * If yes, both spec and mask should be NULL.
 			 * If no, both spec and mask shouldn't be NULL.
 			 */
@@ -480,6 +480,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
 			is_tunnel = 1;
 
 			break;
+		case RTE_FLOW_ITEM_TYPE_VOID:
+			break;
 		default:
 			rte_flow_error_set(error, EINVAL,
 					   RTE_FLOW_ERROR_TYPE_ITEM,
-- 
1.8.3.1


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

* [dpdk-stable] [DPDK 2/2] net/ice: fix flow action validation
  2019-07-17  7:25 [dpdk-stable] [DPDK 1/2] net/ice: fix flow get inputset check Wang Ying A
@ 2019-07-17  7:25 ` Wang Ying A
  0 siblings, 0 replies; 2+ messages in thread
From: Wang Ying A @ 2019-07-17  7:25 UTC (permalink / raw)
  To: qabuild; +Cc: Wang Ying A, stable

Action is a list. We should check each element of the action
other than the first one.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 39 ++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 464f6ec..2c57276 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -517,28 +517,31 @@ static int ice_flow_valid_action(struct rte_eth_dev *dev,
 {
 	const struct rte_flow_action_queue *act_q;
 	uint16_t queue;
-
-	switch (actions->type) {
-	case RTE_FLOW_ACTION_TYPE_QUEUE:
-		act_q = actions->conf;
-		queue = act_q->index;
-		if (queue >= dev->data->nb_rx_queues) {
+	const struct rte_flow_action *action;
+	for (action = actions; action->type !=
+			RTE_FLOW_ACTION_TYPE_END; action++) {
+		switch (action->type) {
+		case RTE_FLOW_ACTION_TYPE_QUEUE:
+			act_q = action->conf;
+			queue = act_q->index;
+			if (queue >= dev->data->nb_rx_queues) {
+				rte_flow_error_set(error, EINVAL,
+						RTE_FLOW_ERROR_TYPE_ACTION,
+						actions, "Invalid queue ID for"
+						" switch filter.");
+				return -rte_errno;
+			}
+			break;
+		case RTE_FLOW_ACTION_TYPE_DROP:
+		case RTE_FLOW_ACTION_TYPE_VOID:
+			break;
+		default:
 			rte_flow_error_set(error, EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ACTION,
-					   actions, "Invalid queue ID for"
-					   " switch filter.");
+					   RTE_FLOW_ERROR_TYPE_ACTION, actions,
+					   "Invalid action.");
 			return -rte_errno;
 		}
-		break;
-	case RTE_FLOW_ACTION_TYPE_DROP:
-		break;
-	default:
-		rte_flow_error_set(error, EINVAL,
-				   RTE_FLOW_ERROR_TYPE_ACTION, actions,
-				   "Invalid action.");
-		return -rte_errno;
 	}
-
 	return 0;
 }
 
-- 
1.8.3.1


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

end of thread, other threads:[~2019-07-17  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  7:25 [dpdk-stable] [DPDK 1/2] net/ice: fix flow get inputset check Wang Ying A
2019-07-17  7:25 ` [dpdk-stable] [DPDK 2/2] net/ice: fix flow action validation Wang Ying A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).