Commit e37b8d93 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[NETPOLL]: Make sure TX lock is taken with BH disabled.

Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2653a47b
...@@ -242,10 +242,12 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) ...@@ -242,10 +242,12 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
/* don't get messages out of order, and no recursion */ /* don't get messages out of order, and no recursion */
if (skb_queue_len(&npinfo->txq) == 0 && if (skb_queue_len(&npinfo->txq) == 0 &&
npinfo->poll_owner != smp_processor_id() && npinfo->poll_owner != smp_processor_id()) {
netif_tx_trylock(dev)) { local_bh_disable(); /* Where's netif_tx_trylock_bh()? */
if (netif_tx_trylock(dev)) {
/* try until next clock tick */ /* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; tries > 0; --tries) { for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
tries > 0; --tries) {
if (!netif_queue_stopped(dev)) if (!netif_queue_stopped(dev))
status = dev->hard_start_xmit(skb, dev); status = dev->hard_start_xmit(skb, dev);
...@@ -259,6 +261,8 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) ...@@ -259,6 +261,8 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
} }
netif_tx_unlock(dev); netif_tx_unlock(dev);
} }
local_bh_enable();
}
if (status != NETDEV_TX_OK) { if (status != NETDEV_TX_OK) {
skb_queue_tail(&npinfo->txq, skb); skb_queue_tail(&npinfo->txq, skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment