]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
[karo-tx-linux.git] / drivers / net / ethernet / intel / fm10k / fm10k_netdev.c
index 99228bf46c1202170ef8eb934624e15d99a257d9..639263d5e833a04d19967f6df3cd20d8ce574a3b 100644 (file)
@@ -758,6 +758,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        struct fm10k_intfc *interface = netdev_priv(netdev);
        struct fm10k_hw *hw = &interface->hw;
        s32 err;
+       int i;
 
        /* updates do not apply to VLAN 0 */
        if (!vid)
@@ -775,8 +776,25 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        if (!set)
                clear_bit(vid, interface->active_vlans);
 
-       /* if default VLAN is already present do nothing */
-       if (vid == hw->mac.default_vid)
+       /* disable the default VID on ring if we have an active VLAN */
+       for (i = 0; i < interface->num_rx_queues; i++) {
+               struct fm10k_ring *rx_ring = interface->rx_ring[i];
+               u16 rx_vid = rx_ring->vid & (VLAN_N_VID - 1);
+
+               if (test_bit(rx_vid, interface->active_vlans))
+                       rx_ring->vid |= FM10K_VLAN_CLEAR;
+               else
+                       rx_ring->vid &= ~FM10K_VLAN_CLEAR;
+       }
+
+       /* Do not remove default VID related entries from VLAN and MAC tables */
+       if (!set && vid == hw->mac.default_vid)
+               return 0;
+
+       /* Do not throw an error if the interface is down. We will sync once
+        * we come up
+        */
+       if (test_bit(__FM10K_DOWN, &interface->state))
                return 0;
 
        fm10k_mbx_lock(interface);
@@ -996,21 +1014,6 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)
        int xcast_mode;
        u16 vid, glort;
 
-       /* restore our address if perm_addr is set */
-       if (hw->mac.type == fm10k_mac_vf) {
-               if (is_valid_ether_addr(hw->mac.perm_addr)) {
-                       ether_addr_copy(hw->mac.addr, hw->mac.perm_addr);
-                       ether_addr_copy(netdev->perm_addr, hw->mac.perm_addr);
-                       ether_addr_copy(netdev->dev_addr, hw->mac.perm_addr);
-                       netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
-               }
-
-               if (hw->mac.vlan_override)
-                       netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX;
-               else
-                       netdev->features |= NETIF_F_HW_VLAN_CTAG_RX;
-       }
-
        /* record glort for this interface */
        glort = interface->glort;
 
@@ -1045,7 +1048,7 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)
                                           vid, true, 0);
        }
 
-       /* update xcast mode before syncronizing addresses */
+       /* update xcast mode before synchronizing addresses */
        hw->mac.ops.update_xcast_mode(hw, glort, xcast_mode);
 
        /* synchronize all of the addresses */