Skip to content

Commit 4d1e07d

Browse files
w1ldptrdavem330
authored andcommitted
net/mlx5e: Fix matchall police parameters validation
Referenced commit prepared the code for upcoming extension that allows mlx5 to offload police action attached to flower classifier. However, with regard to existing matchall classifier offload validation should be reversed as FLOW_ACTION_CONTINUE is the only supported notexceed police action type. Fix the problem by allowing FLOW_ACTION_CONTINUE for police action and extend scan_tc_matchall_fdb_actions() to only allow such actions with matchall classifier. Fixes: d97b4b1 ("flow_offload: reject offload for all drivers with invalid police parameters") Signed-off-by: Vlad Buslov <[email protected]> Acked-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 052f744 commit 4d1e07d

File tree

1 file changed

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

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4529,13 +4529,6 @@ static int mlx5e_policer_validate(const struct flow_action *action,
45294529
return -EOPNOTSUPP;
45304530
}
45314531

4532-
if (act->police.notexceed.act_id != FLOW_ACTION_PIPE &&
4533-
act->police.notexceed.act_id != FLOW_ACTION_ACCEPT) {
4534-
NL_SET_ERR_MSG_MOD(extack,
4535-
"Offload not supported when conform action is not pipe or ok");
4536-
return -EOPNOTSUPP;
4537-
}
4538-
45394532
if (act->police.notexceed.act_id == FLOW_ACTION_ACCEPT &&
45404533
!flow_action_is_last_entry(action, act)) {
45414534
NL_SET_ERR_MSG_MOD(extack,
@@ -4586,6 +4579,12 @@ static int scan_tc_matchall_fdb_actions(struct mlx5e_priv *priv,
45864579
flow_action_for_each(i, act, flow_action) {
45874580
switch (act->id) {
45884581
case FLOW_ACTION_POLICE:
4582+
if (act->police.notexceed.act_id != FLOW_ACTION_CONTINUE) {
4583+
NL_SET_ERR_MSG_MOD(extack,
4584+
"Offload not supported when conform action is not continue");
4585+
return -EOPNOTSUPP;
4586+
}
4587+
45894588
err = mlx5e_policer_validate(flow_action, act, extack);
45904589
if (err)
45914590
return err;

0 commit comments

Comments
 (0)