Skip to content

Commit 5623ef8

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: TC, Reject rules with forward and drop actions
Such rules are redundant but allowed and passed to the driver. The driver does not support offloading such rules so return an error. Fixes: 03a9d11 ("net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads") Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 3c5193a commit 5623ef8

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,6 +3191,12 @@ actions_match_supported(struct mlx5e_priv *priv,
31913191
return false;
31923192
}
31933193

3194+
if (!(~actions &
3195+
(MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) {
3196+
NL_SET_ERR_MSG_MOD(extack, "Rule cannot support forward+drop action");
3197+
return false;
3198+
}
3199+
31943200
if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
31953201
actions & MLX5_FLOW_CONTEXT_ACTION_DROP) {
31963202
NL_SET_ERR_MSG_MOD(extack, "Drop with modify header action is not supported");

0 commit comments

Comments
 (0)