[Intel-wired-lan] [PATCH v8] i40e: Look up MAC address in Open Firmware or IDPROM

David Miller davem at davemloft.net
Sun Dec 6 04:12:53 UTC 2015


From: Sowmini Varadhan <sowmini.varadhan at oracle.com>
Date: Sat, 5 Dec 2015 15:33:00 -0500

> +static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf *pf)
> +{
> +	struct device_node *dp = pci_device_to_OF_node(pdev);
> +	const unsigned char *addr;
> +	u8 *mac_addr = pf->hw.mac.addr;
> +
> +	pf->flags &= ~I40E_FLAG_PF_MAC;
> +	addr = of_get_mac_address(dp);
> +	if (addr) {
> +		ether_addr_copy(mac_addr, addr);
> +		pf->flags |= I40E_FLAG_PF_MAC;
> +	}
> +#ifdef CONFIG_SPARC
> +	ether_addr_copy(mac_addr, idprom->id_ethaddr);
> +	pf->flags |= I40E_FLAG_PF_MAC;
> +#endif /* CONFIG_SPARC */
> +}

This logic doesn't look right.

If we find an address via of_get_mac_address() we should not use the
IDPROM address.  But here you are, since the IDPROM code runs
unconditionally.


More information about the Intel-wired-lan mailing list