@@ -256,6 +256,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
256
256
{
257
257
struct mlx5dr_domain * domain = ns -> fs_dr_domain .dr_domain ;
258
258
struct mlx5dr_action_dest * term_actions ;
259
+ struct mlx5_pkt_reformat * pkt_reformat ;
259
260
struct mlx5dr_match_parameters params ;
260
261
struct mlx5_core_dev * dev = ns -> dev ;
261
262
struct mlx5dr_action * * fs_dr_actions ;
@@ -332,18 +333,19 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
332
333
if (fte -> act_dests .action .action & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT ) {
333
334
bool is_decap ;
334
335
335
- if (fte -> act_dests .action .pkt_reformat -> owner == MLX5_FLOW_RESOURCE_OWNER_FW ) {
336
+ pkt_reformat = fte -> act_dests .action .pkt_reformat ;
337
+ if (pkt_reformat -> owner == MLX5_FLOW_RESOURCE_OWNER_FW ) {
336
338
err = - EINVAL ;
337
339
mlx5dr_err (domain , "FW-owned reformat can't be used in SW rule\n" );
338
340
goto free_actions ;
339
341
}
340
342
341
- is_decap = fte -> act_dests . action . pkt_reformat -> reformat_type ==
343
+ is_decap = pkt_reformat -> reformat_type ==
342
344
MLX5_REFORMAT_TYPE_L3_TUNNEL_TO_L2 ;
343
345
344
346
if (is_decap )
345
347
actions [num_actions ++ ] =
346
- fte -> act_dests . action . pkt_reformat -> action .dr_action ;
348
+ pkt_reformat -> fs_dr_action .dr_action ;
347
349
else
348
350
delay_encap_set = true;
349
351
}
@@ -395,8 +397,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
395
397
}
396
398
397
399
if (delay_encap_set )
398
- actions [num_actions ++ ] =
399
- fte -> act_dests .action .pkt_reformat -> action .dr_action ;
400
+ actions [num_actions ++ ] = pkt_reformat -> fs_dr_action .dr_action ;
400
401
401
402
/* The order of the actions below is not important */
402
403
@@ -458,9 +459,11 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
458
459
term_actions [num_term_actions ].dest = tmp_action ;
459
460
460
461
if (dst -> dest_attr .vport .flags &
461
- MLX5_FLOW_DEST_VPORT_REFORMAT_ID )
462
+ MLX5_FLOW_DEST_VPORT_REFORMAT_ID ) {
463
+ pkt_reformat = dst -> dest_attr .vport .pkt_reformat ;
462
464
term_actions [num_term_actions ].reformat =
463
- dst -> dest_attr .vport .pkt_reformat -> action .dr_action ;
465
+ pkt_reformat -> fs_dr_action .dr_action ;
466
+ }
464
467
465
468
num_term_actions ++ ;
466
469
break ;
@@ -671,15 +674,15 @@ static int mlx5_cmd_dr_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns
671
674
}
672
675
673
676
pkt_reformat -> owner = MLX5_FLOW_RESOURCE_OWNER_SW ;
674
- pkt_reformat -> action .dr_action = action ;
677
+ pkt_reformat -> fs_dr_action .dr_action = action ;
675
678
676
679
return 0 ;
677
680
}
678
681
679
682
static void mlx5_cmd_dr_packet_reformat_dealloc (struct mlx5_flow_root_namespace * ns ,
680
683
struct mlx5_pkt_reformat * pkt_reformat )
681
684
{
682
- mlx5dr_action_destroy (pkt_reformat -> action .dr_action );
685
+ mlx5dr_action_destroy (pkt_reformat -> fs_dr_action .dr_action );
683
686
}
684
687
685
688
static int mlx5_cmd_dr_modify_header_alloc (struct mlx5_flow_root_namespace * ns ,
@@ -836,7 +839,7 @@ int mlx5_fs_dr_action_get_pkt_reformat_id(struct mlx5_pkt_reformat *pkt_reformat
836
839
case MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL :
837
840
case MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL :
838
841
case MLX5_REFORMAT_TYPE_INSERT_HDR :
839
- return mlx5dr_action_get_pkt_reformat_id (pkt_reformat -> action .dr_action );
842
+ return mlx5dr_action_get_pkt_reformat_id (pkt_reformat -> fs_dr_action .dr_action );
840
843
}
841
844
return - EOPNOTSUPP ;
842
845
}
0 commit comments