net: introduce a list of device addresses dev_addr_list (v6)
authorJiri Pirko <jpirko@redhat.com>
Tue, 5 May 2009 02:48:28 +0000 (02:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 May 2009 19:26:24 +0000 (12:26 -0700)
commitf001fde5eadd915f4858d22ed70d7040f48767cf
treef03fd0216b411e4a076e464861aa959e5b51edb0
parentb6907b0c705b6db221f937b4d343e2a6b280c8c5
net: introduce a list of device addresses dev_addr_list (v6)

v5 -> v6 (current):
-removed so far unused static functions
-corrected dev_addr_del_multiple to call del instead of add

v4 -> v5:
-added device address type (suggested by davem)
-removed refcounting (better to have simplier code then safe potentially few
 bytes)

v3 -> v4:
-changed kzalloc to kmalloc in __hw_addr_add_ii()
-ASSERT_RTNL() avoided in dev_addr_flush() and dev_addr_init()

v2 -> v3:
-removed unnecessary rcu read locking
-moved dev_addr_flush() calling to ensure no null dereference of dev_addr

v1 -> v2:
-added forgotten ASSERT_RTNL to dev_addr_init and dev_addr_flush
-removed unnecessary rcu_read locking in dev_addr_init
-use compare_ether_addr_64bits instead of compare_ether_addr
-use L1_CACHE_BYTES as size for allocating struct netdev_hw_addr
-use call_rcu instead of rcu_synchronize
-moved is_etherdev_addr into __KERNEL__ ifdef

This patch introduces a new list in struct net_device and brings a set of
functions to handle the work with device address list. The list is a replacement
for the original dev_addr field and because in some situations there is need to
carry several device addresses with the net device. To be backward compatible,
dev_addr is made to point to the first member of the list so original drivers
sees no difference.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/etherdevice.h
include/linux/netdevice.h
net/core/dev.c