netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH] igbvf, ixgbevf: use dev_hw_addr_random
@ 2010-07-27  9:24 Stefan Assmann
  2010-07-27 20:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Assmann @ 2010-07-27  9:24 UTC (permalink / raw)
  To: netdev; +Cc: e1000-devel, jeffrey.t.kirsher, Rose, Gregory V, David Miller

From: Stefan Assmann <sassmann@redhat.com>

Both igbvf and ixgbevf should set addr_assign_type to NET_ADDR_RANDOM
so udev creates persistent net rules by matching the device path.
Do this by using the dev_hw_addr_random helper function.

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
---
 drivers/net/igbvf/netdev.c         |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 5e2b2a8..048595b 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2751,7 +2751,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
 		dev_info(&pdev->dev,
 			 "PF still in reset state, assigning new address."
 			 " Is the PF interface up?\n");
-		random_ether_addr(hw->mac.addr);
+		dev_hw_addr_random(adapter->netdev, hw->mac.addr);
 	} else {
 		err = hw->mac.ops.read_mac_addr(hw);
 		if (err) {
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index af49135..4867440 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2229,7 +2229,7 @@ static int __devinit ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
 	if (err) {
 		dev_info(&pdev->dev,
 		         "PF still in reset state, assigning new address\n");
-		random_ether_addr(hw->mac.addr);
+		dev_hw_addr_random(adapter->netdev, hw->mac.addr);
 	} else {
 		err = hw->mac.ops.init_hw(hw);
 		if (err) {
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-27 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27  9:24 [net-next-2.6 PATCH] igbvf, ixgbevf: use dev_hw_addr_random Stefan Assmann
2010-07-27 20:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).