fm10k: allow creation of VLAN interfaces even while down
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 19 Jun 2015 17:56:09 +0000 (10:56 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 16 Sep 2015 00:05:46 +0000 (17:05 -0700)
We re-sync upon going up, so there is little reason to worry about not
syncing immediately with switch. This prevents an error that occurs if
you add a VLAN interface while down.

Signed-off-by: Jacob Keller <jacob.e.keller@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 b2065cb44edc0e14a29c65ce02f118a3d0685981..e1ceb3a2e2cda7ceae6d2a41938fff309991e23b 100644 (file)
@@ -779,6 +779,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        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);
 
        /* only need to update the VLAN if not in promiscuous mode */