Skip to content

Commit 44d632d

Browse files
committed
Merge branch 'act_police-continue-offload-fix'
Vlad Buslov says: ==================== net: Fix police 'continue' action offload TC act_police with 'continue' action had been supported by mlx5 matchall classifier offload implementation for some time. However, 'continue' was assumed implicitly and recently got broken in multiple places. Fix it in both TC hardware offload validation code and mlx5 driver. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e6fa930 + 4d1e07d commit 44d632d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
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;

include/net/flow_offload.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ enum flow_action_id {
152152
FLOW_ACTION_PIPE,
153153
FLOW_ACTION_VLAN_PUSH_ETH,
154154
FLOW_ACTION_VLAN_POP_ETH,
155+
FLOW_ACTION_CONTINUE,
155156
NUM_FLOW_ACTIONS,
156157
};
157158

net/sched/act_police.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static int tcf_police_act_to_flow_act(int tc_act, u32 *extval,
442442
act_id = FLOW_ACTION_JUMP;
443443
*extval = tc_act & TC_ACT_EXT_VAL_MASK;
444444
} else if (tc_act == TC_ACT_UNSPEC) {
445-
NL_SET_ERR_MSG_MOD(extack, "Offload not supported when conform/exceed action is \"continue\"");
445+
act_id = FLOW_ACTION_CONTINUE;
446446
} else {
447447
NL_SET_ERR_MSG_MOD(extack, "Unsupported conform/exceed action offload");
448448
}

0 commit comments

Comments
 (0)