Skip to content

Commit f7434ba

Browse files
w1ldptrSaeed Mahameed
authored andcommitted
net/mlx5e: Extend flower police validation
Recent net commit 4d1e07d ("net/mlx5e: Fix matchall police parameters validation") removed notexceed action id validation from mlx5e_police_validate() and left it up to callers. However, since tc_act_can_offload_police() only exists in net-next its validation is extended in this dedicated followup patch. Signed-off-by: Vlad Buslov <[email protected]> Reviewed-by: Jianbo Liu <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 9153da4 commit f7434ba

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ tc_act_can_offload_police(struct mlx5e_tc_act_parse_state *parse_state,
1010
int act_index,
1111
struct mlx5_flow_attr *attr)
1212
{
13+
if (act->police.notexceed.act_id != FLOW_ACTION_PIPE &&
14+
act->police.notexceed.act_id != FLOW_ACTION_ACCEPT) {
15+
NL_SET_ERR_MSG_MOD(parse_state->extack,
16+
"Offload not supported when conform action is not pipe or ok");
17+
return false;
18+
}
1319
if (mlx5e_policer_validate(parse_state->flow_action, act,
1420
parse_state->extack))
1521
return false;

0 commit comments

Comments
 (0)