netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses
@ 2012-02-17 15:43 Danny Kukawka
  2012-02-17 15:43 ` [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: user-mode-linux-devel, Jiri Pirko, e1000-devel, Jiri Kosina,
	b.a.t.m.a.n, Danny Kukawka, linux-kernel, netdev, Richard Cochran

The fourth part of my patch series to fix the handling of 
addr_assign_type for random MAC addresses. 

This most of the patches in this series are for slightly 
more complex cases to handle addr_assign_type and the
reset to NET_ADDR_PERM as soon as the MAC get changed via 
.ndo_set_mac_address where eth_mac_addr wasn't used.

Danny Kukawka (10):
  au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()
  lantiq_etop: set addr_assign_type if random_ether_addr() used
  davinci_emac: use eth_hw_addr_random() instead of random_ether_addr()
  xilinx ll_temac: use eth_hw_addr_random() instead of
    random_ether_addr()
  igbvf: reset netdevice addr_assign_type if changed
  batman-adv: use eth_hw_addr_random() instead of random_ether_addr()
  cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
  ethoc: set addr_assign_type if random_ether_addr() used
  atheros eth: set addr_assign_type if random_ether_addr() used
  UML net: set addr_assign_type if random_ether_addr() used

 arch/um/drivers/net_kern.c                      |   11 ++++++++---
 drivers/net/ethernet/amd/au1000_eth.c           |    9 +++++----
 drivers/net/ethernet/atheros/atl1c/atl1c_hw.c   |    2 +-
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c |    9 ++++-----
 drivers/net/ethernet/atheros/atlx/atl1.c        |   12 +++++++++---
 drivers/net/ethernet/atheros/atlx/atlx.c        |    1 +
 drivers/net/ethernet/cisco/enic/enic_main.c     |   14 ++++++++++++--
 drivers/net/ethernet/ethoc.c                    |   20 ++++++++++++++++++--
 drivers/net/ethernet/intel/igbvf/netdev.c       |    1 +
 drivers/net/ethernet/lantiq_etop.c              |    7 +++++++
 drivers/net/ethernet/ti/davinci_emac.c          |    5 +++--
 drivers/net/ethernet/xilinx/ll_temac_main.c     |    4 +++-
 net/batman-adv/soft-interface.c                 |    5 ++---
 13 files changed, 74 insertions(+), 26 deletions(-)

-- 
1.7.8.3


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired

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

* [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 20:59   ` David Miller
  2012-02-17 15:43 ` [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used Danny Kukawka
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: Danny Kukawka, Jeff Kirsher, Jiri Pirko, Wan ZongShun, netdev,
	linux-kernel

Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

v2: adapt to eth_hw_addr_random()

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/amd/au1000_eth.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 8b95dd3..8793daa 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1130,9 +1130,6 @@ static int __devinit au1000_probe(struct platform_device *pdev)
 
 	au1000_setup_hw_rings(aup, aup->macdma);
 
-	/* set a random MAC now in case platform_data doesn't provide one */
-	random_ether_addr(dev->dev_addr);
-
 	writel(0, aup->enable);
 	aup->mac_enabled = 0;
 
@@ -1142,8 +1139,12 @@ static int __devinit au1000_probe(struct platform_device *pdev)
 					" PHY search on MAC0\n");
 		aup->phy1_search_mac0 = 1;
 	} else {
-		if (is_valid_ether_addr(pd->mac))
+		if (is_valid_ether_addr(pd->mac)) {
 			memcpy(dev->dev_addr, pd->mac, 6);
+		} else {
+			/*set a random MAC since no valid provided by platform_data*/
+			eth_hw_addr_random(dev);
+		}
 
 		aup->phy_static_config = pd->phy_static_config;
 		aup->phy_search_highest_addr = pd->phy_search_highest_addr;
-- 
1.7.8.3

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

* [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
  2012-02-17 15:43 ` [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:00   ` David Miller
  2012-02-17 15:43 ` [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: Danny Kukawka, John Crispin, Ralf Baechle, Jeff Kirsher, netdev,
	linux-kernel

Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

v2: added comment, renamed bool variable to random_mac

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/lantiq_etop.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 85e2c6c..aee87fc 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -634,6 +634,7 @@ ltq_etop_init(struct net_device *dev)
 	struct ltq_etop_priv *priv = netdev_priv(dev);
 	struct sockaddr mac;
 	int err;
+	bool random_mac = false;
 
 	ether_setup(dev);
 	dev->watchdog_timeo = 10 * HZ;
@@ -646,11 +647,17 @@ ltq_etop_init(struct net_device *dev)
 	if (!is_valid_ether_addr(mac.sa_data)) {
 		pr_warn("etop: invalid MAC, using random\n");
 		random_ether_addr(mac.sa_data);
+		random_mac = true;
 	}
 
 	err = ltq_etop_set_mac_address(dev, &mac);
 	if (err)
 		goto err_netdev;
+
+	/*set addr_assign_type here, ltq_etop_set_mac_address would reset it*/
+	if (random_mac)
+		dev->addr_assign_type |= NET_ADDR_RANDOM;
+
 	ltq_etop_set_multicast_list(dev);
 	err = ltq_etop_mdio_init(dev);
 	if (err)
-- 
1.7.8.3

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

* [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
  2012-02-17 15:43 ` [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
  2012-02-17 15:43 ` [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:00   ` David Miller
  2012-02-17 15:43 ` [PATCH v2 04/10] xilinx ll_temac: " Danny Kukawka
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: Danny Kukawka, Richard Cochran, Julia Lawall, Sascha Hauer,
	Joe Perches, netdev, linux-kernel

Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

Remove one memcpy from emac_dev_setmac_addr() since this is a
duplicate: it's already done some lines above.

v2: use bitops, adapt to eth_hw_addr_random, remove a memcpy

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/ti/davinci_emac.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 794ac30..50adba0 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1260,10 +1260,10 @@ static int emac_dev_setmac_addr(struct net_device *ndev, void *addr)
 	/* Store mac addr in priv and rx channel and set it in EMAC hw */
 	memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len);
 	memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len);
+	ndev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	/* MAC address is configured only after the interface is enabled. */
 	if (netif_running(ndev)) {
-		memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len);
 		emac_setmac(priv, EMAC_DEF_RX_CH, priv->mac_addr);
 	}
 
@@ -1897,7 +1897,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
 
 	if (!is_valid_ether_addr(priv->mac_addr)) {
 		/* Use random MAC if none passed */
-		random_ether_addr(priv->mac_addr);
+		eth_hw_addr_random(ndev);
+		memcpy(priv->mac_addr, ndev->dev_addr, ndev->addr_len);
 		dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
 							priv->mac_addr);
 	}
-- 
1.7.8.3

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

* [PATCH v2 04/10] xilinx ll_temac: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
                   ` (2 preceding siblings ...)
  2012-02-17 15:43 ` [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:00   ` David Miller
  2012-02-17 15:43 ` [PATCH v2 05/10] igbvf: reset netdevice addr_assign_type if changed Danny Kukawka
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: Danny Kukawka, Stephen Rothwell, Ricardo Ribalda Delgado,
	Thomas Meyer, Richard Cochran, netdev, linux-kernel

Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: reworked to prevent using an extra variable

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/xilinx/ll_temac_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index f21addb..c1f72e8 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -327,7 +327,9 @@ static int temac_set_mac_address(struct net_device *ndev, void *address)
 		memcpy(ndev->dev_addr, address, ETH_ALEN);
 
 	if (!is_valid_ether_addr(ndev->dev_addr))
-		random_ether_addr(ndev->dev_addr);
+		eth_hw_addr_random(ndev);
+	else 
+		dev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	/* set up unicast MAC address filter set its mac address */
 	mutex_lock(&lp->indirect_mutex);
-- 
1.7.8.3

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

* [PATCH v2 05/10] igbvf: reset netdevice addr_assign_type if changed
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
                   ` (3 preceding siblings ...)
  2012-02-17 15:43 ` [PATCH v2 04/10] xilinx ll_temac: " Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:01   ` David Miller
       [not found] ` <1329493411-25750-1-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: netdev, e1000-devel, Danny Kukawka, Bruce Allan, Jesse Brandeburg,
	linux-kernel, John Ronciak, David S. Miller

Reset the state of addr_assign_type to NET_ADDR_PERM as soon as
the MAC get changed via .ndo_set_mac_address.

v2: use bitops to reset addr_assign_type

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/intel/igbvf/netdev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 9e335f7..d5faf99 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1695,6 +1695,7 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
 		return -EADDRNOTAVAIL;
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+	netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	return 0;
 }
-- 
1.7.8.3


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

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

* [PATCH v2 06/10] batman-adv: use eth_hw_addr_random() instead of random_ether_addr()
       [not found] ` <1329493411-25750-1-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
@ 2012-02-17 15:43   ` Danny Kukawka
       [not found]     ` <1329493411-25750-7-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
  0 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: Marek Lindner
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, Danny Kukawka,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Simon Wunderlich,
	David S. Miller

Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Remove dev_addr in interface_setup(), it's not needed anymore.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: use bitops, adapt to eth_hw_addr_random()

Signed-off-by: Danny Kukawka <danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
---
 net/batman-adv/soft-interface.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 987c75a..fd1d327 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -541,6 +541,7 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
 	}
 
 	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+	dev->addr_assign_type &= ~NET_ADDR_RANDOM;
 	return 0;
 }
 
@@ -783,7 +784,6 @@ static const struct net_device_ops bat_netdev_ops = {
 static void interface_setup(struct net_device *dev)
 {
 	struct bat_priv *priv = netdev_priv(dev);
-	char dev_addr[ETH_ALEN];
 
 	ether_setup(dev);
 
@@ -800,8 +800,7 @@ static void interface_setup(struct net_device *dev)
 	dev->hard_header_len = BAT_HEADER_LEN;
 
 	/* generate random address */
-	random_ether_addr(dev_addr);
-	memcpy(dev->dev_addr, dev_addr, ETH_ALEN);
+	eth_hw_addr_random(dev);
 
 	SET_ETHTOOL_OPS(dev, &bat_ethtool_ops);
 
-- 
1.7.8.3

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

* [PATCH v2 07/10] cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
                   ` (5 preceding siblings ...)
       [not found] ` <1329493411-25750-1-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:01   ` David Miller
  2012-02-17 15:43 ` [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
  2012-02-17 15:43 ` [PATCH v2 09/10] atheros eth: " Danny Kukawka
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: Christian Benvenuti
  Cc: Danny Kukawka, Roopa Prabhu, David S. Miller, David Wang, netdev,
	linux-kernel

Use dev_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Couldn't replace random_ether_addr() in enic_probe() since
enic_set_mac_addr() is used which would reset addr_assign_type.
Instead set addr_assign_type directly to NET_ADDR_RANDOM in
case of random mac after call enic_set_mac_addr().

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: use bitops, adapt to eth_hw_addr_random(), add a comment

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/cisco/enic/enic_main.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index ab3f67f..ed00cb3 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -865,6 +865,7 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr)
 	}
 
 	memcpy(netdev->dev_addr, addr, netdev->addr_len);
+	netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	return 0;
 }
@@ -1119,7 +1120,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
 		memcpy(pp->mac_addr, prev_pp.vf_mac, ETH_ALEN);
 
 	if (vf == PORT_SELF_VF && is_zero_ether_addr(netdev->dev_addr))
-		random_ether_addr(netdev->dev_addr);
+		eth_hw_addr_random(netdev);
 
 	err = enic_process_set_pp_request(enic, vf, &prev_pp, &restore_pp);
 	if (err) {
@@ -2272,6 +2273,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
 	int err;
 #ifdef CONFIG_PCI_IOV
 	int pos = 0;
+	bool random_mac = false;
 #endif
 	int num_pps = 1;
 
@@ -2467,8 +2469,10 @@ static int __devinit enic_probe(struct pci_dev *pdev,
 	(void)enic_change_mtu(netdev, enic->port_mtu);
 
 #ifdef CONFIG_PCI_IOV
-	if (enic_is_sriov_vf(enic) && is_zero_ether_addr(enic->mac_addr))
+	if (enic_is_sriov_vf(enic) && is_zero_ether_addr(enic->mac_addr)) {
 		random_ether_addr(enic->mac_addr);
+		random_mac = true;
+	}
 #endif
 
 	err = enic_set_mac_addr(netdev, enic->mac_addr);
@@ -2476,6 +2480,12 @@ static int __devinit enic_probe(struct pci_dev *pdev,
 		dev_err(dev, "Invalid MAC address, aborting\n");
 		goto err_out_dev_deinit;
 	}
+#ifdef CONFIG_PCI_IOV
+	if (random_mac) {
+		/*Couldn't use eth_hw_addr_random() due to enic_set_mac_addr()*/
+		netdev->addr_assign_type |= NET_ADDR_RANDOM;
+	}
+#endif
 
 	enic->tx_coalesce_usecs = enic->config.intr_timer_usec;
 	enic->rx_coalesce_usecs = enic->tx_coalesce_usecs;
-- 
1.7.8.3

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

* [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
                   ` (6 preceding siblings ...)
  2012-02-17 15:43 ` [PATCH v2 07/10] cisco/enic: " Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:02   ` David Miller
  2012-02-17 15:43 ` [PATCH v2 09/10] atheros eth: " Danny Kukawka
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: David S. Miller
  Cc: Danny Kukawka, Alexey Dobriyan, Paul Gortmaker, Richard Cochran,
	Jiri Kosina, netdev, linux-kernel

Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

Fixed ethoc_set_mac_address() to check if the given mac
address is valid and set also dev_addr of the net_device.
Check also the return value of ethoc_set_mac_address() in
ethoc_probe().

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: set net_device->dev_addr in ethoc_set_mac_address(),
    check if given address is valid

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/ethoc.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 60f0e78..cfc0ce0 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -776,10 +776,16 @@ static int ethoc_set_mac_address(struct net_device *dev, void *addr)
 	struct ethoc *priv = netdev_priv(dev);
 	u8 *mac = (u8 *)addr;
 
+	if(!is_valid_ether_addr(mac))
+		return -EADDRNOTAVAIL;
+        
 	ethoc_write(priv, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
 				     (mac[4] <<  8) | (mac[5] <<  0));
 	ethoc_write(priv, MAC_ADDR1, (mac[0] <<  8) | (mac[1] <<  0));
 
+	memcpy(dev->dev_addr, mac, ETH_ALEN);
+	dev->addr_assign_type &= ~NET_ADDR_RANDOM;
+
 	return 0;
 }
 
@@ -909,6 +915,7 @@ static int __devinit ethoc_probe(struct platform_device *pdev)
 	unsigned int phy;
 	int num_bd;
 	int ret = 0;
+	bool random_mac = false;
 
 	/* allocate networking device */
 	netdev = alloc_etherdev(sizeof(struct ethoc));
@@ -1050,10 +1057,19 @@ static int __devinit ethoc_probe(struct platform_device *pdev)
 
 	/* Check the MAC again for validity, if it still isn't choose and
 	 * program a random one. */
-	if (!is_valid_ether_addr(netdev->dev_addr))
+	if (!is_valid_ether_addr(netdev->dev_addr)) {
 		random_ether_addr(netdev->dev_addr);
+		random_mac = true;
+	}
 
-	ethoc_set_mac_address(netdev, netdev->dev_addr);
+	ret = ethoc_set_mac_address(netdev, netdev->dev_addr);
+	if (ret) {
+		dev_err(&netdev->dev, "failed to set MAC address\n");
+		goto error;
+	}
+	
+	if (random_mac)
+		netdev->addr_assign_type |= NET_ADDR_RANDOM;
 
 	/* register MII bus */
 	priv->mdio = mdiobus_alloc();
-- 
1.7.8.3

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

* [PATCH v2 09/10] atheros eth: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
                   ` (7 preceding siblings ...)
  2012-02-17 15:43 ` [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
@ 2012-02-17 15:43 ` Danny Kukawka
  2012-02-17 21:02   ` David Miller
  8 siblings, 1 reply; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: Jay Cliburn
  Cc: Danny Kukawka, Chris Snook, David S. Miller, Jeff Kirsher, netdev,
	linux-kernel

Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

Fix error handling in atl1c_probe(). If atl1c_read_mac_addr()
couldn't get the hw mac address, and a random mac address get
set return the error code. Don't go to err_eeprom in
atl1c_probe(), use the generated MAC address in this case.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: use bitops

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/atheros/atl1c/atl1c_hw.c   |    2 +-
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c |    9 ++++-----
 drivers/net/ethernet/atheros/atlx/atl1.c        |   12 +++++++++---
 drivers/net/ethernet/atheros/atlx/atlx.c        |    1 +
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
index 23f2ab0..bd1667c 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
@@ -224,7 +224,7 @@ int atl1c_read_mac_addr(struct atl1c_hw *hw)
 		random_ether_addr(hw->perm_mac_addr);
 
 	memcpy(hw->mac_addr, hw->perm_mac_addr, sizeof(hw->perm_mac_addr));
-	return 0;
+	return err;
 }
 
 /*
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index b859124..1e4e645 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -468,6 +468,7 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
 	memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
+	netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	atl1c_hw_set_mac_addr(&adapter->hw);
 
@@ -2746,10 +2747,9 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
 		err = -EIO;
 		goto err_reset;
 	}
-	if (atl1c_read_mac_addr(&adapter->hw) != 0) {
-		err = -EIO;
-		dev_err(&pdev->dev, "get mac address failed\n");
-		goto err_eeprom;
+	if (atl1c_read_mac_addr(&adapter->hw)) {
+		/* got a random MAC address, set NET_ADDR_RANDOM to netdev */
+		netdev->addr_assign_type |= NET_ADDR_RANDOM;
 	}
 	memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
 	memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len);
@@ -2774,7 +2774,6 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
 err_reset:
 err_register:
 err_sw_init:
-err_eeprom:
 	iounmap(adapter->hw.hw_addr);
 err_init_netdev:
 err_ioremap:
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 9bd2049..40ac414 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -534,14 +534,17 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
  */
 static s32 atl1_read_mac_addr(struct atl1_hw *hw)
 {
+	s32 ret = 0;
 	u16 i;
 
-	if (atl1_get_permanent_address(hw))
+	if (atl1_get_permanent_address(hw)) {
 		random_ether_addr(hw->perm_mac_addr);
+		ret = 1;
+	}
 
 	for (i = 0; i < ETH_ALEN; i++)
 		hw->mac_addr[i] = hw->perm_mac_addr[i];
-	return 0;
+	return ret;
 }
 
 /*
@@ -3007,7 +3010,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
 	}
 
 	/* copy the MAC address out of the EEPROM */
-	atl1_read_mac_addr(&adapter->hw);
+	if (atl1_read_mac_addr(&adapter->hw)) {
+		/* mark random mac */
+		netdev->addr_assign_type |= NET_ADDR_RANDOM;
+	}
 	memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
 
 	if (!is_valid_ether_addr(netdev->dev_addr)) {
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c
index 8ff7411..3cd8837 100644
--- a/drivers/net/ethernet/atheros/atlx/atlx.c
+++ b/drivers/net/ethernet/atheros/atlx/atlx.c
@@ -84,6 +84,7 @@ static int atlx_set_mac(struct net_device *netdev, void *p)
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
 	memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
+	netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	atlx_set_mac_addr(&adapter->hw);
 	return 0;
-- 
1.7.8.3

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

* Re: [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 ` [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
@ 2012-02-17 20:59   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 20:59 UTC (permalink / raw)
  To: danny.kukawka
  Cc: dkukawka, jeffrey.t.kirsher, jpirko, mcuos.com, netdev,
	linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:22 +0100

> Use eth_hw_addr_random() instead of calling random_ether_addr()
> to set addr_assign_type correctly to NET_ADDR_RANDOM.
> 
> v2: adapt to eth_hw_addr_random()
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Please don't shit up the comments:

> -	/* set a random MAC now in case platform_data doesn't provide one */
 ...
> +			/*set a random MAC since no valid provided by platform_data*/

You had to work to make that comment look worse than it originally
did in the code, spaces around the sentence and if you can be so
bothered capitalize sentences and put proper punctionation at the
end.

I took care of this, but I will not next time.

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

* Re: [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 ` [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used Danny Kukawka
@ 2012-02-17 21:00   ` David Miller
  2012-02-17 21:24     ` Danny Kukawka
  0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2012-02-17 21:00 UTC (permalink / raw)
  To: danny.kukawka
  Cc: dkukawka, blogic, ralf, jeffrey.t.kirsher, netdev, linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:23 +0100

> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> a random MAC address was generated and assigned to the netdevice.
> 
> v2: added comment, renamed bool variable to random_mac
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

More bad comment formatting.

> +	/*set addr_assign_type here, ltq_etop_set_mac_address would reset it*/

Again, I fixed it up but I will not next time.

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

* Re: [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 ` [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
@ 2012-02-17 21:00   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:00 UTC (permalink / raw)
  To: danny.kukawka
  Cc: dkukawka, richard.cochran, julia, s.hauer, joe, netdev,
	linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:24 +0100

> Use eth_hw_addr_random() instead of calling random_ether_addr()
> to set addr_assign_type correctly to NET_ADDR_RANDOM.
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> Remove one memcpy from emac_dev_setmac_addr() since this is a
> duplicate: it's already done some lines above.
> 
> v2: use bitops, adapt to eth_hw_addr_random, remove a memcpy
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Applied.

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

* Re: [PATCH v2 04/10] xilinx ll_temac: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 ` [PATCH v2 04/10] xilinx ll_temac: " Danny Kukawka
@ 2012-02-17 21:00   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:00 UTC (permalink / raw)
  To: danny.kukawka
  Cc: dkukawka, sfr, ricardo.ribalda, thomas, richard.cochran, netdev,
	linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:25 +0100

> Use eth_hw_addr_random() instead of calling random_ether_addr()
> to set addr_assign_type correctly to NET_ADDR_RANDOM.
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> v2: reworked to prevent using an extra variable
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Applied, but:

> +	else 

Trailing whitespace.  This isn't something you need to be a rocket
scientist to catch, the tools find it for you, as they did for me.

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

* Re: [PATCH v2 05/10] igbvf: reset netdevice addr_assign_type if changed
  2012-02-17 15:43 ` [PATCH v2 05/10] igbvf: reset netdevice addr_assign_type if changed Danny Kukawka
@ 2012-02-17 21:01   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:01 UTC (permalink / raw)
  To: danny.kukawka
  Cc: e1000-devel, dkukawka, bruce.w.allan, jesse.brandeburg,
	linux-kernel, john.ronciak, netdev

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:26 +0100

> Reset the state of addr_assign_type to NET_ADDR_PERM as soon as
> the MAC get changed via .ndo_set_mac_address.
> 
> v2: use bitops to reset addr_assign_type
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Applied.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

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

* Re: [PATCH v2 06/10] batman-adv: use eth_hw_addr_random() instead of random_ether_addr()
       [not found]     ` <1329493411-25750-7-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
@ 2012-02-17 21:01       ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:01 UTC (permalink / raw)
  To: danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	dkukawka-l3A5Bk7waGM, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	siwu-MaAgPAbsBIVS8oHt8HbXEIQuADTiUCJX, lindner_marek-LWAfsSFWpa4

From: Danny Kukawka <danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
Date: Fri, 17 Feb 2012 16:43:27 +0100

> Use eth_hw_addr_random() instead of calling random_ether_addr()
> to set addr_assign_type correctly to NET_ADDR_RANDOM.
> 
> Remove dev_addr in interface_setup(), it's not needed anymore.
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> v2: use bitops, adapt to eth_hw_addr_random()
> 
> Signed-off-by: Danny Kukawka <danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>

Applied.

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

* Re: [PATCH v2 07/10] cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 15:43 ` [PATCH v2 07/10] cisco/enic: " Danny Kukawka
@ 2012-02-17 21:01   ` David Miller
  2012-02-17 21:35     ` Danny Kukawka
  0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2012-02-17 21:01 UTC (permalink / raw)
  To: danny.kukawka; +Cc: benve, dkukawka, roprabhu, dwang2, netdev, linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:28 +0100

> Use dev_hw_addr_random() instead of calling random_ether_addr()
> to set addr_assign_type correctly to NET_ADDR_RANDOM.
> 
> Couldn't replace random_ether_addr() in enic_probe() since
> enic_set_mac_addr() is used which would reset addr_assign_type.
> Instead set addr_assign_type directly to NET_ADDR_RANDOM in
> case of random mac after call enic_set_mac_addr().
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> v2: use bitops, adapt to eth_hw_addr_random(), add a comment
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

This patch doesn't apply at all to the current net-next tree,
please always validate that your patches actually apply to the
tree before submission.

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

* Re: [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 ` [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
@ 2012-02-17 21:02   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:02 UTC (permalink / raw)
  To: danny.kukawka
  Cc: dkukawka, adobriyan, paul.gortmaker, richard.cochran, jkosina,
	netdev, linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:29 +0100

> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> a random MAC address was generated and assigned to the netdevice.
> 
> Fixed ethoc_set_mac_address() to check if the given mac
> address is valid and set also dev_addr of the net_device.
> Check also the return value of ethoc_set_mac_address() in
> ethoc_probe().
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> v2: set net_device->dev_addr in ethoc_set_mac_address(),
>     check if given address is valid
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Applied, but more coding style problems:

> +	if(!is_valid_ether_addr(mac))

Come on, "if[SPACE](..." always.

> +        

Trailing whitespace.

> +	if (ret) {
> +		dev_err(&netdev->dev, "failed to set MAC address\n");
> +		goto error;
> +	}
> +	

More tailing whitespace.

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

* Re: [PATCH v2 09/10] atheros eth: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 ` [PATCH v2 09/10] atheros eth: " Danny Kukawka
@ 2012-02-17 21:02   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2012-02-17 21:02 UTC (permalink / raw)
  To: danny.kukawka
  Cc: jcliburn, dkukawka, chris.snook, jeffrey.t.kirsher, netdev,
	linux-kernel

From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Fri, 17 Feb 2012 16:43:30 +0100

> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> a random MAC address was generated and assigned to the netdevice.
> 
> Fix error handling in atl1c_probe(). If atl1c_read_mac_addr()
> couldn't get the hw mac address, and a random mac address get
> set return the error code. Don't go to err_eeprom in
> atl1c_probe(), use the generated MAC address in this case.
> 
> Reset the state to NET_ADDR_PERM as soon as the MAC get
> changed via .ndo_set_mac_address.
> 
> v2: use bitops
> 
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>

Applied.

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

* Re: [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used
  2012-02-17 21:00   ` David Miller
@ 2012-02-17 21:24     ` Danny Kukawka
  0 siblings, 0 replies; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 21:24 UTC (permalink / raw)
  To: David Miller; +Cc: blogic, ralf, jeffrey.t.kirsher, netdev, linux-kernel

On Freitag, 17. Februar 2012, David Miller wrote:
> From: Danny Kukawka <danny.kukawka@bisect.de>
> Date: Fri, 17 Feb 2012 16:43:23 +0100
>
> > Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> > a random MAC address was generated and assigned to the netdevice.
> >
> > v2: added comment, renamed bool variable to random_mac
> >
> > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
>
> More bad comment formatting.
>
> > +	/*set addr_assign_type here, ltq_etop_set_mac_address would reset it*/
>
> Again, I fixed it up but I will not next time.

Thanks. I fixed it but accidently send the unfixed version of the patches 
without noticing. Sorry.

Danny

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

* Re: [PATCH v2 07/10] cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
  2012-02-17 21:01   ` David Miller
@ 2012-02-17 21:35     ` Danny Kukawka
  0 siblings, 0 replies; 21+ messages in thread
From: Danny Kukawka @ 2012-02-17 21:35 UTC (permalink / raw)
  To: David Miller; +Cc: benve, roprabhu, dwang2, netdev, linux-kernel

On Freitag, 17. Februar 2012, David Miller wrote:
> From: Danny Kukawka <danny.kukawka@bisect.de>
> Date: Fri, 17 Feb 2012 16:43:28 +0100
>
> > Use dev_hw_addr_random() instead of calling random_ether_addr()
> > to set addr_assign_type correctly to NET_ADDR_RANDOM.
> >
> > Couldn't replace random_ether_addr() in enic_probe() since
> > enic_set_mac_addr() is used which would reset addr_assign_type.
> > Instead set addr_assign_type directly to NET_ADDR_RANDOM in
> > case of random mac after call enic_set_mac_addr().
> >
> > Reset the state to NET_ADDR_PERM as soon as the MAC get
> > changed via .ndo_set_mac_address.
> >
> > v2: use bitops, adapt to eth_hw_addr_random(), add a comment
> >
> > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
>
> This patch doesn't apply at all to the current net-next tree,
> please always validate that your patches actually apply to the
> tree before submission.

Okay ... forgot that ... I'll check and send a new version.

Danny

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

end of thread, other threads:[~2012-02-17 21:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 15:43 [PATCH v2 00/10] Part 4: handle addr_assign_type for random addresses Danny Kukawka
2012-02-17 15:43 ` [PATCH v2 01/10] au1000_eth: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-17 20:59   ` David Miller
2012-02-17 15:43 ` [PATCH 02/10] lantiq_etop: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-17 21:00   ` David Miller
2012-02-17 21:24     ` Danny Kukawka
2012-02-17 15:43 ` [PATCH v2 03/10] davinci_emac: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-17 21:00   ` David Miller
2012-02-17 15:43 ` [PATCH v2 04/10] xilinx ll_temac: " Danny Kukawka
2012-02-17 21:00   ` David Miller
2012-02-17 15:43 ` [PATCH v2 05/10] igbvf: reset netdevice addr_assign_type if changed Danny Kukawka
2012-02-17 21:01   ` David Miller
     [not found] ` <1329493411-25750-1-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
2012-02-17 15:43   ` [PATCH v2 06/10] batman-adv: use eth_hw_addr_random() instead of random_ether_addr() Danny Kukawka
     [not found]     ` <1329493411-25750-7-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
2012-02-17 21:01       ` David Miller
2012-02-17 15:43 ` [PATCH v2 07/10] cisco/enic: " Danny Kukawka
2012-02-17 21:01   ` David Miller
2012-02-17 21:35     ` Danny Kukawka
2012-02-17 15:43 ` [PATCH v2 08/10] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-17 21:02   ` David Miller
2012-02-17 15:43 ` [PATCH v2 09/10] atheros eth: " Danny Kukawka
2012-02-17 21:02   ` 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).