@@ -463,7 +463,7 @@ static int mlx5_set_extended_dest(struct mlx5_core_dev *dev,
463
463
int num_encap = 0 ;
464
464
465
465
* extended_dest = false;
466
- if (!(fte -> action .action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ))
466
+ if (!(fte -> act_dests . action .action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ))
467
467
return 0 ;
468
468
469
469
list_for_each_entry (dst , & fte -> node .children , node .list ) {
@@ -502,17 +502,17 @@ mlx5_cmd_set_fte_flow_meter(struct fs_fte *fte, void *in_flow_context)
502
502
execute_aso [0 ]);
503
503
MLX5_SET (execute_aso , execute_aso , valid , 1 );
504
504
MLX5_SET (execute_aso , execute_aso , aso_object_id ,
505
- fte -> action .exe_aso .object_id );
505
+ fte -> act_dests . action .exe_aso .object_id );
506
506
507
507
exe_aso_ctrl = MLX5_ADDR_OF (execute_aso , execute_aso , exe_aso_ctrl );
508
508
MLX5_SET (exe_aso_ctrl_flow_meter , exe_aso_ctrl , return_reg_id ,
509
- fte -> action .exe_aso .return_reg_id );
509
+ fte -> act_dests . action .exe_aso .return_reg_id );
510
510
MLX5_SET (exe_aso_ctrl_flow_meter , exe_aso_ctrl , aso_type ,
511
- fte -> action .exe_aso .type );
511
+ fte -> act_dests . action .exe_aso .type );
512
512
MLX5_SET (exe_aso_ctrl_flow_meter , exe_aso_ctrl , init_color ,
513
- fte -> action .exe_aso .flow_meter .init_color );
513
+ fte -> act_dests . action .exe_aso .flow_meter .init_color );
514
514
MLX5_SET (exe_aso_ctrl_flow_meter , exe_aso_ctrl , meter_id ,
515
- fte -> action .exe_aso .flow_meter .meter_idx );
515
+ fte -> act_dests . action .exe_aso .flow_meter .meter_idx );
516
516
}
517
517
518
518
static int mlx5_cmd_set_fte (struct mlx5_core_dev * dev ,
@@ -541,7 +541,7 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
541
541
else
542
542
dst_cnt_size = MLX5_ST_SZ_BYTES (extended_dest_format );
543
543
544
- inlen = MLX5_ST_SZ_BYTES (set_fte_in ) + fte -> dests_size * dst_cnt_size ;
544
+ inlen = MLX5_ST_SZ_BYTES (set_fte_in ) + fte -> act_dests . dests_size * dst_cnt_size ;
545
545
in = kvzalloc (inlen , GFP_KERNEL );
546
546
if (!in )
547
547
return - ENOMEM ;
@@ -553,7 +553,7 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
553
553
MLX5_SET (set_fte_in , in , table_id , ft -> id );
554
554
MLX5_SET (set_fte_in , in , flow_index , fte -> index );
555
555
MLX5_SET (set_fte_in , in , ignore_flow_level ,
556
- !!(fte -> action .flags & FLOW_ACT_IGNORE_FLOW_LEVEL ));
556
+ !!(fte -> act_dests . action .flags & FLOW_ACT_IGNORE_FLOW_LEVEL ));
557
557
558
558
MLX5_SET (set_fte_in , in , vport_number , ft -> vport );
559
559
MLX5_SET (set_fte_in , in , other_vport ,
@@ -563,23 +563,23 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
563
563
MLX5_SET (flow_context , in_flow_context , group_id , group_id );
564
564
565
565
MLX5_SET (flow_context , in_flow_context , flow_tag ,
566
- fte -> flow_context .flow_tag );
566
+ fte -> act_dests . flow_context .flow_tag );
567
567
MLX5_SET (flow_context , in_flow_context , flow_source ,
568
- fte -> flow_context .flow_source );
568
+ fte -> act_dests . flow_context .flow_source );
569
569
MLX5_SET (flow_context , in_flow_context , uplink_hairpin_en ,
570
- !!(fte -> flow_context .flags & FLOW_CONTEXT_UPLINK_HAIRPIN_EN ));
570
+ !!(fte -> act_dests . flow_context .flags & FLOW_CONTEXT_UPLINK_HAIRPIN_EN ));
571
571
572
572
MLX5_SET (flow_context , in_flow_context , extended_destination ,
573
573
extended_dest );
574
574
575
- action = fte -> action .action ;
575
+ action = fte -> act_dests . action .action ;
576
576
if (extended_dest )
577
577
action &= ~MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT ;
578
578
579
579
MLX5_SET (flow_context , in_flow_context , action , action );
580
580
581
- if (!extended_dest && fte -> action .pkt_reformat ) {
582
- struct mlx5_pkt_reformat * pkt_reformat = fte -> action .pkt_reformat ;
581
+ if (!extended_dest && fte -> act_dests . action .pkt_reformat ) {
582
+ struct mlx5_pkt_reformat * pkt_reformat = fte -> act_dests . action .pkt_reformat ;
583
583
584
584
if (pkt_reformat -> owner == MLX5_FLOW_RESOURCE_OWNER_SW ) {
585
585
reformat_id = mlx5_fs_dr_action_get_pkt_reformat_id (pkt_reformat );
@@ -591,46 +591,46 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
591
591
goto err_out ;
592
592
}
593
593
} else {
594
- reformat_id = fte -> action .pkt_reformat -> id ;
594
+ reformat_id = fte -> act_dests . action .pkt_reformat -> id ;
595
595
}
596
596
}
597
597
598
598
MLX5_SET (flow_context , in_flow_context , packet_reformat_id , (u32 )reformat_id );
599
599
600
- if (fte -> action .modify_hdr ) {
601
- if (fte -> action .modify_hdr -> owner == MLX5_FLOW_RESOURCE_OWNER_SW ) {
600
+ if (fte -> act_dests . action .modify_hdr ) {
601
+ if (fte -> act_dests . action .modify_hdr -> owner == MLX5_FLOW_RESOURCE_OWNER_SW ) {
602
602
mlx5_core_err (dev , "Can't use SW-owned modify_hdr in FW-owned table\n" );
603
603
err = - EOPNOTSUPP ;
604
604
goto err_out ;
605
605
}
606
606
607
607
MLX5_SET (flow_context , in_flow_context , modify_header_id ,
608
- fte -> action .modify_hdr -> id );
608
+ fte -> act_dests . action .modify_hdr -> id );
609
609
}
610
610
611
611
MLX5_SET (flow_context , in_flow_context , encrypt_decrypt_type ,
612
- fte -> action .crypto .type );
612
+ fte -> act_dests . action .crypto .type );
613
613
MLX5_SET (flow_context , in_flow_context , encrypt_decrypt_obj_id ,
614
- fte -> action .crypto .obj_id );
614
+ fte -> act_dests . action .crypto .obj_id );
615
615
616
616
vlan = MLX5_ADDR_OF (flow_context , in_flow_context , push_vlan );
617
617
618
- MLX5_SET (vlan , vlan , ethtype , fte -> action .vlan [0 ].ethtype );
619
- MLX5_SET (vlan , vlan , vid , fte -> action .vlan [0 ].vid );
620
- MLX5_SET (vlan , vlan , prio , fte -> action .vlan [0 ].prio );
618
+ MLX5_SET (vlan , vlan , ethtype , fte -> act_dests . action .vlan [0 ].ethtype );
619
+ MLX5_SET (vlan , vlan , vid , fte -> act_dests . action .vlan [0 ].vid );
620
+ MLX5_SET (vlan , vlan , prio , fte -> act_dests . action .vlan [0 ].prio );
621
621
622
622
vlan = MLX5_ADDR_OF (flow_context , in_flow_context , push_vlan_2 );
623
623
624
- MLX5_SET (vlan , vlan , ethtype , fte -> action .vlan [1 ].ethtype );
625
- MLX5_SET (vlan , vlan , vid , fte -> action .vlan [1 ].vid );
626
- MLX5_SET (vlan , vlan , prio , fte -> action .vlan [1 ].prio );
624
+ MLX5_SET (vlan , vlan , ethtype , fte -> act_dests . action .vlan [1 ].ethtype );
625
+ MLX5_SET (vlan , vlan , vid , fte -> act_dests . action .vlan [1 ].vid );
626
+ MLX5_SET (vlan , vlan , prio , fte -> act_dests . action .vlan [1 ].prio );
627
627
628
628
in_match_value = MLX5_ADDR_OF (flow_context , in_flow_context ,
629
629
match_value );
630
630
memcpy (in_match_value , & fte -> val , sizeof (fte -> val ));
631
631
632
632
in_dests = MLX5_ADDR_OF (flow_context , in_flow_context , destination );
633
- if (fte -> action .action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ) {
633
+ if (fte -> act_dests . action .action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ) {
634
634
int list_size = 0 ;
635
635
636
636
list_for_each_entry (dst , & fte -> node .children , node .list ) {
@@ -706,7 +706,7 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
706
706
list_size );
707
707
}
708
708
709
- if (fte -> action .action & MLX5_FLOW_CONTEXT_ACTION_COUNT ) {
709
+ if (fte -> act_dests . action .action & MLX5_FLOW_CONTEXT_ACTION_COUNT ) {
710
710
int max_list_size = BIT (MLX5_CAP_FLOWTABLE_TYPE (dev ,
711
711
log_max_flow_counter ,
712
712
ft -> type ));
@@ -731,8 +731,8 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
731
731
list_size );
732
732
}
733
733
734
- if (fte -> action .action & MLX5_FLOW_CONTEXT_ACTION_EXECUTE_ASO ) {
735
- if (fte -> action .exe_aso .type == MLX5_EXE_ASO_FLOW_METER ) {
734
+ if (fte -> act_dests . action .action & MLX5_FLOW_CONTEXT_ACTION_EXECUTE_ASO ) {
735
+ if (fte -> act_dests . action .exe_aso .type == MLX5_EXE_ASO_FLOW_METER ) {
736
736
mlx5_cmd_set_fte_flow_meter (fte , in_flow_context );
737
737
} else {
738
738
err = - EOPNOTSUPP ;
0 commit comments