Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41658
b: refs/heads/master
c: 6c43ff1
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Dec 3, 2006
1 parent 88d1fa8 commit 0b09503
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b41848b61bae30e3661efd4ec62ea380cedef687
refs/heads/master: 6c43ff18f91e54aa7555d8ae4f26eab7da5bce68
21 changes: 19 additions & 2 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,25 @@ static void queue_process(void *p)
struct netpoll_info *npinfo = p;
struct sk_buff *skb;

while ((skb = skb_dequeue(&npinfo->txq)))
dev_queue_xmit(skb);
while ((skb = skb_dequeue(&npinfo->txq))) {
struct net_device *dev = skb->dev;

if (!netif_device_present(dev) || !netif_running(dev)) {
__kfree_skb(skb);
continue;
}

netif_tx_lock_bh(dev);
if (netif_queue_stopped(dev) ||
dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
skb_queue_head(&npinfo->txq, skb);
netif_tx_unlock_bh(dev);

schedule_delayed_work(&npinfo->tx_work, HZ/10);
return;
}
netif_tx_unlock_bh(dev);
}
}

void netpoll_queue(struct sk_buff *skb)
Expand Down Expand Up @@ -765,6 +781,7 @@ void netpoll_cleanup(struct netpoll *np)
if (atomic_dec_and_test(&npinfo->refcnt)) {
skb_queue_purge(&npinfo->arp_tx);
skb_queue_purge(&npinfo->txq);
cancel_rearming_delayed_work(&npinfo->tx_work);
flush_scheduled_work();

kfree(npinfo);
Expand Down

0 comments on commit 0b09503

Please sign in to comment.