]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
vhost: zerocopy: poll vq in zerocopy callback
authorJason Wang <jasowang@redhat.com>
Wed, 2 May 2012 03:42:54 +0000 (11:42 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 2 May 2012 15:22:25 +0000 (18:22 +0300)
We add used and signal guest in worker thread but did not poll the virtqueue
during the zero copy callback. This may lead the missing of adding and
signalling during zerocopy. Solve this by polling the virtqueue and let it
wakeup the worker during callback.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c

index 51e4c1eeec4f0b09af84b5feb58c63313cd7d0cb..94dbd25caa303c44c4c972230fcb2752da619fc0 100644 (file)
@@ -1603,6 +1603,7 @@ void vhost_zerocopy_callback(struct ubuf_info *ubuf)
        struct vhost_ubuf_ref *ubufs = ubuf->ctx;
        struct vhost_virtqueue *vq = ubufs->vq;
 
+       vhost_poll_queue(&vq->poll);
        /* set len = 1 to mark this desc buffers done DMA */
        vq->heads[ubuf->desc].len = VHOST_DMA_DONE_LEN;
        kref_put(&ubufs->kref, vhost_zerocopy_done_signal);