diff options
Diffstat (limited to 'Documentation/networking/netdevices.txt')
-rw-r--r-- | Documentation/networking/netdevices.txt | 27 |
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 | ||
48 | struct net_device synchronization rules | 48 | struct net_device synchronization rules |
49 | ======================================= | 49 | ======================================= |
50 | ndo_open: | 50 | dev->open: |
51 | Synchronization: rtnl_lock() semaphore. | 51 | Synchronization: rtnl_lock() semaphore. |
52 | Context: process | 52 | Context: process |
53 | 53 | ||
54 | ndo_stop: | 54 | dev->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 | ||
59 | ndo_do_ioctl: | 60 | dev->do_ioctl: |
60 | Synchronization: rtnl_lock() semaphore. | 61 | Synchronization: rtnl_lock() semaphore. |
61 | Context: process | 62 | Context: process |
62 | 63 | ||
63 | ndo_get_stats: | 64 | dev->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 | ||
67 | ndo_start_xmit: | 68 | dev->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 | ||
89 | ndo_tx_timeout: | 90 | dev->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 | ||
94 | ndo_set_rx_mode: | 95 | dev->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 | ||
98 | struct napi_struct synchronization rules | 99 | struct napi_struct synchronization rules |
99 | ======================================== | 100 | ======================================== |
100 | napi->poll: | 101 | napi->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. |