aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking/netdevices.txt
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-07-08 01:59:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:18:46 -0400
commit1722933323b70f44b0548131604f1f3454c2aa8f (patch)
treeb0abfaae2f0b3f5c2a13de3fbd629c3331193c17 /Documentation/networking/netdevices.txt
parent963bd949b12158d9b5380b718b31c4b33372ed73 (diff)
[NET]: netdevice locking assumptions documentation
Update the documentation about locking assumptions. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking/netdevices.txt')
-rw-r--r--Documentation/networking/netdevices.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index ce1361f95243..a6cab674b676 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -20,7 +20,6 @@ private data which gets freed when the network device is freed. If
20separately allocated data is attached to the network device 20separately allocated data is attached to the network device
21(dev->priv) then it is up to the module exit handler to free that. 21(dev->priv) then it is up to the module exit handler to free that.
22 22
23
24struct net_device synchronization rules 23struct net_device synchronization rules
25======================================= 24=======================================
26dev->open: 25dev->open:
@@ -43,16 +42,17 @@ dev->get_stats:
43 42
44dev->hard_start_xmit: 43dev->hard_start_xmit:
45 Synchronization: netif_tx_lock spinlock. 44 Synchronization: netif_tx_lock spinlock.
45
46 When the driver sets NETIF_F_LLTX in dev->features this will be 46 When the driver sets NETIF_F_LLTX in dev->features this will be
47 called without holding netif_tx_lock. In this case the driver 47 called without holding netif_tx_lock. In this case the driver
48 has to lock by itself when needed. It is recommended to use a try lock 48 has to lock by itself when needed. It is recommended to use a try lock
49 for this and return -1 when the spin lock fails. 49 for this and return NETDEV_TX_LOCKED when the spin lock fails.
50 The locking there should also properly protect against 50 The locking there should also properly protect against
51 set_multicast_list 51 set_multicast_list.
52 Context: Process with BHs disabled or BH (timer). 52
53 Notes: netif_queue_stopped() is guaranteed false 53 Context: Process with BHs disabled or BH (timer),
54 Interrupts must be enabled when calling hard_start_xmit. 54 will be called with interrupts disabled by netconsole.
55 (Interrupts must also be enabled when enabling the BH handler.) 55
56 Return codes: 56 Return codes:
57 o NETDEV_TX_OK everything ok. 57 o NETDEV_TX_OK everything ok.
58 o NETDEV_TX_BUSY Cannot transmit packet, try later 58 o NETDEV_TX_BUSY Cannot transmit packet, try later
@@ -74,4 +74,5 @@ dev->poll:
74 Synchronization: __LINK_STATE_RX_SCHED bit in dev->state. See 74 Synchronization: __LINK_STATE_RX_SCHED bit in dev->state. See
75 dev_close code and comments in net/core/dev.c for more info. 75 dev_close code and comments in net/core/dev.c for more info.
76 Context: softirq 76 Context: softirq
77 will be called with interrupts disabled by netconsole.
77 78