Skip to content

Commit aa90a30

Browse files
Itamar-Gozlankuba-moo
authored andcommitted
net/mlx5: DR, expand SWS STE callbacks and consolidate common structs
Expand SWS STE callbacks to support ConnectX-8 hardware. Move common enums and structures to a shared header file. Signed-off-by: Itamar Gozlan <[email protected]> Signed-off-by: Yevgeny Kliteynik <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 429776b commit aa90a30

File tree

7 files changed

+377
-342
lines changed

7 files changed

+377
-342
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ void mlx5dr_ste_set_actions_tx(struct mlx5dr_ste_ctx *ste_ctx,
555555
struct mlx5dr_ste_actions_attr *attr,
556556
u32 *added_stes)
557557
{
558-
ste_ctx->set_actions_tx(dmn, action_type_set, ste_ctx->actions_caps,
558+
ste_ctx->set_actions_tx(ste_ctx, dmn, action_type_set, ste_ctx->actions_caps,
559559
hw_ste_arr, attr, added_stes);
560560
}
561561

@@ -566,7 +566,7 @@ void mlx5dr_ste_set_actions_rx(struct mlx5dr_ste_ctx *ste_ctx,
566566
struct mlx5dr_ste_actions_attr *attr,
567567
u32 *added_stes)
568568
{
569-
ste_ctx->set_actions_rx(dmn, action_type_set, ste_ctx->actions_caps,
569+
ste_ctx->set_actions_rx(ste_ctx, dmn, action_type_set, ste_ctx->actions_caps,
570570
hw_ste_arr, attr, added_stes);
571571
}
572572

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,15 @@ struct mlx5dr_ste_ctx {
160160

161161
/* Actions */
162162
u32 actions_caps;
163-
void (*set_actions_rx)(struct mlx5dr_domain *dmn,
163+
void (*set_actions_rx)(struct mlx5dr_ste_ctx *ste_ctx,
164+
struct mlx5dr_domain *dmn,
164165
u8 *action_type_set,
165166
u32 actions_caps,
166167
u8 *hw_ste_arr,
167168
struct mlx5dr_ste_actions_attr *attr,
168169
u32 *added_stes);
169-
void (*set_actions_tx)(struct mlx5dr_domain *dmn,
170+
void (*set_actions_tx)(struct mlx5dr_ste_ctx *ste_ctx,
171+
struct mlx5dr_domain *dmn,
170172
u8 *action_type_set,
171173
u32 actions_caps,
172174
u8 *hw_ste_arr,
@@ -197,7 +199,17 @@ struct mlx5dr_ste_ctx {
197199
u16 *used_hw_action_num);
198200
int (*alloc_modify_hdr_chunk)(struct mlx5dr_action *action);
199201
void (*dealloc_modify_hdr_chunk)(struct mlx5dr_action *action);
200-
202+
/* Actions bit set */
203+
void (*set_encap)(u8 *hw_ste_p, u8 *d_action,
204+
u32 reformat_id, int size);
205+
void (*set_push_vlan)(u8 *ste, u8 *d_action,
206+
u32 vlan_hdr);
207+
void (*set_pop_vlan)(u8 *hw_ste_p, u8 *s_action,
208+
u8 vlans_num);
209+
void (*set_rx_decap)(u8 *hw_ste_p, u8 *s_action);
210+
void (*set_encap_l3)(u8 *hw_ste_p, u8 *frst_s_action,
211+
u8 *scnd_d_action, u32 reformat_id,
212+
int size);
201213
/* Send */
202214
void (*prepare_for_postsend)(u8 *hw_ste_p, u32 ste_size);
203215
};

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v0.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ static void dr_ste_v0_arr_init_next(u8 **last_ste,
406406
}
407407

408408
static void
409-
dr_ste_v0_set_actions_tx(struct mlx5dr_domain *dmn,
409+
dr_ste_v0_set_actions_tx(struct mlx5dr_ste_ctx *ste_ctx,
410+
struct mlx5dr_domain *dmn,
410411
u8 *action_type_set,
411412
u32 actions_caps,
412413
u8 *last_ste,
@@ -476,7 +477,8 @@ dr_ste_v0_set_actions_tx(struct mlx5dr_domain *dmn,
476477
}
477478

478479
static void
479-
dr_ste_v0_set_actions_rx(struct mlx5dr_domain *dmn,
480+
dr_ste_v0_set_actions_rx(struct mlx5dr_ste_ctx *ste_ctx,
481+
struct mlx5dr_domain *dmn,
480482
u8 *action_type_set,
481483
u32 actions_caps,
482484
u8 *last_ste,

0 commit comments

Comments
 (0)