[ipxe-devel] [PATCH 2/2] igbvf: Allow changing of MAC address

Hannes Reinecke hare at suse.de
Tue Jun 3 12:01:17 UTC 2014


The VF might not have assigned a MAC address upon startup, and
will end up with a random MAC address during probe(). With this
patch the MAC address can be changed later on.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 src/drivers/net/igbvf/igbvf_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/drivers/net/igbvf/igbvf_main.c b/src/drivers/net/igbvf/igbvf_main.c
index c4d1b0d..ef05ded 100644
--- a/src/drivers/net/igbvf/igbvf_main.c
+++ b/src/drivers/net/igbvf/igbvf_main.c
@@ -617,6 +617,10 @@ static int igbvf_open ( struct net_device *netdev )
 
 	DBG ("igbvf_open\n");
 
+	/* Update MAC address */
+	memcpy ( adapter->hw.mac.addr, netdev->ll_addr, ETH_ALEN );
+	igbvf_reset( adapter );
+
 	/* allocate transmit descriptors */
 	err = igbvf_setup_tx_resources ( adapter );
 	if (err) {
-- 
1.8.4.5




More information about the ipxe-devel mailing list