qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/3] net: vhost stop updates virtio queue sta


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH v2 2/3] net: vhost stop updates virtio queue state
Date: Wed, 9 Nov 2016 22:12:43 +0200

On Wed, Nov 09, 2016 at 06:07:29PM +0100, Paolo Bonzini wrote:
> 
> 
> On 09/11/2016 16:22, address@hidden wrote:
> > From: Yuri Benditovich <address@hidden>
> > 
> > Make virtio queue suitable for push operation from qemu
> > after vhost was stopped.
> > 
> > Signed-off-by: Yuri Benditovich <address@hidden>
> > ---
> >  hw/virtio/vhost.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> > index bd051ab..2e990d0 100644
> > --- a/hw/virtio/vhost.c
> > +++ b/hw/virtio/vhost.c
> > @@ -963,6 +963,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
> >          virtio_queue_set_last_avail_idx(vdev, idx, state.num);
> >      }
> >      virtio_queue_invalidate_signalled_used(vdev, idx);
> > +    virtio_queue_update_used_idx(vdev, idx);
> 
> All three functions virtio_queue_set_last_avail_idx,
> virtio_queue_invalidate_signalled_used, virtio_queue_update_used_idx are
> only used here.
> 
> Plus, virtio_queue_set_last_avail_idx is always called in practice,
> since the only failure modes for VHOST_GET_VRING_BASE are EFAULT and
> out-of-range virtqueue number.  In both cases QEMU can ignore the other
> two steps.
> 
> So perhaps we should have a single function virtio_queue_set_vring_base,
> taking a vhost_vring_state struct?  It can do all three.
> 
> Paolo

I don't object but I think the bugfix is helpful in this QEMU
version, and this change is minimally intrusive.

> >  
> >      /* In the cross-endian case, we need to reset the vring endianness to
> >       * native as legacy devices expect so by default.
> > 



reply via email to

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