Re: [PATCH v8] i40e: Look up MAC address in Open Firmware or IDPROM

From: David Miller
Date: Sat Dec 05 2015 - 23:13:04 EST


From: Sowmini Varadhan <sowmini.varadhan@xxxxxxxxxx>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/