mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 05:11:46 +00:00
[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>
This commit is contained in:
parent
2653a47b89
commit
e37b8d9319
1 changed files with 16 additions and 12 deletions
|
@ -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 */
|
/* 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()? */
|
||||||
/* try until next clock tick */
|
if (netif_tx_trylock(dev)) {
|
||||||
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; tries > 0; --tries) {
|
/* try until next clock tick */
|
||||||
if (!netif_queue_stopped(dev))
|
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
|
||||||
status = dev->hard_start_xmit(skb, dev);
|
tries > 0; --tries) {
|
||||||
|
if (!netif_queue_stopped(dev))
|
||||||
|
status = dev->hard_start_xmit(skb, dev);
|
||||||
|
|
||||||
if (status == NETDEV_TX_OK)
|
if (status == NETDEV_TX_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* tickle device maybe there is some cleanup */
|
/* tickle device maybe there is some cleanup */
|
||||||
netpoll_poll(np);
|
netpoll_poll(np);
|
||||||
|
|
||||||
udelay(USEC_PER_POLL);
|
udelay(USEC_PER_POLL);
|
||||||
|
}
|
||||||
|
netif_tx_unlock(dev);
|
||||||
}
|
}
|
||||||
netif_tx_unlock(dev);
|
local_bh_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != NETDEV_TX_OK) {
|
if (status != NETDEV_TX_OK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue