Discussion of the VIRTIO specification
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	virtio-comment@lists.oasis-open.org,
	Laurent Vivier <lvivier@redhat.com>, Cindy Lu <lulu@redhat.com>,
	cohuck@redhat.com, alvaro.karsz@solid-run.com,
	Liuxiangdong <liuxiangdong5@huawei.com>,
	Gautam Dawar <gdawar@xilinx.com>,
	longpeng2@huawei.com, Dragos Tatulea <dtatulea@nvidia.com>,
	parav@nvidia.com, stefanha@redhat.com,
	Harpreet Singh Anand <hanand@xilinx.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Heng Qi <hengqi@linux.alibaba.com>,
	Zhu Lingshan <lingshan.zhu@intel.com>,
	Shannon Nelson <snelson@pensando.io>,
	mgurtovoy@nvidia.com, si-wei.liu@oracle.com
Subject: Re: [virtio-comment] Re: [PATCH 0/2] Selective queue enabling
Date: Mon, 26 Jun 2023 05:40:47 -0400	[thread overview]
Message-ID: <20230626053446-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAJaqyWfmtLJbePYrhbw-xd5-jaD=wwaMG2Xc8N_x8yjLSCD0Lw@mail.gmail.com>

On Mon, Jun 26, 2023 at 10:19:48AM +0200, Eugenio Perez Martin wrote:
> On Mon, Jun 26, 2023 at 4:53 AM Jason Wang <jasowang@redhat.com> wrote:
> >
> > On Mon, Jun 26, 2023 at 5:32 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> > >
> > > On Sun, Jun 25, 2023 at 01:31:36PM +0800, Jason Wang wrote:
> > > > On Sun, Jun 25, 2023 at 2:41 AM Eugenio Perez Martin
> > > > <eperezma@redhat.com> wrote:
> > > > >
> > > > > On Sun, Jun 18, 2023 at 1:08 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > >
> > > > > > On Sat, Jun 17, 2023 at 02:53:46PM +0200, Eugenio Perez Martin wrote:
> > > > > > > On Fri, Jun 16, 2023 at 4:40 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > > >
> > > > > > > > On Thu, Jun 15, 2023 at 10:35:09AM +0200, Eugenio Perez Martin wrote:
> > > > > > > > > On Tue, Jun 13, 2023 at 2:29 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Tue, Jun 13, 2023 at 12:12:43PM +0200, Eugenio Perez Martin wrote:
> > > > > > > > > > > On Tue, Jun 13, 2023 at 9:53 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Tue, Jun 13, 2023 at 03:46:35AM -0400, Michael S. Tsirkin wrote:
> > > > > > > > > > > > > On Mon, Jun 12, 2023 at 09:56:57AM +0200, Eugenio Perez Martin wrote:
> > > > > > > > > > > > > > > > Another drawback of that is the long time a device can spend to
> > > > > > > > > > > > > > > > reconfigure its memory maps.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > The map is already used for cvq though, I don't see why it would take
> > > > > > > > > > > > > > > much more with this.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > In the case of vDPA HW, CVQ maps may not need to reach the device's or
> > > > > > > > > > > > > > platform IOMMU, so the modification of that mapping is way cheaper.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Oh, I get it. It's setup time, but you are right.
> > > > > > > > > > > > >
> > > > > > > > > > > > > > > > taking that into account, does it make
> > > > > > > > > > > > > > > > sense to send a new version with the bit 1 on enable?
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Thanks!
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Current hardware won't support the extra bit though.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Thinking more about this, I think the following works:
> > > > > > > > > > > >
> > > > > > > > > > > > - enable all queues before DRIVER_OK
> > > > > > > > > > > > - reset all data queues before DRIVER_OK
> > > > > > > > > > > > - DRIVER_OK
> > > > > > > > > > > > - CVQ commands
> > > > > > > > > > > > - re-enable data queues
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > No?
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > If it is valid to write to queue_reset before DRIVER_OK, then sure. I
> > > > > > > > > > > asked for that in the past at
> > > > > > > > > > > https://lists.oasis-open.org/archives/virtio-dev/202305/msg00329.html
> > > > > > > > > > > .
> > > > > > > > > >
> > > > > > > > > > Well then Jason said:
> > > > > > > > > >  we should make svq work without RING_RESET
> > > > > > > > > > but now apparently we went full circle and propose
> > > > > > > > > > a feature bit after all?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > My understanding is that RING_RESET covers more than just delaying the
> > > > > > > > > enabling of net data vqs, like to change the address or properties of
> > > > > > > > > vqs after DRIVER_OK. While the late enabling may be easy to implement
> > > > > > > > > in current hw, vq property changes may be more challenging. There are
> > > > > > > > > current HW that only support late enabling but not reconfigure the
> > > > > > > > > queues. Ideally, just the subset of late enabling is needed.
> > > > > > > > >
> > > > > > > > > Does it make sense to change the proposal to something in the line of:
> > > > > > > > > RING_F_LATE_ENABLING: This feature flag is a subset of _F_RING_RESET.
> > > > > > > > > If this feature is negotiated, all vqs start as if the vqs has been
> > > > > > > > > reset before DRIVER_OK. This feature does not allow resetting a queue
> > > > > > > > > once it is live.
> > > > > > > > >
> > > > > > > > > Thanks!
> > > > > > > >
> > > > > > > > Maybe. No idea - I am not a hardware designer. Can some hardware
> > > > > > > > vendors chime in and confirm?
> > > > > > > > It seems like a very very narrow "make my hack work" use-case.
> > > > > > > > And I'm not even sure how well it works.
> > > > > > > > For example what if cvq command enables rss? If the queues in
> > > > > > > > question are not enabled packets will be dropped.
> > > > > > > > So - fix some setups, break others?
> > > > > > > >
> > > > > > >
> > > > > > > I don't think it breaks, they are already dropped before setting
> > > > > > > DRIVER_OK anyway. If we restore the configuration before DRIVER_OK in
> > > > > > > the future, the device is supposed to drop packets meanwhile anyway,
> > > > > > > isn't it?
> > > > > >
> > > > > >
> > > > > > I just thought of an idea. Devices generally don't poke at rings
> > > > > > by themselves. How about at init time we cause kicks on data queues
> > > > > > to vmexit? Then on 1st kick we map hardware so following ones will
> > > > > > go straight to hardware. This will make sure cvq is processed
> > > > > > first. Hmm?
> > > >
> > > > This is not the case at least for vhost-net. It doesn't need to be
> > > > kicked in order to work. And it's an example that we need clearly
> > > > define the behaviour instead of depending on any existing
> > > > implementation details.
> > >
> > > This kind of guarantee however sounds generally useful to
> > > control which queues are accessed when.
> > >
> > > This is only needed after restore, which is ATM a vdpa thing,
> > > so can just be a vdpa flag, but I'm ok with it as a
> > > virtio flag too.
> >
> > Great. Having a virtio flag may help to reduce the extra and
> > duplicated effort spent in vdpa.
> >
> 
> So the flag should be something in the line of:
> VIRTIO_F_ACCESS_AFTER_KICK: The device will only access the ring after
> the first kick. Before that kick, it will not process any request.
> 
> ?
> 
> Thanks!

That's not bad. I am not sure adding this to spec is worth
the effort but at least it's kind of reasonable.
Are there uses such as hardening where something like this could be useful?


> > Thanks
> >
> > >
> > > > > >
> > > > >
> > > > > That would be possible, but nothing prevents the hw to start
> > > > > processing requests even without that first kick, isn't it?
> > > >
> > > > Yes.
> > > >
> > > > Thanks
> > > >
> > > > >
> > > > > I think that was discussed also in the past, as previous qemu patches
> > > > > gave a spurious kick to start queues just in case. I think the
> > > > > conclusion was that at least the vDPA device will start processing
> > > > > requests at DRIVER_OK, no need to wait for a kick.
> > > > >
> > > > > https://lore.kernel.org/all/CACGkMEt8cMM1UxVzxb0eHeaWSpR0ApvGzaF901vrM4m-uGMiPA@mail.gmail.com/
> > > > >
> > > > > Thanks!
> > > > >
> > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > MST
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > This publicly archived list offers a means to provide input to the
> > > > > > > > > > > > OASIS Virtual I/O Device (VIRTIO) TC.
> > > > > > > > > > > >
> > > > > > > > > > > > In order to verify user consent to the Feedback License terms and
> > > > > > > > > > > > to minimize spam in the list archive, subscription is required
> > > > > > > > > > > > before posting.
> > > > > > > > > > > >
> > > > > > > > > > > > Subscribe: virtio-comment-subscribe@lists.oasis-open.org
> > > > > > > > > > > > Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
> > > > > > > > > > > > List help: virtio-comment-help@lists.oasis-open.org
> > > > > > > > > > > > List archive: https://lists.oasis-open.org/archives/virtio-comment/
> > > > > > > > > > > > Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
> > > > > > > > > > > > List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
> > > > > > > > > > > > Committee: https://www.oasis-open.org/committees/virtio/
> > > > > > > > > > > > Join OASIS: https://www.oasis-open.org/join/
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > >
> > > > >
> > >
> >


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


  reply	other threads:[~2023-06-26  9:40 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 17:55 [virtio-comment] [PATCH 0/2] Selective queue enabling Eugenio Pérez
2023-06-06 17:55 ` [virtio-comment] [PATCH 1/2] virtio: introduce selective " Eugenio Pérez
2023-06-06 18:04   ` [virtio-comment] " Parav Pandit
2023-06-06 19:19     ` [virtio-comment] " Michael S. Tsirkin
2023-06-06 19:25       ` [virtio-comment] " Parav Pandit
2023-06-08 11:53         ` Eugenio Perez Martin
2023-06-08 13:15           ` Parav Pandit
2023-06-08 15:05             ` Michael S. Tsirkin
2023-06-08 15:07               ` Parav Pandit
2023-06-08 15:11           ` Michael S. Tsirkin
2023-06-08 12:11       ` [virtio-comment] " Xuan Zhuo
2023-06-08 13:21         ` [virtio-comment] " Parav Pandit
2023-06-08 14:18         ` [virtio-comment] " Eugenio Perez Martin
2023-06-08 14:39           ` Michael S. Tsirkin
2023-06-09  3:53           ` Xuan Zhuo
2023-06-06 19:11   ` Michael S. Tsirkin
2023-06-13  7:50   ` Michael S. Tsirkin
2023-06-13  8:28     ` Eugenio Perez Martin
2023-06-06 17:55 ` [virtio-comment] [PATCH 2/2] virtio: pci support virtqueue selective enabling Eugenio Pérez
2023-06-06 19:09   ` [virtio-comment] " Michael S. Tsirkin
2023-06-07  7:37     ` Eugenio Perez Martin
2023-06-07  9:03       ` Michael S. Tsirkin
2023-06-07  9:46         ` Eugenio Perez Martin
2023-06-06 19:09 ` [virtio-comment] Re: [PATCH 0/2] Selective queue enabling Michael S. Tsirkin
2023-06-07  5:35   ` Eugenio Perez Martin
2023-06-07  8:22     ` Xuan Zhuo
2023-06-07  8:47       ` Eugenio Perez Martin
2023-06-07  8:59         ` Michael S. Tsirkin
2023-06-07  9:41           ` Eugenio Perez Martin
2023-06-07 20:26             ` Michael S. Tsirkin
2023-06-08  0:44               ` Jason Wang
2023-06-08  6:04                 ` Michael S. Tsirkin
2023-06-08  6:43                   ` Eugenio Perez Martin
2023-06-08  7:18                     ` Michael S. Tsirkin
2023-06-08  7:47                       ` Jason Wang
2023-06-08 13:44                         ` Michael S. Tsirkin
2023-06-08  8:36                       ` Eugenio Perez Martin
2023-06-08 14:13                         ` Parav Pandit
2023-06-08 22:08                         ` Michael S. Tsirkin
2023-06-09 10:27                           ` Eugenio Perez Martin
2023-06-09 15:54                             ` Michael S. Tsirkin
2023-06-12  7:56                               ` Eugenio Perez Martin
2023-06-13  7:46                                 ` Michael S. Tsirkin
2023-06-13  7:53                                   ` Michael S. Tsirkin
2023-06-13 10:12                                     ` Eugenio Perez Martin
2023-06-13 12:28                                       ` Michael S. Tsirkin
2023-06-15  8:35                                         ` Eugenio Perez Martin
2023-06-16 14:40                                           ` Michael S. Tsirkin
2023-06-17 12:53                                             ` Eugenio Perez Martin
2023-06-17 23:08                                               ` Michael S. Tsirkin
2023-06-24 18:40                                                 ` Eugenio Perez Martin
2023-06-25  5:31                                                   ` Jason Wang
2023-06-25 21:32                                                     ` Michael S. Tsirkin
2023-06-26  2:53                                                       ` Jason Wang
2023-06-26  8:19                                                         ` Eugenio Perez Martin
2023-06-26  9:40                                                           ` Michael S. Tsirkin [this message]
2023-06-27  8:07                                                             ` Jason Wang
2023-06-13 19:00                                       ` Parav Pandit
2023-06-13 19:54                                         ` Michael S. Tsirkin
2023-06-13 21:09                                           ` Parav Pandit
2023-06-13 21:19                                             ` Parav Pandit
2023-06-13 21:48                                             ` Michael S. Tsirkin
2023-06-13 21:54                                               ` Parav Pandit
2023-06-14  4:26                                                 ` Zhu, Lingshan
2023-06-14  4:32                                                   ` Parav Pandit
2023-06-14  6:11                                                     ` Zhu, Lingshan
2023-06-14 11:56                                                       ` Parav Pandit
2023-06-15  5:56                                                         ` Zhu, Lingshan
2023-06-16  9:19                                                           ` Eugenio Perez Martin
2023-06-08  7:46                   ` Jason Wang
2023-07-06 18:18 ` [virtio-comment] " Eugenio Perez Martin
2023-07-10  3:55   ` Jason Wang
2023-07-10  5:49     ` Michael S. Tsirkin
2023-07-10 12:13       ` Parav Pandit
2023-07-11  3:09         ` Jason Wang
2023-07-11  3:08       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626053446-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alvaro.karsz@solid-run.com \
    --cc=cohuck@redhat.com \
    --cc=dtatulea@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=liuxiangdong5@huawei.com \
    --cc=longpeng2@huawei.com \
    --cc=lulu@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=snelson@pensando.io \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox