[NETPOLL]: Make sure TX lock is taken with BH disabled.
authorAndrew Morton <akpm@osdl.org>
Sat, 9 Dec 2006 22:01:49 +0000 (14:01 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 11 Dec 2006 22:34:36 +0000 (14:34 -0800)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index 8a271285f2f378d154d21927790e3a31cefd42a3..156d7fd81fec1829edd5bbe178c3179db79c1005 100644 (file)
@@ -242,22 +242,26 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
 
        /* don't get messages out of order, and no recursion */
        if (skb_queue_len(&npinfo->txq) == 0 &&
-           npinfo->poll_owner != smp_processor_id() &&
-           netif_tx_trylock(dev)) {
-               /* try until next clock tick */
-               for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; tries > 0; --tries) {
-                       if (!netif_queue_stopped(dev))
-                               status = dev->hard_start_xmit(skb, dev);
-
-                       if (status == NETDEV_TX_OK)
-                               break;
-
-                       /* tickle device maybe there is some cleanup */
-                       netpoll_poll(np);
-
-                       udelay(USEC_PER_POLL);
+                   npinfo->poll_owner != smp_processor_id()) {
+               local_bh_disable();     /* Where's netif_tx_trylock_bh()? */
+               if (netif_tx_trylock(dev)) {
+                       /* try until next clock tick */
+                       for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
+                                       tries > 0; --tries) {
+                               if (!netif_queue_stopped(dev))
+                                       status = dev->hard_start_xmit(skb, dev);
+
+                               if (status == NETDEV_TX_OK)
+                                       break;
+
+                               /* tickle device maybe there is some cleanup */
+                               netpoll_poll(np);
+
+                               udelay(USEC_PER_POLL);
+                       }
+                       netif_tx_unlock(dev);
                }
-               netif_tx_unlock(dev);
+               local_bh_enable();
        }
 
        if (status != NETDEV_TX_OK) {