diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-19 15:18:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 04:42:55 -0400 |
commit | fb699dfd426a189fe33b91586c15176a75c8aed0 (patch) | |
tree | c90a8aadc10ac9a9e7b67b2d36ce61853917e3ba /include | |
parent | e0c5567d06ecf7777b6c46f4d933a0a6e09a44f3 (diff) |
net: Introduce dev_get_by_index_rcu()
Some workloads hit dev_base_lock rwlock pretty hard.
We can use RCU lookups to avoid touching this rwlock.
netdevices are already freed after a RCU grace period, so this patch
adds no penalty at device dismantle time.
dev_ifname() converted to dev_get_by_index_rcu()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-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 656110a46e96..ffc3106cc037 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1139,6 +1139,7 @@ extern void netdev_resync_ops(struct net_device *dev); | |||
1139 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1139 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1140 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1140 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1141 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1141 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
1142 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | ||
1142 | extern int dev_restart(struct net_device *dev); | 1143 | extern int dev_restart(struct net_device *dev); |
1143 | #ifdef CONFIG_NETPOLL_TRAP | 1144 | #ifdef CONFIG_NETPOLL_TRAP |
1144 | extern int netpoll_trap(void); | 1145 | extern int netpoll_trap(void); |