diff options
author | Roi Dayan <roid@nvidia.com> | 2022-01-17 15:00:30 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2022-02-23 16:08:17 -0800 |
commit | 3d65492a86d4e6675734646929759138a023d914 (patch) | |
tree | f6e5316fdbff438e0da97202d13841daf7f3b5a1 /drivers/net | |
parent | 23216d387c40b090b221ad457c95912fb47eb11e (diff) | |
download | linux-stable-3d65492a86d4e6675734646929759138a023d914.tar.gz linux-stable-3d65492a86d4e6675734646929759138a023d914.tar.bz2 linux-stable-3d65492a86d4e6675734646929759138a023d914.zip |
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: 03a9d11e6eeb ("net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 34700cf1285e..b27532a9301e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3204,6 +3204,12 @@ actions_match_supported(struct mlx5e_priv *priv, 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"); |