public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: Danny Kukawka <danny.kukawka@bisect•de>
Cc: "David S. Miller" <davem@davemloft•net>,
	netdev@vger•kernel.org, linux-kernel@vger•kernel.org
Subject: Re: [RFC][PATCH 00/50] set addr_assign_type to NET_ADDR_RANDOM if a random mac address get assigned to a netdevice
Date: Thu, 9 Feb 2012 08:06:38 -0800	[thread overview]
Message-ID: <20120209080638.7608b588@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <201202091559.06480.danny.kukawka@bisect.de>

On Thu, 9 Feb 2012 15:59:05 +0100
Danny Kukawka <danny.kukawka@bisect•de> wrote:

> On Mittwoch, 8. Februar 2012, Stephen Hemminger wrote:
> > On Wed,  8 Feb 2012 22:10:07 +0100
> >
> > Danny Kukawka <danny.kukawka@bisect•de> wrote:
> > > The information if a device has a random MAC address is exported
> > > to the userspace via /sys/class/net/*/addr_assign_type, which
> > > export net_device->addr_assign_type.
> > >
> > > Currently only a few driver really use dev_hw_addr_random() to
> > > set addr_assign_type correctly to NET_ADDR_RANDOM.
> > >
> > > This patch change the drivers which set random addresses to
> > > change also addr_assign_type to NET_ADDR_RANDOM.
> > >
> > > To reflect if the MAC was changed from userspace via SIOCSIFHWADDR,
> > > which means it's no longer a random address set by the kernel,
> > > this patch remove NET_ADDR_RANDOM from addr_assign_type in this
> > > case.
> > >
> > > With this patch tools from userspace can now detect devices with
> > > random MAC addresses and change them to persistent addresses if
> > > needed (as e.g. in case of smsc95xx on PandaBoard).
> > >
> > > Maybe it makes sense to introduce a new state for addr_assign_type
> > > to reflect the fact, that the MAC address was changed via a ioctl
> > > from user space, e.g, with NET_ADDR_USERSPACE ?
> >
> > This reminds me that passing dev->dev_addr to dev_hw_addr_rrandom is
> > redundant for all the instances you showed, so why is it ia parameter.
> 
> There are two places in the existing code where it's used in a different way 
> in ixgbevf and igbvf, but thats changeable. I will take a look at it and 
> change dev_hw_addr_random to take simply a net_device ands set everything 
> directly.
> 
> > Also it should BUG() if address length is not 6 (ETH_ALEN).
> 
> Not needed if I change it to: 
> static inline void dev_hw_addr_random(struct net_device *dev) 
> 
> Danny

It is still needed to prevent some device driver that uses
some longer address (like Infiniband) from the thinking it is
a generic routine.  Maybe even renaming int eth_hw_addr_random()

  reply	other threads:[~2012-02-09 16:06 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 21:10 [RFC][PATCH 00/50] set addr_assign_type to NET_ADDR_RANDOM if a random mac address get assigned to a netdevice Danny Kukawka
2012-02-08 21:10 ` [PATCH 01/50] eth: reset addr_assign_type if eth_mac_addr() called Danny Kukawka
2012-02-08 22:50   ` Stephen Hemminger
2012-02-08 22:57     ` Danny Kukawka
2012-02-08 21:10 ` [PATCH 02/50] smsc95xx: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-09 10:51   ` Sergei Shtylyov
2012-02-08 21:10 ` [PATCH 03/50] smsc75xx: se " Danny Kukawka
2012-02-08 21:10 ` [PATCH 04/50] adi/blackfin: set addr_assign_type correctly if random Danny Kukawka
2012-02-09  3:28   ` Bob Liu
2012-02-09  4:05   ` Mike Frysinger
2012-02-08 21:10 ` [PATCH 06/50] dummy: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 07/50] au1000_eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 08/50] bnx2x: " Danny Kukawka
2012-02-09  9:59   ` David Laight
2012-02-08 21:10 ` [PATCH 09/50] Cadence MACB: " Danny Kukawka
2012-02-09  8:24   ` Nicolas Ferre
2012-02-08 21:10 ` [PATCH 10/50] Calxeda XGMAC: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 11/50] ep93xx: " Danny Kukawka
2012-02-08 21:29   ` H Hartley Sweeten
2012-02-08 21:10 ` [PATCH 12/50] dm9000: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 13/50] dnet: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 14/50] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:10 ` [PATCH 15/50] lantiq_etop: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 16/50] pxa168_eth: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 17/50] enc28j60: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 18/50] mipsnet: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 19/50] macsonic: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 20/50] smsc911x: " Danny Kukawka
2012-02-09 11:28   ` Mark Brown
2012-02-08 21:10 ` [PATCH 21/50] smsc9420: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 22/50] r6040: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 23/50] efx: " Danny Kukawka
2012-02-08 21:29   ` Ben Hutchings
2012-02-08 21:10 ` [PATCH 24/50] sis900: " Danny Kukawka
2012-02-11  9:05   ` Daniele Venzano
2012-02-08 21:10 ` [PATCH 25/50] via-rhine: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 26/50] faraday: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 27/50] davinci_emac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 28/50] forcedeth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 29/50] micrel eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 30/50] atheros eth: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:10 ` [PATCH 31/50] tc35815: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 32/50] tile_net: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 33/50] stmmac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 34/50] xilinx ll_temac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 35/50] ifb: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 36/50] igbvf: reset netdevice addr_assign_type if changed from random Danny Kukawka
2012-02-08 21:10 ` [PATCH 37/50] usbnet: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:30   ` Oliver Neukum
2012-02-08 21:41     ` Danny Kukawka
2012-02-09  6:57     ` Bjørn Mork
2012-02-09 14:55       ` Oliver Neukum
2012-02-08 21:10 ` [PATCH 39/50] veth: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 40/50] batman-adv: " Danny Kukawka
     [not found]   ` <1328735457-29986-41-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
2012-02-09  8:44     ` Sven Eckelmann
2012-02-11 11:12     ` Marek Lindner
2012-02-08 21:10 ` [PATCH 41/50] l2tp_eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 42/50] virtio_net: " Danny Kukawka
2012-02-09  9:35   ` Michael S. Tsirkin
2012-02-08 21:10 ` [PATCH 43/50] macvlan: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 44/50] team: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 45/50] tun: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 46/50] wan: " Danny Kukawka
2012-02-09 14:12   ` Krzysztof Halasa
2012-02-08 21:10 ` [PATCH 47/50] bridge: " Danny Kukawka
2012-02-08 22:52   ` Stephen Hemminger
2012-02-08 21:10 ` [PATCH 48/50] ip_gre.c: " Danny Kukawka
     [not found] ` <1328735457-29986-1-git-send-email-danny.kukawka-2YacvwyR+KOzQB+pC5nmwQ@public.gmane.org>
2012-02-08 21:10   ` [PATCH 49/50] openvswitch: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 50/50] " Danny Kukawka
2012-02-08 22:58 ` [RFC][PATCH 00/50] set addr_assign_type to NET_ADDR_RANDOM if a random mac address get assigned to a netdevice Stephen Hemminger
2012-02-09 14:59   ` Danny Kukawka
2012-02-09 16:06     ` Stephen Hemminger [this message]
2012-02-08 23:29 ` David Miller
2012-02-09 12:18   ` Danny Kukawka
2012-02-09 18:37     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120209080638.7608b588@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta$(echo .)com \
    --cc=danny.kukawka@bisect$(echo .)de \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox