linux-um archives
 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 10/10] UML net: set addr_assign_type if random_ether_addr() used Danny Kukawka
  0 siblings, 1 reply; 5+ 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, Richard Cochran,
	Jiri Kosina, linux-kernel, netdev, e1000-devel, b.a.t.m.a.n,
	user-mode-linux-devel

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


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

* [PATCH 10/10] UML net: 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 ` Danny Kukawka
  2012-02-17 15:55   ` Richard Weinberger
  2012-02-17 21:05   ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Danny Kukawka @ 2012-02-17 15:43 UTC (permalink / raw)
  To: Jeff Dike
  Cc: Danny Kukawka, Richard Weinberger, Andrew Morton, David S. Miller,
	Jiri Pirko, user-mode-linux-devel, linux-kernel

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

Return state from setup_etheraddr() about returning a random
MAC address or not and check this state in eth_configure().

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 arch/um/drivers/net_kern.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index a492e59..d299618 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -293,7 +293,7 @@ static void uml_net_user_timer_expire(unsigned long _conn)
 #endif
 }
 
-static void setup_etheraddr(char *str, unsigned char *addr, char *name)
+static int setup_etheraddr(char *str, unsigned char *addr, char *name)
 {
 	char *end;
 	int i;
@@ -334,12 +334,13 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name)
 		       addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
 		       addr[5]);
 	}
-	return;
+	return 0;
 
 random:
 	printk(KERN_INFO
 	       "Choosing a random ethernet address for device %s\n", name);
 	random_ether_addr(addr);
+	return 1;
 }
 
 static DEFINE_SPINLOCK(devices_lock);
@@ -391,6 +392,7 @@ static void eth_configure(int n, void *init, char *mac,
 	struct net_device *dev;
 	struct uml_net_private *lp;
 	int err, size;
+	int random_mac;
 
 	size = transport->private_size + sizeof(struct uml_net_private);
 
@@ -417,7 +419,7 @@ static void eth_configure(int n, void *init, char *mac,
 	 */
 	snprintf(dev->name, sizeof(dev->name), "eth%d", n);
 
-	setup_etheraddr(mac, device->mac, dev->name);
+	random_mac = setup_etheraddr(mac, device->mac, dev->name);
 
 	printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);
 
@@ -474,6 +476,9 @@ static void eth_configure(int n, void *init, char *mac,
 
 	/* don't use eth_mac_addr, it will not work here */
 	memcpy(dev->dev_addr, device->mac, ETH_ALEN);
+	if (random_mac)
+		dev->addr_assign_type |= NET_ADDR_RANDOM;
+
 	dev->mtu = transport->user->mtu;
 	dev->netdev_ops = &uml_netdev_ops;
 	dev->ethtool_ops = &uml_net_ethtool_ops;
-- 
1.7.8.3


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

* Re: [PATCH 10/10] UML net: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 ` [PATCH 10/10] UML net: set addr_assign_type if random_ether_addr() used Danny Kukawka
@ 2012-02-17 15:55   ` Richard Weinberger
  2012-02-17 20:17     ` [uml-devel] " David Miller
  2012-02-17 21:05   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2012-02-17 15:55 UTC (permalink / raw)
  To: Danny Kukawka
  Cc: Jeff Dike, Danny Kukawka, Andrew Morton, David S. Miller,
	Jiri Pirko, user-mode-linux-devel, linux-kernel

On 17.02.2012 16:43, Danny Kukawka wrote:
> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> a random MAC address was generated and assigned to the netdevice.
>
> Return state from setup_etheraddr() about returning a random
> MAC address or not and check this state in eth_configure().
>
> Signed-off-by: Danny Kukawka<danny.kukawka@bisect.de>

Acked-by: Richard Weinberger <richard@nod.at>

Do you want me to pick up this patch or is it supposed to go though the 
net tree?

Thanks,
//richard

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

* Re: [uml-devel] [PATCH 10/10] UML net: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:55   ` Richard Weinberger
@ 2012-02-17 20:17     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-02-17 20:17 UTC (permalink / raw)
  To: richard
  Cc: user-mode-linux-devel, jpirko, jdike, dkukawka, linux-kernel,
	danny.kukawka, akpm

From: Richard Weinberger <richard@nod.at>
Date: Fri, 17 Feb 2012 16:55:41 +0100

> On 17.02.2012 16:43, Danny Kukawka wrote:
>> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
>> a random MAC address was generated and assigned to the netdevice.
>>
>> Return state from setup_etheraddr() about returning a random
>> MAC address or not and check this state in eth_configure().
>>
>> Signed-off-by: Danny Kukawka<danny.kukawka@bisect.de>
> 
> Acked-by: Richard Weinberger <richard@nod.at>
> 
> Do you want me to pick up this patch or is it supposed to go though
> the net tree?

I'll take care of it.

------------------------------------------------------------------------------
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/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


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

* Re: [uml-devel] [PATCH 10/10] UML net: set addr_assign_type if random_ether_addr() used
  2012-02-17 15:43 ` [PATCH 10/10] UML net: set addr_assign_type if random_ether_addr() used Danny Kukawka
  2012-02-17 15:55   ` Richard Weinberger
@ 2012-02-17 21:05   ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2012-02-17 21:05 UTC (permalink / raw)
  To: danny.kukawka
  Cc: user-mode-linux-devel, jpirko, richard, jdike, dkukawka,
	linux-kernel, akpm

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

> Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> a random MAC address was generated and assigned to the netdevice.
> 
> Return state from setup_etheraddr() about returning a random
> MAC address or not and check this state in eth_configure().
> 
> 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/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


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

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

Thread overview: 5+ 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 10/10] UML net: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-17 15:55   ` Richard Weinberger
2012-02-17 20:17     ` [uml-devel] " David Miller
2012-02-17 21:05   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox