Skip to content

Commit 7b919ca

Browse files
mosheshemesh2Paolo Abeni
authored andcommitted
net/mlx5: fs, rename modify header struct member action
As preparation for HW Steering support, rename modify header struct member action to fs_dr_action, to distinguish from fs_hws_action which will be added. Add a pointer where needed to keep code line shorter and more readable. Reviewed-by: Yevgeny Kliteynik <[email protected]> Signed-off-by: Moshe Shemesh <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 1715f0a commit 7b919ca

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ mlx5_ct_fs_smfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec,
318318
}
319319

320320
actions[num_actions++] = smfs_rule->count_action;
321-
actions[num_actions++] = attr->modify_hdr->action.dr_action;
321+
actions[num_actions++] = attr->modify_hdr->fs_dr_action.dr_action;
322322
actions[num_actions++] = fs_smfs->fwd_action;
323323

324324
nat = (attr->ft == fs_smfs->ct_nat);
@@ -379,7 +379,7 @@ static int mlx5_ct_fs_smfs_ct_rule_update(struct mlx5_ct_fs *fs, struct mlx5_ct_
379379
struct mlx5dr_rule *rule;
380380

381381
actions[0] = smfs_rule->count_action;
382-
actions[1] = attr->modify_hdr->action.dr_action;
382+
actions[1] = attr->modify_hdr->fs_dr_action.dr_action;
383383
actions[2] = fs_smfs->fwd_action;
384384

385385
rule = mlx5_smfs_rule_create(smfs_rule->smfs_matcher->dr_matcher, spec,

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct mlx5_modify_hdr {
6363
enum mlx5_flow_namespace_type ns_type;
6464
enum mlx5_flow_resource_owner owner;
6565
union {
66-
struct mlx5_fs_dr_action action;
66+
struct mlx5_fs_dr_action fs_dr_action;
6767
u32 id;
6868
};
6969
};

drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,11 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
372372
actions[num_actions++] = tmp_action;
373373
}
374374

375-
if (fte->act_dests.action.action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
376-
actions[num_actions++] =
377-
fte->act_dests.action.modify_hdr->action.dr_action;
375+
if (fte->act_dests.action.action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) {
376+
struct mlx5_modify_hdr *modify_hdr = fte->act_dests.action.modify_hdr;
377+
378+
actions[num_actions++] = modify_hdr->fs_dr_action.dr_action;
379+
}
378380

379381
if (fte->act_dests.action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) {
380382
tmp_action = create_action_push_vlan(domain, &fte->act_dests.action.vlan[0]);
@@ -705,15 +707,15 @@ static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
705707
}
706708

707709
modify_hdr->owner = MLX5_FLOW_RESOURCE_OWNER_SW;
708-
modify_hdr->action.dr_action = action;
710+
modify_hdr->fs_dr_action.dr_action = action;
709711

710712
return 0;
711713
}
712714

713715
static void mlx5_cmd_dr_modify_header_dealloc(struct mlx5_flow_root_namespace *ns,
714716
struct mlx5_modify_hdr *modify_hdr)
715717
{
716-
mlx5dr_action_destroy(modify_hdr->action.dr_action);
718+
mlx5dr_action_destroy(modify_hdr->fs_dr_action.dr_action);
717719
}
718720

719721
static int

0 commit comments

Comments
 (0)