On Fri, Oct 31, 2014 at 10:57:55AM +0000, Stefan Hajnoczi wrote: > On Fri, Oct 31, 2014 at 12:40:16AM +0000, Bin Wu wrote: > > The event idx in virtio is an effective way to reduce the number of > > interrupts and exits of the guest. When the guest puts an request > > into the virtio ring, it doesn't exit immediately to inform the > > backend. Instead, the guest checks the "avail" event idx to determine > > the notification. > > > > In virtqueue_pop, when a request is poped, the current avail event > > idx should be set to the number of vq->last_avail_idx. > > > > Signed-off-by: Bin Wu <wu.wu...@huawei.com> > > --- > > V2 -> V1: > > update the same code in hw/virtio/dataplane/vring.c (Stefan) > > --- > > hw/virtio/dataplane/vring.c | 8 ++++---- > > hw/virtio/virtio.c | 2 +- > > 2 files changed, 5 insertions(+), 5 deletions(-) > > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > > By the way, did you see that kernel drivers/vhost/vhost.c doesn't update > the field for each pop? Instead it only updates when notify is > re-enabled. I wonder if that approach is better than what QEMU does. > > Stefan
Yes you should not move event idx if you don't want events.