@@ -302,9 +302,7 @@ void ice_fdir_rem_adq_chnl(struct ice_hw *hw, u16 vsi_idx)
302
302
continue ;
303
303
304
304
for (tun = 0 ; tun < ICE_FD_HW_SEG_MAX ; tun ++ ) {
305
- u64 prof_id ;
306
-
307
- prof_id = flow + tun * ICE_FLTR_PTYPE_MAX ;
305
+ u64 prof_id = prof -> prof_id [tun ];
308
306
309
307
for (i = 0 ; i < prof -> cnt ; i ++ ) {
310
308
if (prof -> vsi_h [i ] != vsi_idx )
@@ -362,10 +360,9 @@ ice_fdir_erase_flow_from_hw(struct ice_hw *hw, enum ice_block blk, int flow)
362
360
return ;
363
361
364
362
for (tun = 0 ; tun < ICE_FD_HW_SEG_MAX ; tun ++ ) {
365
- u64 prof_id ;
363
+ u64 prof_id = prof -> prof_id [ tun ] ;
366
364
int j ;
367
365
368
- prof_id = flow + tun * ICE_FLTR_PTYPE_MAX ;
369
366
for (j = 0 ; j < prof -> cnt ; j ++ ) {
370
367
u16 vsi_num ;
371
368
@@ -439,12 +436,10 @@ void ice_fdir_replay_flows(struct ice_hw *hw)
439
436
for (tun = 0 ; tun < ICE_FD_HW_SEG_MAX ; tun ++ ) {
440
437
struct ice_flow_prof * hw_prof ;
441
438
struct ice_fd_hw_prof * prof ;
442
- u64 prof_id ;
443
439
int j ;
444
440
445
441
prof = hw -> fdir_prof [flow ];
446
- prof_id = flow + tun * ICE_FLTR_PTYPE_MAX ;
447
- ice_flow_add_prof (hw , ICE_BLK_FD , ICE_FLOW_RX , prof_id ,
442
+ ice_flow_add_prof (hw , ICE_BLK_FD , ICE_FLOW_RX ,
448
443
prof -> fdir_seg [tun ], TNL_SEG_CNT (tun ),
449
444
& hw_prof );
450
445
for (j = 0 ; j < prof -> cnt ; j ++ ) {
@@ -454,7 +449,7 @@ void ice_fdir_replay_flows(struct ice_hw *hw)
454
449
455
450
prio = ICE_FLOW_PRIO_NORMAL ;
456
451
err = ice_flow_add_entry (hw , ICE_BLK_FD ,
457
- prof_id ,
452
+ hw_prof -> id ,
458
453
prof -> vsi_h [0 ],
459
454
prof -> vsi_h [j ],
460
455
prio , prof -> fdir_seg ,
@@ -464,6 +459,7 @@ void ice_fdir_replay_flows(struct ice_hw *hw)
464
459
flow );
465
460
continue ;
466
461
}
462
+ prof -> prof_id [tun ] = hw_prof -> id ;
467
463
prof -> entry_h [j ][tun ] = entry_h ;
468
464
}
469
465
}
@@ -638,7 +634,6 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
638
634
u64 entry1_h = 0 ;
639
635
u64 entry2_h = 0 ;
640
636
bool del_last ;
641
- u64 prof_id ;
642
637
int err ;
643
638
int idx ;
644
639
@@ -686,23 +681,23 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
686
681
* That is the final parameters are 1 header (segment), no
687
682
* actions (NULL) and zero actions 0.
688
683
*/
689
- prof_id = flow + tun * ICE_FLTR_PTYPE_MAX ;
690
- err = ice_flow_add_prof (hw , ICE_BLK_FD , ICE_FLOW_RX , prof_id , seg ,
684
+ err = ice_flow_add_prof (hw , ICE_BLK_FD , ICE_FLOW_RX , seg ,
691
685
TNL_SEG_CNT (tun ), & prof );
692
686
if (err )
693
687
return err ;
694
- err = ice_flow_add_entry (hw , ICE_BLK_FD , prof_id , main_vsi -> idx ,
688
+ err = ice_flow_add_entry (hw , ICE_BLK_FD , prof -> id , main_vsi -> idx ,
695
689
main_vsi -> idx , ICE_FLOW_PRIO_NORMAL ,
696
690
seg , & entry1_h );
697
691
if (err )
698
692
goto err_prof ;
699
- err = ice_flow_add_entry (hw , ICE_BLK_FD , prof_id , main_vsi -> idx ,
693
+ err = ice_flow_add_entry (hw , ICE_BLK_FD , prof -> id , main_vsi -> idx ,
700
694
ctrl_vsi -> idx , ICE_FLOW_PRIO_NORMAL ,
701
695
seg , & entry2_h );
702
696
if (err )
703
697
goto err_entry ;
704
698
705
699
hw_prof -> fdir_seg [tun ] = seg ;
700
+ hw_prof -> prof_id [tun ] = prof -> id ;
706
701
hw_prof -> entry_h [0 ][tun ] = entry1_h ;
707
702
hw_prof -> entry_h [1 ][tun ] = entry2_h ;
708
703
hw_prof -> vsi_h [0 ] = main_vsi -> idx ;
@@ -719,7 +714,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
719
714
720
715
entry1_h = 0 ;
721
716
vsi_h = main_vsi -> tc_map_vsi [idx ]-> idx ;
722
- err = ice_flow_add_entry (hw , ICE_BLK_FD , prof_id ,
717
+ err = ice_flow_add_entry (hw , ICE_BLK_FD , prof -> id ,
723
718
main_vsi -> idx , vsi_h ,
724
719
ICE_FLOW_PRIO_NORMAL , seg ,
725
720
& entry1_h );
@@ -756,7 +751,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
756
751
757
752
if (!hw_prof -> entry_h [idx ][tun ])
758
753
continue ;
759
- ice_rem_prof_id_flow (hw , ICE_BLK_FD , vsi_num , prof_id );
754
+ ice_rem_prof_id_flow (hw , ICE_BLK_FD , vsi_num , prof -> id );
760
755
ice_flow_rem_entry (hw , ICE_BLK_FD , hw_prof -> entry_h [idx ][tun ]);
761
756
hw_prof -> entry_h [idx ][tun ] = 0 ;
762
757
if (del_last )
@@ -766,10 +761,10 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
766
761
hw_prof -> cnt = 0 ;
767
762
err_entry :
768
763
ice_rem_prof_id_flow (hw , ICE_BLK_FD ,
769
- ice_get_hw_vsi_num (hw , main_vsi -> idx ), prof_id );
764
+ ice_get_hw_vsi_num (hw , main_vsi -> idx ), prof -> id );
770
765
ice_flow_rem_entry (hw , ICE_BLK_FD , entry1_h );
771
766
err_prof :
772
- ice_flow_rem_prof (hw , ICE_BLK_FD , prof_id );
767
+ ice_flow_rem_prof (hw , ICE_BLK_FD , prof -> id );
773
768
dev_err (dev , "Failed to add filter. Flow director filters on each port must have the same input set.\n" );
774
769
775
770
return err ;
0 commit comments