ixgbe: Avoid adding VLAN 0 twice to VLVF and VFTA
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 7 Jan 2016 06:48:50 +0000 (22:48 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 4 Apr 2016 20:33:10 +0000 (13:33 -0700)
We were adding VLAN 0 twice each time we restored the VLAN configuration.
Instead of doing it twice we can just start working through the active
VLANs from ID 1 on and skip the double write.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index a01a7f251e0373f43d6b1342a8d1078aba3e0998..297e7d32adfd6539327b943787694df16d5c7493 100644 (file)
@@ -4172,11 +4172,11 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
 
 static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
 {
-       u16 vid;
+       u16 vid = 1;
 
        ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
 
-       for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
+       for_each_set_bit_from(vid, adapter->active_vlans, VLAN_N_VID)
                ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
 }