[08/11] net/mlx5: fix pop VLAN action validation function
diff mbox series

Message ID b7d807dc8a0b38f7bff789a47d9fc7712b440e14.1579703134.git.dekelp@mellanox.com
State Accepted
Delegated to: Raslan Darawsheh
Headers show
Series
  • net/mlx5: vlan actions validation fixes
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Dekel Peled Jan. 22, 2020, 2:27 p.m. UTC
Validation function of 'POP VLAN' action includes check for other
'POP VLAN' actions present in flow.
It doesn't check for 'PUSH VLAN' actions present in flow.

This patch adds check for 'PUSH VLAN' actions present in flow.

Fixes: b41e47da2592 ("net/mlx5: support pop flow action on VLAN header")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Slava Ovsiienko Jan. 23, 2020, 7:57 a.m. UTC | #1
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Wednesday, January 22, 2020 16:27
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Cc: Raslan Darawsheh <rasland@mellanox.com>; Ori Kam
> <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH 08/11] net/mlx5: fix pop VLAN action validation function
> 
> Validation function of 'POP VLAN' action includes check for other 'POP VLAN'
> actions present in flow.
> It doesn't check for 'PUSH VLAN' actions present in flow.
> 
> This patch adds check for 'PUSH VLAN' actions present in flow.
> 
> Fixes: b41e47da2592 ("net/mlx5: support pop flow action on VLAN header")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9dc08ce..de4b765 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1640,17 +1640,10 @@ struct field_modify_info modify_tcp[] = {
>  					  NULL,
>  					  "pop vlan action not supported for "
>  					  "egress");
> -	/*
> -	 * Check for inconsistencies:
> -	 *  fail strip_vlan in a flow that matches packets without VLAN tags.
> -	 *  fail strip_vlan in a flow that matches packets without explicitly a
> -	 *  matching on VLAN tag ?
> -	 */
> -	if (action_flags & MLX5_FLOW_ACTION_OF_POP_VLAN)
> +	if (action_flags & MLX5_FLOW_VLAN_ACTIONS)
>  		return rte_flow_error_set(error, ENOTSUP,
> -
> RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> -					  NULL,
> -					  "no support for multiple vlan pop "
> +					  RTE_FLOW_ERROR_TYPE_ACTION,
> action,
> +					  "no support for multiple VLAN "
>  					  "actions");
>  	if (!(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN))
>  		return rte_flow_error_set(error, ENOTSUP,
> --
> 1.8.3.1

Patch
diff mbox series

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9dc08ce..de4b765 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1640,17 +1640,10 @@  struct field_modify_info modify_tcp[] = {
 					  NULL,
 					  "pop vlan action not supported for "
 					  "egress");
-	/*
-	 * Check for inconsistencies:
-	 *  fail strip_vlan in a flow that matches packets without VLAN tags.
-	 *  fail strip_vlan in a flow that matches packets without explicitly a
-	 *  matching on VLAN tag ?
-	 */
-	if (action_flags & MLX5_FLOW_ACTION_OF_POP_VLAN)
+	if (action_flags & MLX5_FLOW_VLAN_ACTIONS)
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
-					  NULL,
-					  "no support for multiple vlan pop "
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "no support for multiple VLAN "
 					  "actions");
 	if (!(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN))
 		return rte_flow_error_set(error, ENOTSUP,