Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efd8e39a authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher
Browse files

i40e: allow zero MAC address for VFs



Allow the user to specify a zero MAC address for VFs. This removes the
existing MAC address and allows the VF to use a random address. Libvirt
does this normally when removing a VF from a VM.

Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 2d166c30
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2084,9 +2084,9 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
		goto error_param;
	}

	if (!is_valid_ether_addr(mac)) {
	if (is_multicast_ether_addr(mac)) {
		dev_err(&pf->pdev->dev,
			"Invalid VF ethernet address\n");
			"Invalid Ethernet address %pM for VF %d\n", mac, vf_id);
		ret = -EINVAL;
		goto error_param;
	}
@@ -2097,6 +2097,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
	spin_lock_bh(&vsi->mac_filter_list_lock);

	/* delete the temporary mac address */
	if (!is_zero_ether_addr(vf->default_lan_addr.addr))
		i40e_del_filter(vsi, vf->default_lan_addr.addr,
				vf->port_vlan_id ? vf->port_vlan_id : -1,
				true, false);