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

Commit 5017c2a8 authored by Greg Rose's avatar Greg Rose Committed by Jeff Kirsher
Browse files

i40e: Allow VF to set already assigned MAC address



The VF is allowed to request the PF to set its already assigned
MAC address without generating an error.

Change-Id: I8dfdf353396995dbbb26cafab4e42b451911da3d
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 6bbac866
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1348,10 +1348,13 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf, u8 *macaddr)
		   is_zero_ether_addr(macaddr)) {
		dev_err(&pf->pdev->dev, "invalid VF MAC addr %pM\n", macaddr);
		ret = I40E_ERR_INVALID_MAC_ADDR;
	} else if (vf->pf_set_mac && !is_multicast_ether_addr(macaddr)) {
	} else if (vf->pf_set_mac && !is_multicast_ether_addr(macaddr) &&
		   !ether_addr_equal(macaddr, vf->default_lan_addr.addr)) {
		/* If the host VMM administrator has set the VF MAC address
		 * administratively via the ndo_set_vf_mac command then deny
		 * permission to the VF to add or delete unicast MAC addresses.
		 * The VF may request to set the MAC address filter already
		 * assigned to it so do not return an error in that case.
		 */
		dev_err(&pf->pdev->dev,
			"VF attempting to override administratively set MAC address\nPlease reload the VF driver to resume normal operation\n");