]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vhost_net: zerocopy: adding and signalling immediately when fully copied
authorJason Wang <jasowang@redhat.com>
Wed, 2 May 2012 03:42:41 +0000 (11:42 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 2 May 2012 15:22:24 +0000 (18:22 +0300)
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>
drivers/vhost/net.c

index f54b1d5fc234eae0bcc3313d7709c5e3b8c619e0..853db7a08a26bb27e7d7d219262e5974cc312f39 100644 (file)
@@ -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);