Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200883
b: refs/heads/master
c: 58eba97
h: refs/heads/master
i:
  200881: 96c7eb5
  200879: 1d6de33
v: v3
  • Loading branch information
Rusty Russell authored and David S. Miller committed Jul 3, 2010
1 parent 33f82d5 commit 9c8e0a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: 1788f49548860fa1c861ee3454d47b466c877e43
refs/heads/master: 58eba97d0774c69b1cf3e5a8ac74419409d1abbf
21 changes: 13 additions & 8 deletions trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
struct virtnet_info *vi = netdev_priv(dev);
int capacity;

again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);

Expand All @@ -571,14 +570,20 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)

/* This can happen with OOM and indirect buffers. */
if (unlikely(capacity < 0)) {
netif_stop_queue(dev);
dev_warn(&dev->dev, "Unexpected full queue\n");
if (unlikely(!virtqueue_enable_cb(vi->svq))) {
virtqueue_disable_cb(vi->svq);
netif_start_queue(dev);
goto again;
if (net_ratelimit()) {
if (likely(capacity == -ENOMEM)) {
dev_warn(&dev->dev,
"TX queue failure: out of memory\n");
} else {
dev->stats.tx_fifo_errors++;
dev_warn(&dev->dev,
"Unexpected TX queue failure: %d\n",
capacity);
}
}
return NETDEV_TX_BUSY;
dev->stats.tx_dropped++;
kfree_skb(skb);
return NETDEV_TX_OK;
}
virtqueue_kick(vi->svq);

Expand Down

0 comments on commit 9c8e0a9

Please sign in to comment.