Skip to content

Commit ae2741e

Browse files
w1ldptrSaeed Mahameed
authored andcommitted
net/mlx5e: Verify that rule has at least one fwd/drop action
Currently, mlx5 tc layer doesn't verify that rule has at least one forward or drop action which leads to following firmware syndrome when user tries to offload such action: [ 1824.860501] mlx5_core 0000:81:00.0: mlx5_cmd_check:753:(pid 29458): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x144b7a) Add check at the end of parse_tc_fdb_actions() that verifies that resulting attribute has action fwd or drop flag set. Signed-off-by: Vlad Buslov <[email protected]> Reviewed-by: Paul Blakey <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 556b9d1 commit ae2741e

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
@@ -3423,6 +3423,12 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
34233423
attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
34243424
}
34253425

3426+
if (!(attr->action &
3427+
(MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) {
3428+
NL_SET_ERR_MSG(extack, "Rule must have at least one forward/drop action");
3429+
return -EOPNOTSUPP;
3430+
}
3431+
34263432
if (attr->split_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) {
34273433
NL_SET_ERR_MSG_MOD(extack,
34283434
"current firmware doesn't support split rule for port mirroring");

0 commit comments

Comments
 (0)