netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH for 3.4 1/2] vhost: zerocopy: poll vq in zerocopy callback
Date: Tue, 6 Aug 2013 13:04:38 +0300	[thread overview]
Message-ID: <20130806100438.GF11051@redhat.com> (raw)
In-Reply-To: <1375781359-5764-1-git-send-email-jasowang@redhat.com>

On Tue, Aug 06, 2013 at 05:29:18PM +0800, Jason Wang wrote:
> commit c70aa540c7a9f67add11ad3161096fb95233aa2e upstream.
> 
> 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>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  drivers/vhost/vhost.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 1a9e2a9..a50cb9c 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -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);
> -- 
> 1.7.1

      parent reply	other threads:[~2013-08-06 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06  9:29 [PATCH for 3.4 1/2] vhost: zerocopy: poll vq in zerocopy callback Jason Wang
2013-08-06  9:29 ` [PATCH for 3.4 2/2] macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS Jason Wang
2013-08-06 10:04   ` Michael S. Tsirkin
2013-08-06 10:04 ` Michael S. Tsirkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130806100438.GF11051@redhat.com \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).