Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517803

[PATCH 2/3] vhost: better detection of available buffers

From Jason Wang <jasowang@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] vhost: better detection of available buffers
Date 2016-11-09 08:40 +0100
Message-ID <sBvEd-4gF-7@gated-at.bofh.it> (permalink)
References <sBvEd-4gF-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We should use vq->last_avail_idx instead of vq->avail_idx in the
checking of vhost_vq_avail_empty() since latter is the cached avail
index from guest but we want to know if there's pending available
buffers in the virtqueue.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index c6f2d89..fdf4cdf 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2230,7 +2230,7 @@ bool vhost_vq_avail_empty(struct vhost_dev *dev, struct vhost_virtqueue *vq)
 	if (r)
 		return false;
 
-	return vhost16_to_cpu(vq, avail_idx) == vq->avail_idx;
+	return vhost16_to_cpu(vq, avail_idx) == vq->last_avail_idx;
 }
 EXPORT_SYMBOL_GPL(vhost_vq_avail_empty);
 
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] tuntap: rx batching Jason Wang <jasowang@redhat.com> - 2016-11-09 08:40 +0100
  [PATCH 3/3] vhost_net: tx support batching Jason Wang <jasowang@redhat.com> - 2016-11-09 08:40 +0100
    Re: [PATCH 3/3] vhost_net: tx support batching "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-09 21:10 +0100
      Re: [PATCH 3/3] vhost_net: tx support batching Jason Wang <jasowang@redhat.com> - 2016-11-11 03:30 +0100
  [PATCH 2/3] vhost: better detection of available buffers Jason Wang <jasowang@redhat.com> - 2016-11-09 08:40 +0100
    Re: [PATCH 2/3] vhost: better detection of available buffers "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-09 21:00 +0100
      Re: [PATCH 2/3] vhost: better detection of available buffers Jason Wang <jasowang@redhat.com> - 2016-11-11 03:20 +0100
        Re: [PATCH 2/3] vhost: better detection of available buffers "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-11 04:50 +0100
          Re: [PATCH 2/3] vhost: better detection of available buffers Jason Wang <jasowang@redhat.com> - 2016-11-11 05:20 +0100
            Re: [PATCH 2/3] vhost: better detection of available buffers "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-11 17:30 +0100
  Re: [PATCH 1/3] tuntap: rx batching "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-09 17:40 +0100
    Re: [PATCH 1/3] tuntap: rx batching Jason Wang <jasowang@redhat.com> - 2016-11-11 03:10 +0100
      Re: [PATCH 1/3] tuntap: rx batching "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-11 04:40 +0100
        Re: [PATCH 1/3] tuntap: rx batching John Fastabend <john.fastabend@gmail.com> - 2016-11-11 05:20 +0100
          Re: [PATCH 1/3] tuntap: rx batching Jason Wang <jasowang@redhat.com> - 2016-11-11 05:30 +0100
            Re: [PATCH 1/3] tuntap: rx batching John Fastabend <john.fastabend@gmail.com> - 2016-11-11 05:50 +0100
            Re: [PATCH 1/3] tuntap: rx batching "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-11 17:30 +0100
        Re: [PATCH 1/3] tuntap: rx batching Jason Wang <jasowang@redhat.com> - 2016-11-11 05:20 +0100

csiph-web