@@ -257,7 +257,8 @@ mlx5_eswitch_set_rule_flow_source(struct mlx5_eswitch *esw,
257
257
static void
258
258
mlx5_eswitch_set_rule_source_port (struct mlx5_eswitch * esw ,
259
259
struct mlx5_flow_spec * spec ,
260
- struct mlx5_esw_flow_attr * attr )
260
+ struct mlx5_eswitch * src_esw ,
261
+ u16 vport )
261
262
{
262
263
void * misc2 ;
263
264
void * misc ;
@@ -268,8 +269,8 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw,
268
269
if (mlx5_eswitch_vport_match_metadata_enabled (esw )) {
269
270
misc2 = MLX5_ADDR_OF (fte_match_param , spec -> match_value , misc_parameters_2 );
270
271
MLX5_SET (fte_match_set_misc2 , misc2 , metadata_reg_c_0 ,
271
- mlx5_eswitch_get_vport_metadata_for_match (attr -> in_mdev -> priv . eswitch ,
272
- attr -> in_rep -> vport ));
272
+ mlx5_eswitch_get_vport_metadata_for_match (src_esw ,
273
+ vport ));
273
274
274
275
misc2 = MLX5_ADDR_OF (fte_match_param , spec -> match_criteria , misc_parameters_2 );
275
276
MLX5_SET (fte_match_set_misc2 , misc2 , metadata_reg_c_0 ,
@@ -278,12 +279,12 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw,
278
279
spec -> match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS_2 ;
279
280
} else {
280
281
misc = MLX5_ADDR_OF (fte_match_param , spec -> match_value , misc_parameters );
281
- MLX5_SET (fte_match_set_misc , misc , source_port , attr -> in_rep -> vport );
282
+ MLX5_SET (fte_match_set_misc , misc , source_port , vport );
282
283
283
284
if (MLX5_CAP_ESW (esw -> dev , merged_eswitch ))
284
285
MLX5_SET (fte_match_set_misc , misc ,
285
286
source_eswitch_owner_vhca_id ,
286
- MLX5_CAP_GEN (attr -> in_mdev , vhca_id ));
287
+ MLX5_CAP_GEN (src_esw -> dev , vhca_id ));
287
288
288
289
misc = MLX5_ADDR_OF (fte_match_param , spec -> match_criteria , misc_parameters );
289
290
MLX5_SET_TO_ONES (fte_match_set_misc , misc , source_port );
@@ -407,7 +408,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
407
408
fdb = attr -> ft ;
408
409
409
410
if (!(attr -> flags & MLX5_ESW_ATTR_FLAG_NO_IN_PORT ))
410
- mlx5_eswitch_set_rule_source_port (esw , spec , esw_attr );
411
+ mlx5_eswitch_set_rule_source_port (esw , spec ,
412
+ esw_attr -> in_mdev -> priv .eswitch ,
413
+ esw_attr -> in_rep -> vport );
411
414
}
412
415
if (IS_ERR (fdb )) {
413
416
rule = ERR_CAST (fdb );
@@ -487,7 +490,9 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw,
487
490
dest [i ].ft = fwd_fdb ;
488
491
i ++ ;
489
492
490
- mlx5_eswitch_set_rule_source_port (esw , spec , esw_attr );
493
+ mlx5_eswitch_set_rule_source_port (esw , spec ,
494
+ esw_attr -> in_mdev -> priv .eswitch ,
495
+ esw_attr -> in_rep -> vport );
491
496
492
497
if (attr -> outer_match_level != MLX5_MATCH_NONE )
493
498
spec -> match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS ;
0 commit comments