aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 4160db3721ba..14fbb04c459d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1026,7 +1026,7 @@ struct net_device {
1026 struct timer_list watchdog_timer; 1026 struct timer_list watchdog_timer;
1027 1027
1028 /* Number of references to this device */ 1028 /* Number of references to this device */
1029 atomic_t refcnt ____cacheline_aligned_in_smp; 1029 int __percpu *pcpu_refcnt;
1030 1030
1031 /* delayed register/unregister */ 1031 /* delayed register/unregister */
1032 struct list_head todo_list; 1032 struct list_head todo_list;
@@ -1330,6 +1330,7 @@ static inline void unregister_netdevice(struct net_device *dev)
1330 unregister_netdevice_queue(dev, NULL); 1330 unregister_netdevice_queue(dev, NULL);
1331} 1331}
1332 1332
1333extern int netdev_refcnt_read(const struct net_device *dev);
1333extern void free_netdev(struct net_device *dev); 1334extern void free_netdev(struct net_device *dev);
1334extern void synchronize_net(void); 1335extern void synchronize_net(void);
1335extern int register_netdevice_notifier(struct notifier_block *nb); 1336extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -1798,7 +1799,7 @@ extern void netdev_run_todo(void);
1798 */ 1799 */
1799static inline void dev_put(struct net_device *dev) 1800static inline void dev_put(struct net_device *dev)
1800{ 1801{
1801 atomic_dec(&dev->refcnt); 1802 irqsafe_cpu_dec(*dev->pcpu_refcnt);
1802} 1803}
1803 1804
1804/** 1805/**
@@ -1809,7 +1810,7 @@ static inline void dev_put(struct net_device *dev)
1809 */ 1810 */
1810static inline void dev_hold(struct net_device *dev) 1811static inline void dev_hold(struct net_device *dev)
1811{ 1812{
1812 atomic_inc(&dev->refcnt); 1813 irqsafe_cpu_inc(*dev->pcpu_refcnt);
1813} 1814}
1814 1815
1815/* Carrier loss detection, dial on demand. The functions netif_carrier_on 1816/* Carrier loss detection, dial on demand. The functions netif_carrier_on