[dpdk-stable] [PATCH] net/mlx5: fix validation of drop action

Slava Ovsiienko viacheslavo at mellanox.com
Wed Sep 4 16:10:55 CEST 2019


> -----Original Message-----
> From: Dekel Peled <dekelp at mellanox.com>
> Sent: Thursday, August 15, 2019 12:27
> To: Yongseok Koh <yskoh at mellanox.com>; Slava Ovsiienko
> <viacheslavo at mellanox.com>; Shahaf Shuler <shahafs at mellanox.com>
> Cc: Ori Kam <orika at mellanox.com>; dev at dpdk.org; stable at dpdk.org
> Subject: [PATCH] net/mlx5: fix validation of drop action
> 
> Function mlx5_flow_validate_action_drop() checks if another fate action is
> already present in this flow rule, using defined value
> MLX5_FLOW_FATE_ACTIONS.
> This patch enhances the check using value (MLX5_FLOW_FATE_ACTIONS |
> MLX5_FLOW_FATE_ESWITCH_ACTIONS) to make sure all relevant fate
> actions are checked.
> 
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_flow.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 9d2c8c9..2356c14 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -809,7 +809,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
>  		return rte_flow_error_set(error, EINVAL,
>  					  RTE_FLOW_ERROR_TYPE_ACTION,
> NULL,
>  					  "can't drop and mark in same
> flow");
> -	if (action_flags & MLX5_FLOW_FATE_ACTIONS)
> +	if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
> +			    MLX5_FLOW_FATE_ESWITCH_ACTIONS))
>  		return rte_flow_error_set(error, EINVAL,
>  					  RTE_FLOW_ERROR_TYPE_ACTION,
> NULL,
>  					  "can't have 2 fate actions in"
> --
> 1.8.3.1



More information about the stable mailing list