]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: handle setting administratively set MAC address back to zero
authorStefan Assmann <sassmann@kpanic.de>
Fri, 23 Jun 2017 07:46:24 +0000 (09:46 +0200)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:25 +0000 (14:15 -0700)
When an administratively set MAC was previously set and should now be
switched back to 00:00:00:00:00:00 the pf_set_mac flag did not get
toggled back to false.
As a result VFs were still treated as if an administratively set MAC was
present.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 2f1d86e44c9dac948a79ee7543426e00230564ab)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

index beb8ebb061a3b7e0a62084394ebfa3dfe291bd1e..839788297ef9ec688ee67c58dffa1ee52a8ebcb6 100644 (file)
@@ -2896,7 +2896,6 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 
        spin_unlock_bh(&vsi->mac_filter_hash_lock);
 
-       dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id);
        /* program mac filter */
        if (i40e_sync_vsi_filters(vsi)) {
                dev_err(&pf->pdev->dev, "Unable to program ucast filters\n");
@@ -2904,7 +2903,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
                goto error_param;
        }
        ether_addr_copy(vf->default_lan_addr.addr, mac);
-       vf->pf_set_mac = true;
+
+       if (is_zero_ether_addr(mac)) {
+               vf->pf_set_mac = false;
+               dev_info(&pf->pdev->dev, "Removing MAC on VF %d\n", vf_id);
+       } else {
+               vf->pf_set_mac = true;
+               dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n",
+                        mac, vf_id);
+       }
+
        /* Force the VF driver stop so it has to reload with new MAC address */
        i40e_vc_disable_vf(pf, vf);
        dev_info(&pf->pdev->dev, "Reload the VF driver to make this change effective.\n");