From: Roi Dayan <roid@xxxxxxxxxx> commit 5623ef8a118838aae65363750dfafcba734dc8cb upstream. Such rules are redundant but allowed and passed to the driver. The driver does not support offloading such rules so return an error. Fixes: 03a9d11e6eeb ("net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads") Signed-off-by: Roi Dayan <roid@xxxxxxxxxx> Reviewed-by: Oz Shlomo <ozsh@xxxxxxxxxx> Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3420,6 +3420,12 @@ actions_match_supported(struct mlx5e_pri return false; } + if (!(~actions & + (MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) { + NL_SET_ERR_MSG_MOD(extack, "Rule cannot support forward+drop action"); + return false; + } + if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR && actions & MLX5_FLOW_CONTEXT_ACTION_DROP) { NL_SET_ERR_MSG_MOD(extack, "Drop with modify header action is not supported"); Patches currently in stable-queue which might be from roid@xxxxxxxxxx are queue-5.16/net-mlx5e-avoid-implicit-modify-hdr-for-decap-drop-rule.patch queue-5.16/net-mlx5-bridge-fix-devlink-deadlock-on-net-namespace-deletion.patch queue-5.16/net-mlx5-e-switch-fix-uninitialized-variable-modact.patch queue-5.16/net-mlx5-bridge-take-rtnl-lock-in-init-error-handler.patch queue-5.16/net-mlx5e-fix-handling-of-wrong-devices-during-bond-netevent.patch queue-5.16/net-mlx5e-tc-reject-rules-with-forward-and-drop-actions.patch queue-5.16/net-mlx5e-tc-reject-rules-with-drop-and-modify-hdr-action.patch queue-5.16/net-mlx5-bridge-ensure-dev_name-is-null-terminated.patch queue-5.16/net-mlx5-fix-offloading-with-eswitch_ipv4_ttl_modify_enable.patch