From: Jason Wang Date: Wed, 2 May 2012 03:42:41 +0000 (+0800) Subject: vhost_net: zerocopy: adding and signalling immediately when fully copied X-Git-Tag: firefly_0821_release~3680^2~2787^2~146^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c8fb217af57c6c232af3517d3115d2af4ce9900e;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index f54b1d5fc234..853db7a08a26 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);