aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2012-05-02 11:42:41 +0800
committerMichael S. Tsirkin <mst@redhat.com>2012-05-02 18:09:26 +0300
commit1f71ffc2105059154646e8e72de5d67abf75f92c (patch)
treef3e87181ce588a09b643335317754a77ee46d5ee
parent01e340915f084aa9a344246bb7c54ab5646f7b71 (diff)
downloadvhost-1f71ffc2105059154646e8e72de5d67abf75f92c.tar.gz
vhost_net: zerocopy: adding and signalling immediately when fully copied
When a packet were fully copied in zerocopy, we don't wait for the DMA done to mark the done flag, so after the packet were passed to lower device, we need to add used and signal guest immediately. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--drivers/vhost/net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f54b1d5fc234e..853db7a08a26b 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -266,6 +266,8 @@ static void handle_tx(struct vhost_net *net)
" len %d != %zd\n", err, len);
if (!zcopy)
vhost_add_used_and_signal(&net->dev, vq, head, 0);
+ else
+ vhost_zerocopy_signal_used(vq);
total_len += len;
if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
vhost_poll_queue(&vq->poll);