diff options
-rw-r--r-- | drivers/net/virtio_net.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 54bf0912b737..d9ebac8a2d99 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -517,8 +517,7 @@ again: | |||
517 | /* Free up any pending old buffers before queueing new ones. */ | 517 | /* Free up any pending old buffers before queueing new ones. */ |
518 | free_old_xmit_skbs(vi); | 518 | free_old_xmit_skbs(vi); |
519 | 519 | ||
520 | /* Put new one in send queue and do transmit */ | 520 | /* Try to transmit */ |
521 | __skb_queue_head(&vi->send, skb); | ||
522 | capacity = xmit_skb(vi, skb); | 521 | capacity = xmit_skb(vi, skb); |
523 | 522 | ||
524 | /* This can happen with OOM and indirect buffers. */ | 523 | /* This can happen with OOM and indirect buffers. */ |
@@ -532,8 +531,17 @@ again: | |||
532 | } | 531 | } |
533 | return NETDEV_TX_BUSY; | 532 | return NETDEV_TX_BUSY; |
534 | } | 533 | } |
535 | |||
536 | vi->svq->vq_ops->kick(vi->svq); | 534 | vi->svq->vq_ops->kick(vi->svq); |
535 | |||
536 | /* | ||
537 | * Put new one in send queue. You'd expect we'd need this before | ||
538 | * xmit_skb calls add_buf(), since the callback can be triggered | ||
539 | * immediately after that. But since the callback just triggers | ||
540 | * another call back here, normal network xmit locking prevents the | ||
541 | * race. | ||
542 | */ | ||
543 | __skb_queue_head(&vi->send, skb); | ||
544 | |||
537 | /* Don't wait up for transmitted skbs to be freed. */ | 545 | /* Don't wait up for transmitted skbs to be freed. */ |
538 | skb_orphan(skb); | 546 | skb_orphan(skb); |
539 | nf_reset(skb); | 547 | nf_reset(skb); |