diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-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 e78486504d3a..95274678fe45 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -514,8 +514,7 @@ again: | |||
514 | /* Free up any pending old buffers before queueing new ones. */ | 514 | /* Free up any pending old buffers before queueing new ones. */ |
515 | free_old_xmit_skbs(vi); | 515 | free_old_xmit_skbs(vi); |
516 | 516 | ||
517 | /* Put new one in send queue and do transmit */ | 517 | /* Try to transmit */ |
518 | __skb_queue_head(&vi->send, skb); | ||
519 | capacity = xmit_skb(vi, skb); | 518 | capacity = xmit_skb(vi, skb); |
520 | 519 | ||
521 | /* This can happen with OOM and indirect buffers. */ | 520 | /* This can happen with OOM and indirect buffers. */ |
@@ -529,8 +528,17 @@ again: | |||
529 | } | 528 | } |
530 | return NETDEV_TX_BUSY; | 529 | return NETDEV_TX_BUSY; |
531 | } | 530 | } |
532 | |||
533 | vi->svq->vq_ops->kick(vi->svq); | 531 | vi->svq->vq_ops->kick(vi->svq); |
532 | |||
533 | /* | ||
534 | * Put new one in send queue. You'd expect we'd need this before | ||
535 | * xmit_skb calls add_buf(), since the callback can be triggered | ||
536 | * immediately after that. But since the callback just triggers | ||
537 | * another call back here, normal network xmit locking prevents the | ||
538 | * race. | ||
539 | */ | ||
540 | __skb_queue_head(&vi->send, skb); | ||
541 | |||
534 | /* Don't wait up for transmitted skbs to be freed. */ | 542 | /* Don't wait up for transmitted skbs to be freed. */ |
535 | skb_orphan(skb); | 543 | skb_orphan(skb); |
536 | nf_reset(skb); | 544 | nf_reset(skb); |