@@ -642,7 +642,7 @@ static void iavf_vlan_add_reject(struct iavf_adapter *adapter)
642642
643643 spin_lock_bh (& adapter -> mac_vlan_list_lock );
644644 list_for_each_entry_safe (f , ftmp , & adapter -> vlan_filter_list , list ) {
645- if (f -> is_new_vlan ) {
645+ if (f -> state == IAVF_VLAN_IS_NEW ) {
646646 if (f -> vlan .tpid == ETH_P_8021Q )
647647 clear_bit (f -> vlan .vid ,
648648 adapter -> vsi .active_cvlans );
@@ -679,7 +679,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter)
679679 spin_lock_bh (& adapter -> mac_vlan_list_lock );
680680
681681 list_for_each_entry (f , & adapter -> vlan_filter_list , list ) {
682- if (f -> add )
682+ if (f -> state == IAVF_VLAN_ADD )
683683 count ++ ;
684684 }
685685 if (!count || !VLAN_FILTERING_ALLOWED (adapter )) {
@@ -710,11 +710,10 @@ void iavf_add_vlans(struct iavf_adapter *adapter)
710710 vvfl -> vsi_id = adapter -> vsi_res -> vsi_id ;
711711 vvfl -> num_elements = count ;
712712 list_for_each_entry (f , & adapter -> vlan_filter_list , list ) {
713- if (f -> add ) {
713+ if (f -> state == IAVF_VLAN_ADD ) {
714714 vvfl -> vlan_id [i ] = f -> vlan .vid ;
715715 i ++ ;
716- f -> add = false;
717- f -> is_new_vlan = true;
716+ f -> state = IAVF_VLAN_IS_NEW ;
718717 if (i == count )
719718 break ;
720719 }
@@ -760,7 +759,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter)
760759 vvfl_v2 -> vport_id = adapter -> vsi_res -> vsi_id ;
761760 vvfl_v2 -> num_elements = count ;
762761 list_for_each_entry (f , & adapter -> vlan_filter_list , list ) {
763- if (f -> add ) {
762+ if (f -> state == IAVF_VLAN_ADD ) {
764763 struct virtchnl_vlan_supported_caps * filtering_support =
765764 & adapter -> vlan_v2_caps .filtering .filtering_support ;
766765 struct virtchnl_vlan * vlan ;
@@ -778,8 +777,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter)
778777 vlan -> tpid = f -> vlan .tpid ;
779778
780779 i ++ ;
781- f -> add = false;
782- f -> is_new_vlan = true;
780+ f -> state = IAVF_VLAN_IS_NEW ;
783781 }
784782 }
785783
@@ -822,10 +820,11 @@ void iavf_del_vlans(struct iavf_adapter *adapter)
822820 * filters marked for removal to enable bailing out before
823821 * sending a virtchnl message
824822 */
825- if (f -> remove && !VLAN_FILTERING_ALLOWED (adapter )) {
823+ if (f -> state == IAVF_VLAN_REMOVE &&
824+ !VLAN_FILTERING_ALLOWED (adapter )) {
826825 list_del (& f -> list );
827826 kfree (f );
828- } else if (f -> remove ) {
827+ } else if (f -> state == IAVF_VLAN_REMOVE ) {
829828 count ++ ;
830829 }
831830 }
@@ -857,7 +856,7 @@ void iavf_del_vlans(struct iavf_adapter *adapter)
857856 vvfl -> vsi_id = adapter -> vsi_res -> vsi_id ;
858857 vvfl -> num_elements = count ;
859858 list_for_each_entry_safe (f , ftmp , & adapter -> vlan_filter_list , list ) {
860- if (f -> remove ) {
859+ if (f -> state == IAVF_VLAN_REMOVE ) {
861860 vvfl -> vlan_id [i ] = f -> vlan .vid ;
862861 i ++ ;
863862 list_del (& f -> list );
@@ -901,7 +900,7 @@ void iavf_del_vlans(struct iavf_adapter *adapter)
901900 vvfl_v2 -> vport_id = adapter -> vsi_res -> vsi_id ;
902901 vvfl_v2 -> num_elements = count ;
903902 list_for_each_entry_safe (f , ftmp , & adapter -> vlan_filter_list , list ) {
904- if (f -> remove ) {
903+ if (f -> state == IAVF_VLAN_REMOVE ) {
905904 struct virtchnl_vlan_supported_caps * filtering_support =
906905 & adapter -> vlan_v2_caps .filtering .filtering_support ;
907906 struct virtchnl_vlan * vlan ;
@@ -2192,7 +2191,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
21922191 list_for_each_entry (vlf ,
21932192 & adapter -> vlan_filter_list ,
21942193 list )
2195- vlf -> add = true ;
2194+ vlf -> state = IAVF_VLAN_ADD ;
21962195
21972196 adapter -> aq_required |=
21982197 IAVF_FLAG_AQ_ADD_VLAN_FILTER ;
@@ -2260,7 +2259,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
22602259 list_for_each_entry (vlf ,
22612260 & adapter -> vlan_filter_list ,
22622261 list )
2263- vlf -> add = true ;
2262+ vlf -> state = IAVF_VLAN_ADD ;
22642263
22652264 aq_required |= IAVF_FLAG_AQ_ADD_VLAN_FILTER ;
22662265 }
@@ -2444,8 +2443,8 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
24442443
24452444 spin_lock_bh (& adapter -> mac_vlan_list_lock );
24462445 list_for_each_entry (f , & adapter -> vlan_filter_list , list ) {
2447- if (f -> is_new_vlan ) {
2448- f -> is_new_vlan = false ;
2446+ if (f -> state == IAVF_VLAN_IS_NEW ) {
2447+ f -> state = IAVF_VLAN_ACTIVE ;
24492448 if (f -> vlan .tpid == ETH_P_8021Q )
24502449 set_bit (f -> vlan .vid ,
24512450 adapter -> vsi .active_cvlans );
0 commit comments