Skip to content

Commit 67efaf4

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
net/mlx5e: TC, Remove CT action reordering
CT action reordering was done as a workaround when CT misses used to restore the relevant filter's tc chain and continuing sw processing from that chain. As such, there was a need to reorder CT action to be before any packet modifying actions (e.g mac rewrite). Currently (after patch "net/mlx5e: TC, Set CT miss to the specific ct action instance"), CT misses continues from the relevant ct action in software, and so reordering isn't needed anymore. Remove the reordering. Signed-off-by: Paul Blakey <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 13aca17 commit 67efaf4

File tree

3 files changed

+9
-47
lines changed

3 files changed

+9
-47
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,6 @@ mlx5e_tc_act_init_parse_state(struct mlx5e_tc_act_parse_state *parse_state,
8282
parse_state->flow_action = flow_action;
8383
}
8484

85-
void
86-
mlx5e_tc_act_reorder_flow_actions(struct flow_action *flow_action,
87-
struct mlx5e_tc_flow_action *flow_action_reorder)
88-
{
89-
struct flow_action_entry *act;
90-
int i, j = 0;
91-
92-
flow_action_for_each(i, act, flow_action) {
93-
/* Add CT action to be first. */
94-
if (act->id == FLOW_ACTION_CT)
95-
flow_action_reorder->entries[j++] = act;
96-
}
97-
98-
flow_action_for_each(i, act, flow_action) {
99-
if (act->id == FLOW_ACTION_CT)
100-
continue;
101-
flow_action_reorder->entries[j++] = act;
102-
}
103-
}
104-
10585
int
10686
mlx5e_tc_act_post_parse(struct mlx5e_tc_act_parse_state *parse_state,
10787
struct flow_action *flow_action,

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ mlx5e_tc_act_init_parse_state(struct mlx5e_tc_act_parse_state *parse_state,
112112
struct flow_action *flow_action,
113113
struct netlink_ext_ack *extack);
114114

115-
void
116-
mlx5e_tc_act_reorder_flow_actions(struct flow_action *flow_action,
117-
struct mlx5e_tc_flow_action *flow_action_reorder);
118-
119115
int
120116
mlx5e_tc_act_post_parse(struct mlx5e_tc_act_parse_state *parse_state,
121117
struct flow_action *flow_action,

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

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,74 +4045,64 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
40454045
struct flow_action *flow_action)
40464046
{
40474047
struct netlink_ext_ack *extack = parse_state->extack;
4048-
struct mlx5e_tc_flow_action flow_action_reorder;
40494048
struct mlx5e_tc_flow *flow = parse_state->flow;
40504049
struct mlx5e_tc_jump_state jump_state = {};
40514050
struct mlx5_flow_attr *attr = flow->attr;
40524051
enum mlx5_flow_namespace_type ns_type;
40534052
struct mlx5e_priv *priv = flow->priv;
4054-
struct flow_action_entry *act, **_act;
40554053
struct mlx5_flow_attr *prev_attr;
4054+
struct flow_action_entry *act;
40564055
struct mlx5e_tc_act *tc_act;
40574056
bool is_missable;
40584057
int err, i;
40594058

4060-
flow_action_reorder.num_entries = flow_action->num_entries;
4061-
flow_action_reorder.entries = kcalloc(flow_action->num_entries,
4062-
sizeof(flow_action), GFP_KERNEL);
4063-
if (!flow_action_reorder.entries)
4064-
return -ENOMEM;
4065-
4066-
mlx5e_tc_act_reorder_flow_actions(flow_action, &flow_action_reorder);
4067-
40684059
ns_type = mlx5e_get_flow_namespace(flow);
40694060
list_add(&attr->list, &flow->attrs);
40704061

4071-
flow_action_for_each(i, _act, &flow_action_reorder) {
4062+
flow_action_for_each(i, act, flow_action) {
40724063
jump_state.jump_target = false;
4073-
act = *_act;
40744064
is_missable = false;
40754065
prev_attr = attr;
40764066

40774067
tc_act = mlx5e_tc_act_get(act->id, ns_type);
40784068
if (!tc_act) {
40794069
NL_SET_ERR_MSG_MOD(extack, "Not implemented offload action");
40804070
err = -EOPNOTSUPP;
4081-
goto out_free;
4071+
goto out_free_post_acts;
40824072
}
40834073

40844074
if (tc_act->can_offload && !tc_act->can_offload(parse_state, act, i, attr)) {
40854075
err = -EOPNOTSUPP;
4086-
goto out_free;
4076+
goto out_free_post_acts;
40874077
}
40884078

40894079
err = tc_act->parse_action(parse_state, act, priv, attr);
40904080
if (err)
4091-
goto out_free;
4081+
goto out_free_post_acts;
40924082

40934083
dec_jump_count(act, tc_act, attr, priv, &jump_state);
40944084

40954085
err = parse_branch_ctrl(act, tc_act, flow, attr, &jump_state, extack);
40964086
if (err)
4097-
goto out_free;
4087+
goto out_free_post_acts;
40984088

40994089
parse_state->actions |= attr->action;
41004090

41014091
/* Split attr for multi table act if not the last act. */
41024092
if (jump_state.jump_target ||
41034093
(tc_act->is_multi_table_act &&
41044094
tc_act->is_multi_table_act(priv, act, attr) &&
4105-
i < flow_action_reorder.num_entries - 1)) {
4095+
i < flow_action->num_entries - 1)) {
41064096
is_missable = tc_act->is_missable ? tc_act->is_missable(act) : false;
41074097

41084098
err = mlx5e_tc_act_post_parse(parse_state, flow_action, attr, ns_type);
41094099
if (err)
4110-
goto out_free;
4100+
goto out_free_post_acts;
41114101

41124102
attr = mlx5e_clone_flow_attr_for_post_act(flow->attr, ns_type);
41134103
if (!attr) {
41144104
err = -ENOMEM;
4115-
goto out_free;
4105+
goto out_free_post_acts;
41164106
}
41174107

41184108
list_add(&attr->list, &flow->attrs);
@@ -4129,8 +4119,6 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
41294119
}
41304120
}
41314121

4132-
kfree(flow_action_reorder.entries);
4133-
41344122
err = mlx5e_tc_act_post_parse(parse_state, flow_action, attr, ns_type);
41354123
if (err)
41364124
goto out_free_post_acts;
@@ -4141,8 +4129,6 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
41414129

41424130
return 0;
41434131

4144-
out_free:
4145-
kfree(flow_action_reorder.entries);
41464132
out_free_post_acts:
41474133
free_flow_post_acts(flow);
41484134

0 commit comments

Comments
 (0)