]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fm10k: update netdev perm_addr during reinit, instead of at up
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 15 Jun 2015 22:00:56 +0000 (15:00 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 06:03:09 +0000 (22:03 -0800)
Update the netdev permanent address during fm10k_reinit enables the user
to immediately see the new MAC address on the VF even if the device
isn't up. The previous code required that the device by opened before
changes would appear.

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>
Orabug: 25394529
(cherry picked from commit bdc7f5902d22e7297b8f0d7a8d6ed8429cdba636)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
drivers/net/ethernet/intel/fm10k/fm10k_pci.c

index 4df8fe22cc43a9dd568e6c503945f5c4500efdc4..3a6230b405fe27169338857ba726d10483cd13ee 100644 (file)
@@ -1014,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;
 
index a4020b56f2fa8f52fcda9cebe243b0cd730bfe5a..c8c55fa812782bbdd078faac180075e230a1e7a3 100644 (file)
@@ -170,6 +170,21 @@ static void fm10k_reinit(struct fm10k_intfc *interface)
        /* reassociate interrupts */
        fm10k_mbx_request_irq(interface);
 
+       /* update hardware address for VFs if perm_addr has changed */
+       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;
+       }
+
        /* reset clock */
        fm10k_ts_reset(interface);