aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking/netdevices.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/networking/netdevices.txt')
-rw-r--r--Documentation/networking/netdevices.txt27
1 files changed, 14 insertions, 13 deletions
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index c7ecc708049..87b3d15f523 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -47,32 +47,33 @@ packets is preferred.
47 47
48struct net_device synchronization rules 48struct net_device synchronization rules
49======================================= 49=======================================
50ndo_open: 50dev->open:
51 Synchronization: rtnl_lock() semaphore. 51 Synchronization: rtnl_lock() semaphore.
52 Context: process 52 Context: process
53 53
54ndo_stop: 54dev->stop:
55 Synchronization: rtnl_lock() semaphore. 55 Synchronization: rtnl_lock() semaphore.
56 Context: process 56 Context: process
57 Note: netif_running() is guaranteed false 57 Note1: netif_running() is guaranteed false
58 Note2: dev->poll() is guaranteed to be stopped
58 59
59ndo_do_ioctl: 60dev->do_ioctl:
60 Synchronization: rtnl_lock() semaphore. 61 Synchronization: rtnl_lock() semaphore.
61 Context: process 62 Context: process
62 63
63ndo_get_stats: 64dev->get_stats:
64 Synchronization: dev_base_lock rwlock. 65 Synchronization: dev_base_lock rwlock.
65 Context: nominally process, but don't sleep inside an rwlock 66 Context: nominally process, but don't sleep inside an rwlock
66 67
67ndo_start_xmit: 68dev->hard_start_xmit:
68 Synchronization: __netif_tx_lock spinlock. 69 Synchronization: netif_tx_lock spinlock.
69 70
70 When the driver sets NETIF_F_LLTX in dev->features this will be 71 When the driver sets NETIF_F_LLTX in dev->features this will be
71 called without holding netif_tx_lock. In this case the driver 72 called without holding netif_tx_lock. In this case the driver
72 has to lock by itself when needed. It is recommended to use a try lock 73 has to lock by itself when needed. It is recommended to use a try lock
73 for this and return NETDEV_TX_LOCKED when the spin lock fails. 74 for this and return NETDEV_TX_LOCKED when the spin lock fails.
74 The locking there should also properly protect against 75 The locking there should also properly protect against
75 set_rx_mode. Note that the use of NETIF_F_LLTX is deprecated. 76 set_multicast_list. Note that the use of NETIF_F_LLTX is deprecated.
76 Don't use it for new drivers. 77 Don't use it for new drivers.
77 78
78 Context: Process with BHs disabled or BH (timer), 79 Context: Process with BHs disabled or BH (timer),
@@ -86,20 +87,20 @@ ndo_start_xmit:
86 o NETDEV_TX_LOCKED Locking failed, please retry quickly. 87 o NETDEV_TX_LOCKED Locking failed, please retry quickly.
87 Only valid when NETIF_F_LLTX is set. 88 Only valid when NETIF_F_LLTX is set.
88 89
89ndo_tx_timeout: 90dev->tx_timeout:
90 Synchronization: netif_tx_lock spinlock; all TX queues frozen. 91 Synchronization: netif_tx_lock spinlock.
91 Context: BHs disabled 92 Context: BHs disabled
92 Notes: netif_queue_stopped() is guaranteed true 93 Notes: netif_queue_stopped() is guaranteed true
93 94
94ndo_set_rx_mode: 95dev->set_multicast_list:
95 Synchronization: netif_addr_lock spinlock. 96 Synchronization: netif_tx_lock spinlock.
96 Context: BHs disabled 97 Context: BHs disabled
97 98
98struct napi_struct synchronization rules 99struct napi_struct synchronization rules
99======================================== 100========================================
100napi->poll: 101napi->poll:
101 Synchronization: NAPI_STATE_SCHED bit in napi->state. Device 102 Synchronization: NAPI_STATE_SCHED bit in napi->state. Device
102 driver's ndo_stop method will invoke napi_disable() on 103 driver's dev->close method will invoke napi_disable() on
103 all NAPI instances which will do a sleeping poll on the 104 all NAPI instances which will do a sleeping poll on the
104 NAPI_STATE_SCHED napi->state bit, waiting for all pending 105 NAPI_STATE_SCHED napi->state bit, waiting for all pending
105 NAPI activity to cease. 106 NAPI activity to cease.