fm10k: allow creation of VLAN on default vid
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 10 Apr 2015 23:48:19 +0000 (16:48 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 14 Apr 2015 22:34:33 +0000 (15:34 -0700)
Previously, the user was not allowed to create a VLAN interface on top
of the switch default vid.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c

index 702d845..6981964 100644 (file)
@@ -770,15 +770,15 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        if (hw->mac.vlan_override)
                return -EACCES;
 
-       /* if default VLAN is already present do nothing */
-       if (vid == hw->mac.default_vid)
-               return -EBUSY;
-
        /* update active_vlans bitmask */
        set_bit(vid, interface->active_vlans);
        if (!set)
                clear_bit(vid, interface->active_vlans);
 
+       /* if default VLAN is already present do nothing */
+       if (vid == hw->mac.default_vid)
+               return 0;
+
        fm10k_mbx_lock(interface);
 
        /* only need to update the VLAN if not in promiscuous mode */