[PATCH 21.11] net/mlx5: fix drop action attribute validation

Kevin Traynor ktraynor at redhat.com
Mon Jul 31 11:14:05 CEST 2023


On 28/07/2023 19:25, Dariusz Sosnowski wrote:
> [ upstream commit c1f0cdae14c5399cd6201e6cf39d5e51f60c6efb ]
> 
> Before this patch, DROP flow action was rejected for all egress
> flow rules, which was not correct for all cases.
> 
> When Verbs flow engine is used (dv_flow_en=0) DROP flow action
> is implemented using IBV_FLOW_SPEC_ACTION_DROP IBV action.
> This action is supported on ingress only.
> This patch amends the DROP flow action validation to allow it only on
> ingress.
> 
> When DV flow engine is used (dv_flow_en=1) there are 2 implementation
> options for DROP flow action:
> 
> - DR drop action (allocated through mlx5dv_dr_action_create_drop() API),
> - dedicated drop queue.
> 
> When flow rules are created on non-root flow tables DR drop action can
> be used on all steering domains. On root flow table however, this action
> ca be used if and only if it is supported by rdma-core and kernel
> drivers. mlx5 PMD dynamically checks if DR drop action is supported
> on root tables during device probing
> (it is checked in mlx5_flow_discover_dr_action_support()).
> If DR drop action is not supported on root table, then dedicated
> drop queue must be used and as a result, DROP flow action on root
> is supported only for ingress flow rules.
> This patch amends the DROP flow action validation with this logic
> for DV flow engine.
> 
> This patch also renames the dr_drop_action_en field in device's private
> data to dr_root_drop_action_en to align the name with field's meaning.
> 
> Fixes: 3c4338a42134 ("net/mlx5: optimize device spawn time with representors")
> Fixes: 45633c460c22 ("net/mlx5: workaround drop action with old kernel")
> Fixes: da845ae9d7c1 ("net/mlx5: fix drop action for Direct Rules/Verbs")
> Cc:stable at dpdk.org
> 
> Signed-off-by: Dariusz Sosnowski<dsosnowski at nvidia.com>
> Acked-by: Viacheslav Ovsiienko<viacheslavo at nvidia.com>
> ---
>   drivers/net/mlx5/linux/mlx5_os.c   |  4 ++--
>   drivers/net/mlx5/mlx5.h            |  2 +-
>   drivers/net/mlx5/mlx5_flow.c       | 20 ++++++++++++++++----
>   drivers/net/mlx5/mlx5_flow.h       |  3 ++-
>   drivers/net/mlx5/mlx5_flow_dv.c    |  4 ++--
>   drivers/net/mlx5/mlx5_flow_verbs.c |  5 ++++-
>   6 files changed, 27 insertions(+), 11 deletions(-)

Thanks for the backport. I've applied locally and will push to 21.11 
branch when CI completes.
Kevin.



More information about the stable mailing list