Skip to content

Commit 0610f8d

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: Pass actions param to actions_match_supported()
Currently the mlx5_flow object contains a single mlx5_attr instance. However, multi table actions (e.g. CT) instantiate multiple attr instances. Currently action_match_supported() reads the actions flag from the flow's attribute instance. Modify the function to receive the action flags as a parameter which is set by the calling function and pass the aggregated actions to actions_match_supported(). Signed-off-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent d1a3138 commit 0610f8d

File tree

2 files changed

+8
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

2 files changed

+8
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct mlx5e_tc_act_parse_state {
1616
unsigned int num_actions;
1717
struct mlx5e_tc_flow *flow;
1818
struct netlink_ext_ack *extack;
19+
u32 actions;
1920
bool ct;
2021
bool encap;
2122
bool decap;

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,11 +3257,11 @@ actions_match_supported_fdb(struct mlx5e_priv *priv,
32573257
static bool
32583258
actions_match_supported(struct mlx5e_priv *priv,
32593259
struct flow_action *flow_action,
3260+
u32 actions,
32603261
struct mlx5e_tc_flow_parse_attr *parse_attr,
32613262
struct mlx5e_tc_flow *flow,
32623263
struct netlink_ext_ack *extack)
32633264
{
3264-
u32 actions = flow->attr->action;
32653265
bool ct_flow, ct_clear;
32663266

32673267
ct_clear = flow->attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR;
@@ -3344,6 +3344,8 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
33443344
err = tc_act->parse_action(parse_state, act, priv, attr);
33453345
if (err)
33463346
return err;
3347+
3348+
parse_state->actions |= attr->action;
33473349
}
33483350

33493351
flow_action_for_each(i, act, flow_action) {
@@ -3445,7 +3447,8 @@ parse_tc_nic_actions(struct mlx5e_priv *priv,
34453447
if (err)
34463448
return err;
34473449

3448-
if (!actions_match_supported(priv, flow_action, parse_attr, flow, extack))
3450+
if (!actions_match_supported(priv, flow_action, parse_state->actions,
3451+
parse_attr, flow, extack))
34493452
return -EOPNOTSUPP;
34503453

34513454
return 0;
@@ -3574,7 +3577,8 @@ parse_tc_fdb_actions(struct mlx5e_priv *priv,
35743577
if (err)
35753578
return err;
35763579

3577-
if (!actions_match_supported(priv, flow_action, parse_attr, flow, extack))
3580+
if (!actions_match_supported(priv, flow_action, parse_state->actions,
3581+
parse_attr, flow, extack))
35783582
return -EOPNOTSUPP;
35793583

35803584
return 0;

0 commit comments

Comments
 (0)