Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e37b8d931936f88e4b2af66304eb44e69510b86c
Commit:     e37b8d931936f88e4b2af66304eb44e69510b86c
Parent:     2653a47b8953f500be13207bdcbcfe803bc40c88
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 9 14:01:49 2006 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Dec 11 14:34:36 2006 -0800

    [NETPOLL]: Make sure TX lock is taken with BH disabled.
    
    Acked-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 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 8a27128..156d7fd 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)
 
        /* 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) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to