OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [RFC 1/4] vdpa: add VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK flag


On Thu, May 25, 2023 at 12:25âAM Eugenio Perez Martin
<eperezma@redhat.com> wrote:
>
> On Wed, May 24, 2023 at 6:07âAM Jason Wang <jasowang@redhat.com> wrote:
> >
> > On Tue, May 23, 2023 at 1:55âPM Eugenio Perez Martin
> > <eperezma@redhat.com> wrote:
> > >
> > > On Mon, May 22, 2023 at 11:22âPM Shannon Nelson <shannon.nelson@amd.com> wrote:
> > > >
> > > > On 5/22/23 1:07 PM, Eugenio Perez Martin wrote:
> > > > >
> > > > > On Mon, May 22, 2023 at 9:23âPM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > >>
> > > > >> On Mon, May 22, 2023 at 08:57:27PM +0200, Eugenio PÃrez wrote:
> > > > >>> Signed-off-by: Eugenio PÃrez <eperezma@redhat.com>
> > > > >>> ---
> > > > >>>   include/uapi/linux/vhost_types.h | 2 ++
> > > > >>>   1 file changed, 2 insertions(+)
> > > > >>>
> > > > >>> diff --git a/include/uapi/linux/vhost_types.h b/include/uapi/linux/vhost_types.h
> > > > >>> index c5690a8992d8..a1b316f49b38 100644
> > > > >>> --- a/include/uapi/linux/vhost_types.h
> > > > >>> +++ b/include/uapi/linux/vhost_types.h
> > > > >>> @@ -165,5 +165,7 @@ struct vhost_vdpa_iova_range {
> > > > >>>   #define VHOST_BACKEND_F_SUSPEND  0x4
> > > > >>>   /* Device can be resumed */
> > > > >>>   #define VHOST_BACKEND_F_RESUME  0x5
> > > > >>> +/* Device can enable virtqueues after DRIVER_OK */
> > > > >>
> > > > >> A bit more detail on what does this mean?
> > > > >> It's normally driver that enables VQs not device itself ...
> > > > >>
> > > > >
> > > > > I agree, it is not well explained.
> > > > >
> > > > > What about "Device supports the driver to enable virtqueues after DRIVER_OK"?
> > > > >
> > > > >>> +#define VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK  0x6
> > > >
> > > > Does this mean it is possible only after DRIVER_OK, or does it mean in
> > > > addition to before DRIVER_OK?  It isn't clear to me.
> > > >
> > > > Maybe something like
> > > > "Device supports virtqueue enable only after DRIVER_OK"
> > > > or
> > > > "Device supports virtqueue enable both before and after DRIVER_OK"
> > > >
> > >
> > > I agree too,
> > >
> > > With the previous suggestion it would be:
> > >
> > > "Device supports the driver to enable virtqueues both before and after
> > > DRIVER_OK"
> >
> > Btw, I think it might be worth clarifying whether or not this is
> > supported by the current virtio spec. Spec seems to be unclear on
> > this:
> >
> > 1) The driver MUST NOT write a 0 to queue_enable.
> > 2) if reset is support, driver can wrote 1 to re-enable a virtqueue
> >
> > But it doesn't say if the driver can write 1 after DRIVER_OK without reset.
> >
>
> To double check, you mean to write 1 even if the queue is live?
> "without reset *the virtqueue*"?

No I mean something like this

1) write queue_enable to cvq
2) set DRIVER_OK
3) restore
4) write queue_enable to txq 0

>
> I'd add another combination that might be worth clarifying: ack
> VIRTIO_F_RING_RESET, write 1 to queue_enable, then write 1 to
> queue_reset. Set state DRIVER_OK, and then enable the queue
> afterwards. Is this valid?

Spec doesn't say it can't so it's implementation specific which is
probably suboptimal. But as replied in another thread this seems to be
supported by Qemu.

>
> I guess it is not, but I don't see the standard forbidding it, isn't it?

Yes, this needs to be fixed.

But one point here is that we should make svq work without RING_RESET
(or we can say if RING_REST implies the feature you proposed here)

Thanks

>
> Thanks!
>
> > Thanks
> >
> >
> > >
> > > Does it look better?
> > >
> > > Thanks!
> > >
> > > > sln
> > > >
> > > >
> > > > >>>
> > > > >>>   #endif
> > > > >>> --
> > > > >>> 2.31.1
> > > > >>
> > > > >
> > > >
> > >
> >
>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]