qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] hw/virtio/vring/event_idx: fix the vring_ava


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2] hw/virtio/vring/event_idx: fix the vring_avail_event error
Date: Fri, 31 Oct 2014 10:57:55 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> ---
> 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 <address@hidden>

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

Attachment: pgpsi5RTr3ROd.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]