i40e: Look up MAC address in Open Firmware or IDPROM
Subsystems (3)
PATCH v9 1/1 i40e: Look up MAC address in Open Firmware or IDPROM
This is the i40e equivalent of commit c762dff24c06 ("ixgbe: Look up MAC address in Open Firmware or IDPROM").
As with that fix, attempt to look up the MAC address in Open Firmware on systems that support it, and use IDPROM on SPARC if no OF address is found.
In the case of the i40e there is an assumption that the default mac address has already been set up as the primary mac filter on probe, so if this filter is obtained from the Open Firmware or IDPROM, an explicit write is needed via i40e_aq_mac_address_write() and i40e_aq_add_macvlan() invocation.
The I40E_FLAG_PF_MAC flag in the platform-private i40e_pf structure tracks whether a platform-specific mac address was found, in which case calls to i40e_aq_mac_address_write() and i40e_aq_add_macvlan() will be triggered.
---
v2, v3: Andy Shevchenko comments
v4: Shannon Nelson review: explicitly set up mac filters before register_netdev
v5: Shannon Nelson code style comments
v6: Shannon Nelson code style comments
v7: Ensure that i40e_macaddr_init() is called only for VSI_MAIN, and only
if the mac address is not the default. Some additional code-refactoring based on comments from Shannon Nelson
v8: use pf->flags instead of bit value to track if we found a platform-specific
macaddr. Other code-style comments from Shannon Nelson
v9: David Miller, Shannon Nelson comments for i40e_get_platform_mac_addr
drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 90 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -337,6 +337,7 @@ struct i40e_pf {#define I40E_FLAG_LINK_POLLING_ENABLED BIT_ULL(39)#define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40)#define I40E_FLAG_NO_PCI_LINK_CHECK BIT_ULL(42) +#define I40E_FLAG_PF_MAC BIT_ULL(50)/* tracks features that get auto disabled by errors */ u64 auto_disable_flags;
drivers/net/ethernet/intel/i40e/i40e_main.c +90 -0
120 lines not on this page · raw message
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Sowmini Varadhan <[email protected]>
Date: Mon, 7 Dec 2015 15:06:34 -0500
Quoted 13 lines
This is the i40e equivalent of commit
c762dff24c06("ixgbe: Look up MAC address in Open Firmware or IDPROM").As with that fix, attempt to look up the MAC address in Open Firmware on systems that support it, and use IDPROM on SPARC if no OF address is found.
In the case of the i40e there is an assumption that the default mac address has already been set up as the primary mac filter on probe, so if this filter is obtained from the Open Firmware or IDPROM, an explicit write is needed via
i40e_aq_mac_address_write()andi40e_aq_add_macvlan()invocation.
Quoted 7 lines
The
I40E_FLAG_PF_MACflag in the platform-privatei40e_pfstructure tracks whether a platform-specific mac address was found, in which case calls toi40e_aq_mac_address_write()andi40e_aq_add_macvlan()will be triggered.Reviewed-by Martin K. Petersen <[email protected]>Signed-off-by Sowmini Varadhan <[email protected]>
This looks good to me.
Once this goes in I'll add my generic MAC stuff to net-next and then we can convert the various Intel drivers to use it.
Shannon Nelson
Acked-byQuoted 33 lines · David Miller
From: Sowmini Varadhan <[email protected]>
Date: Mon, 7 Dec 2015 15:06:34 -0500Quoted 13 lines
This is the i40e equivalent of commit
c762dff24c06("ixgbe: Look up MAC address in Open Firmware or IDPROM").As with that fix, attempt to look up the MAC address in Open Firmware on systems that support it, and use IDPROM on SPARC if no OF address is found.
In the case of the i40e there is an assumption that the default mac address has already been set up as the primary mac filter on probe, so if this filter is obtained from the Open Firmware or IDPROM, an explicit write is needed via
i40e_aq_mac_address_write()andi40e_aq_add_macvlan()invocation.Quoted 7 lines
The
I40E_FLAG_PF_MACflag in the platform-privatei40e_pfstructure tracks whether a platform-specific mac address was found, in which case calls toi40e_aq_mac_address_write()andi40e_aq_add_macvlan()will be triggered.Reviewed-by Martin K. Petersen <[email protected]>Signed-off-by Sowmini Varadhan <[email protected]>This looks good to me.
Once this goes in I'll add my generic MAC stuff to net-next and then we can convert the various Intel drivers to use it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 7 lines
==============================================
Mr. Shannon Nelson Network Division, Intel Corp.
Shannon.Nelson at intel.com I don't speak for Intel
Parents can't afford to be squeamishBowers
PATCH v9 1/1 i40e: Look up MAC address in Open Firmware or IDPROM
In reply to Sowmini VaradhanQuoted 44 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Sowmini Varadhan
Sent: Monday, December 07, 2015 12:07 PM
To: sowmini.varadhan at oracle.com; intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-kernel at vger.kernel.org
Cc: andy.shevchenko at gmail.com; matthew.vick at intel.com; davem at davemloft.net
Subject: [Intel-wired-lan] [PATCH v9] i40e: Look up MAC address in Open Firmware or IDPROMThis is the i40e equivalent of commit
c762dff24c06("ixgbe: Look up MAC address in Open Firmware or IDPROM").As with that fix, attempt to look up the MAC address in Open Firmware on systems that support it, and use IDPROM on SPARC if no OF address is found.
In the case of the i40e there is an assumption that the default mac address has already been set up as the primary mac filter on probe, so if this filter is obtained from the Open Firmware or IDPROM, an explicit write is needed via
i40e_aq_mac_address_write()andi40e_aq_add_macvlan()invocation.The
I40E_FLAG_PF_MACflag in the platform-privatei40e_pfstructure tracks whether a platform-specific mac address was found, in which case calls toi40e_aq_mac_address_write()andi40e_aq_add_macvlan()will be triggered.Reviewed-by Martin K. Petersen <[email protected]>Signed-off-by Sowmini Varadhan <[email protected]>---
v2, v3: Andy Shevchenko comments
v4: Shannon Nelson review: explicitly set up mac filters beforeregister_netdev
v5: Shannon Nelson code style comments
v6: Shannon Nelson code style comments
v7: Ensure thati40e_macaddr_init()is called only forVSI_MAIN, and only
if the mac address is not the default. Some additional code-refactoring based on comments from Shannon Nelson
v8: usepf->flagsinstead of bit value to track if we found a platform-specific
macaddr. Other code-style comments from Shannon Nelson
v9: David Miller, Shannon Nelson comments fori40e_get_platform_mac_addr
Quoted 4 lines
drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 90 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-)
Patch code changes correctly applied, driver displays correct MAC address, no more -11 error on driver init.