History

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.

Vlad Buslov committed 4 years ago

Commit 4d1e07d1 parent 052f7441 file · +6 −7Browse files

Unified · Split

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+6−7
@@ -4529,13 +4529,6 @@ static int mlx5e_policer_validate(const struct flow_action *action, · 4528 unmodified lines
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, · 44 unmodified lines
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;