diff options
author | Andrew Morton <akpm@osdl.org> | 2006-12-09 17:01:49 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-11 17:34:36 -0500 |
commit | e37b8d931936f88e4b2af66304eb44e69510b86c (patch) | |
tree | 3d4dc0521dab807f11b107db494e8c0f24eeba00 | |
parent | 2653a47b8953f500be13207bdcbcfe803bc40c88 (diff) |
[NETPOLL]: Make sure TX lock is taken with BH disabled.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/netpoll.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 8a271285f2f3..156d7fd81fec 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -242,22 +242,26 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
242 | 242 | ||
243 | /* don't get messages out of order, and no recursion */ | 243 | /* don't get messages out of order, and no recursion */ |
244 | if (skb_queue_len(&npinfo->txq) == 0 && | 244 | if (skb_queue_len(&npinfo->txq) == 0 && |
245 | npinfo->poll_owner != smp_processor_id() && | 245 | npinfo->poll_owner != smp_processor_id()) { |
246 | netif_tx_trylock(dev)) { | 246 | local_bh_disable(); /* Where's netif_tx_trylock_bh()? */ |
247 | /* try until next clock tick */ | 247 | if (netif_tx_trylock(dev)) { |
248 | for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; tries > 0; --tries) { | 248 | /* try until next clock tick */ |
249 | if (!netif_queue_stopped(dev)) | 249 | for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; |
250 | status = dev->hard_start_xmit(skb, dev); | 250 | tries > 0; --tries) { |
251 | 251 | if (!netif_queue_stopped(dev)) | |
252 | if (status == NETDEV_TX_OK) | 252 | status = dev->hard_start_xmit(skb, dev); |
253 | break; | 253 | |
254 | 254 | if (status == NETDEV_TX_OK) | |
255 | /* tickle device maybe there is some cleanup */ | 255 | break; |
256 | netpoll_poll(np); | 256 | |
257 | 257 | /* tickle device maybe there is some cleanup */ | |
258 | udelay(USEC_PER_POLL); | 258 | netpoll_poll(np); |
259 | |||
260 | udelay(USEC_PER_POLL); | ||
261 | } | ||
262 | netif_tx_unlock(dev); | ||
259 | } | 263 | } |
260 | netif_tx_unlock(dev); | 264 | local_bh_enable(); |
261 | } | 265 | } |
262 | 266 | ||
263 | if (status != NETDEV_TX_OK) { | 267 | if (status != NETDEV_TX_OK) { |