From 159e9217a5cfd2949aceab6a7fe0516d8fce5ba5 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 22 Jan 2020 16:27:19 +0200 Subject: [PATCH] net/mlx5: block pop VLAN action on Tx Add missing check in validation function of 'pop VLAN' action. Action is not allowed for egress flow rules. Fixes: b41e47da2592 ("net/mlx5: support pop flow action on VLAN header") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Ori Kam Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 1ed677ff21..9dc08cec97 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1634,6 +1634,12 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "pop vlan action is not supported"); + if (attr->egress) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, + NULL, + "pop vlan action not supported for " + "egress"); /* * Check for inconsistencies: * fail strip_vlan in a flow that matches packets without VLAN tags. -- 2.20.1