On Tue, Nov 15, 2016 at 11:16:59AM +0800, Jason Wang wrote:
Absolutely but it checks once and then only re-checks after value
On 2016å11æ12æ 00:20, Michael S. Tsirkin wrote:
On Fri, Nov 11, 2016 at 12:18:50PM +0800, Jason Wang wrote:But as you said, this does not mean (in mergeable cases) we have enough
On 2016å11æ11æ 11:41, Michael S. Tsirkin wrote:What's wrong with what we have? It polls until value changes.
On Fri, Nov 11, 2016 at 10:18:37AM +0800, Jason Wang wrote:Right, but,it's not easy to have 100% correct hint here. Needs more thought.
Means busy polling will cause useless load on the CPU though.On 2016å11æ10æ 03:57, Michael S. Tsirkin wrote:
Yes, we need to know whether or not there's still buffers left in theOn Wed, Nov 09, 2016 at 03:38:32PM +0800, Jason Wang wrote:
I'm not sure why is this patch here. Is it related toWe 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@xxxxxxxxxx>
batching somehow?
virtqueue, so need to check last_avail_idx. Otherwise, we're checking if
guest has submitted new buffers.
Right, but it's no harm since it was just a hint, handle_rx() can handleThat might be OK for TX but it's probably wrong for RX---
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);
where the fact that used != avail does not mean
we have enough space to store the packet.
this situation.
space to store the packet.
changes again.