From: Gregory Etelson Date: Wed, 20 Jan 2021 19:17:10 +0000 (+0200) Subject: net/mlx5: fix drop action in tunnel offload mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=49be011d3c87fd1b5d5d791744e9d969dff26bc1;p=dpdk.git net/mlx5: fix drop action in tunnel offload mode Tunnel offload mode allows application to restore partially offloaded tunneled packets to its original state. The mode was designed to optimize packet recovery. It must not block flow actions that are allowed by MLX5 PMD. The patch allows tunnel offload match rules to use drop flow action. Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index faafc92bc8..9ffd6ec1a8 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -6228,8 +6228,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, * Validate the drop action mutual exclusion with other actions. * Drop action is mutually-exclusive with any other action, except for * Count action. + * Drop action compatibility with tunnel offload was already validated. */ - if ((action_flags & MLX5_FLOW_ACTION_DROP) && + if (action_flags & (MLX5_FLOW_ACTION_TUNNEL_MATCH | + MLX5_FLOW_ACTION_TUNNEL_MATCH)); + else if ((action_flags & MLX5_FLOW_ACTION_DROP) && (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_COUNT))) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL,