diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-30 03:11:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-02 02:55:08 -0500 |
commit | 72c9528bab94cc052d00ce241b8e85f5d71e45f0 (patch) | |
tree | fcec7a40e0242e659474a4d9f501d9213225aa55 /include/linux/netdevice.h | |
parent | 68d8287ce1e1da3c99881385a93e74f68c454fc2 (diff) |
net: Introduce dev_get_by_name_rcu()
Some workloads hit dev_base_lock rwlock pretty hard.
We can use RCU lookups to avoid touching this rwlock
(and avoid touching netdevice refcount)
netdevices are already freed after a RCU grace period, so this patch
adds no penalty at device dismantle time.
However, it adds a synchronize_rcu() call in dev_change_name()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e5ece8dceaad..bcf1083857fc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1115,6 +1115,7 @@ extern void __dev_remove_pack(struct packet_type *pt); | |||
1115 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, | 1115 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, |
1116 | unsigned short mask); | 1116 | unsigned short mask); |
1117 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); | 1117 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); |
1118 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); | ||
1118 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); | 1119 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); |
1119 | extern int dev_alloc_name(struct net_device *dev, const char *name); | 1120 | extern int dev_alloc_name(struct net_device *dev, const char *name); |
1120 | extern int dev_open(struct net_device *dev); | 1121 | extern int dev_open(struct net_device *dev); |