Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Max Gurtovoy <mgurtovoy@nvidia.com>,
	Halil Pasic <pasic@linux.ibm.com>
Cc: Jason Wang <jasowang@redhat.com>,
	virtio-comment@lists.oasis-open.org,
	Virtio-Dev <virtio-dev@lists.oasis-open.org>,
	Parav Pandit <parav@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>, Oren Duer <oren@nvidia.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [virtio-dev] Re: [PATCH v2 1/4] Add virtio Admin Virtqueue
Date: Mon, 31 Jan 2022 10:16:43 +0100	[thread overview]
Message-ID: <87ilu0z2mc.fsf@redhat.com> (raw)
In-Reply-To: <20220130102940-mutt-send-email-mst@kernel.org>

On Sun, Jan 30 2022, "Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Sun, Jan 30, 2022 at 05:12:46PM +0200, Max Gurtovoy wrote:
>> 
>> On 1/30/2022 4:41 PM, Michael S. Tsirkin wrote:
>> > On Sun, Jan 30, 2022 at 11:56:30AM +0200, Max Gurtovoy wrote:
>> > > On 1/30/2022 11:40 AM, Michael S. Tsirkin wrote:
>> > > > On Sun, Jan 30, 2022 at 11:13:38AM +0200, Max Gurtovoy wrote:
>> > > > > On 1/29/2022 5:53 AM, Jason Wang wrote:
>> > > > > > On Fri, Jan 28, 2022 at 11:52 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>> > > > > > > On Fri, Jan 28, 2022 at 04:49:34PM +0100, Cornelia Huck wrote:
>> > > > > > > > On Fri, Jan 28 2022, "Michael S. Tsirkin" <mst@redhat.com> wrote:
>> > > > > > > > 
>> > > > > > > > > On Fri, Jan 28, 2022 at 01:14:14PM +0100, Cornelia Huck wrote:
>> > > > > > > > > > On Mon, Jan 24 2022, Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
>> > > > > > > > > > > +\section{Admin Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Admin Virtqueues}
>> > > > > > > > > > > +
>> > > > > > > > > > > +Admin virtqueue is used to send administrative commands to manipulate
>> > > > > > > > > > > +various features of the device and/or to manipulate various features,
>> > > > > > > > > > > +if possible, of another device within the same group (e.g. PCI VFs of
>> > > > > > > > > > > +a parent PCI PF device are grouped together. These devices can be
>> > > > > > > > > > > +optionally managed by its parent PCI PF using its admin virtqueue.).
>> > > > > > > > > > > +
>> > > > > > > > > > > +Use of Admin virtqueue is negotiated by the VIRTIO_F_ADMIN_VQ
>> > > > > > > > > > > +feature bit.
>> > > > > > > > > > > +
>> > > > > > > > > > > +Admin virtqueue index may vary among different device types.
>> > > > > > > > > > So, my understanding is:
>> > > > > > > > > > - any device type may or may not support the admin vq
>> > > > > > > > > > - if the device type wants to be able to accommodate the admin vq, it
>> > > > > > > > > >      also needs to specify where it shows up when the feature is negotiated
>> > > > > > > > > > 
>> > > > > > > > > > Do we expect that eventually all device types will need to support the
>> > > > > > > > > > admin vq (if some use case comes along that will require all devices to
>> > > > > > > > > > participate, for example?)
>> > > > > > > > > I suspect yes. And that's one of the reasons why I'd rather we had a
>> > > > > > > > > device independent way to locate the admin queue. There are less
>> > > > > > > > > transports than device types.
>> > > > > > > > So, do we want to bite the bullet now and simply say that every device
>> > > > > > > > type has the admin vq as the last vq if the feature is negotiated?
>> > > > > > > > Should be straightforward for the device types that have a fixed number
>> > > > > > > > of vqs, and doable for those that have a variable amount (two device
>> > > > > > > > types are covered by this series anyway.) I think we need to put it with
>> > > > > > > > the device types, as otherwise the numbering of virtqueues could change
>> > > > > > > > in unpredictable ways with the admin vq off/on.
>> > > > > > > Well that only works once. The next thing we'll need we won't be able to
>> > > > > > > make the last one ;) So I am inclined to add a per-transport field that
>> > > > > > > gives the admin queue number.
>> > > > > > Technically, there's no need to use the same namespace for admin
>> > > > > > virtqueue if it has a dedicated notification area. If we go this way,
>> > > > > > we can simply use 0 as queue index for admin virtqueue.
>> > > > > Or we can use index 0xFFFF for admin virtqueue for compatibility.
>> > > > I think I'd prefer a register with the #. For example we might want
>> > > > to limit the # of VQs in order to pass extra data with the kick write.
>> > > So you are suggesting adding a new cfg_type (#define
>> > > VIRTIO_PCI_CAP_ADMIN_CFG 10) ?
>> > > 
>> > > that will look something like:
>> > > 
>> > > struct virtio_pci_admin_cfg {
>> > > 
>> > >      le32 queue_index; /* read only for the driver */
>> > > 
>> > >      le16 queue_size; /* read-write */
>> > >      le16 queue_msix_vector; /* read-write */
>> > >      le16 queue_enable; /* read-write */
>> > >      le16 queue_notify_off; /* read-only for driver */
>> > >      le64 queue_desc; /* read-write */
>> > >      le64 queue_driver; /* read-write */
>> > >      le64 queue_device; /* read-write */
>> > >      le16 queue_notify_data; /* read-only for driver */
>> > >      le16 queue_reset; /* read-write */
>> > > 
>> > > };
>> > > 
>> > > instead of re-using the struct virtio_pci_common_cfg ?
>> > > 
>> > > 
>> > > or do you prefer extending the struct virtio_pci_common_cfg with "le16
>> > > admin_queue_index; /* read only for the driver */ ?
>> > The later. Other transports will need this too.
>> > 
>> > 
>> > Cornelia has another idea which is that instead of
>> > adding just the admin queue register to all transports,
>> > we instead add a misc_config structure to all
>> > transports. Working basically like device specific config,
>> > but being device independent. For now it will only have
>> > a single le16 admin_queue_index register.
>> > 
>> > For PCI we would thus add it with VIRTIO_PCI_CAP_MISC_CFG
>> > 
>> > The point here is that we are making it easier to add
>> > more fields just like admin queue index in the future.
>> 
>> OK.
>> 
>> #define VIRTIO_PCI_CAP_MISC_CFG 10
>> 
>> and
>> 
>> struct virtio_pci_misc_cfg {
>>     le16 admin_queue_index; /* read-only for driver */
>> };
>> 
>> Is agreed by all for V3 ? instead of the net and blk AQ index definitions.
>
> We need to add it to MMIO and CCW I guess too.

That seems ok for pci.

For ccw, I'd do something like

#define CCW_CMD_READ_MISC_CONF 0x82

struct virtio_misc_conf {
       be16 admin_queue_index;
};

bound to revision 3, which gets a payload data containing the length of
this structure (for future expansions).

Halil, do you think that would work?

For mmio, I'd need to think a bit more. Any mmio experts around?


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  parent reply	other threads:[~2022-01-31  9:17 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  9:39 [PATCH v2 0/4] VIRTIO: Provision maximum MSI-X vectors for a VF Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 1/4] Add virtio Admin Virtqueue Max Gurtovoy
2022-01-26 14:40   ` Michael S. Tsirkin
2022-01-26 14:54     ` [virtio-comment] " Max Gurtovoy
2022-01-26 15:03       ` Michael S. Tsirkin
2022-01-26 15:16         ` [virtio-comment] " Max Gurtovoy
2022-01-27  3:56         ` Parav Pandit
2022-01-27  3:55     ` Parav Pandit
2022-01-27  3:56       ` Jason Wang
2022-01-28 12:14   ` [virtio-comment] " Cornelia Huck
2022-01-28 12:47     ` Michael S. Tsirkin
2022-01-28 15:49       ` [virtio-comment] " Cornelia Huck
2022-01-28 15:52         ` Michael S. Tsirkin
2022-01-28 16:14           ` [virtio-dev] " Cornelia Huck
2022-01-28 16:16             ` Michael S. Tsirkin
2022-01-28 16:23               ` [virtio-dev] " Cornelia Huck
2022-01-29  3:53           ` Jason Wang
2022-01-30  9:13             ` Max Gurtovoy
2022-01-30  9:40               ` Michael S. Tsirkin
2022-01-30  9:56                 ` Max Gurtovoy
2022-01-30 14:41                   ` Michael S. Tsirkin
2022-01-30 15:12                     ` Max Gurtovoy
2022-01-30 15:30                       ` Michael S. Tsirkin
2022-01-30 18:23                         ` [virtio-comment] " Max Gurtovoy
2022-01-30 21:15                           ` Michael S. Tsirkin
2022-01-31  9:16                         ` Cornelia Huck [this message]
2022-01-31 13:40                           ` Michael S. Tsirkin
2022-01-31 14:26                             ` [virtio-comment] " Cornelia Huck
2022-01-31 14:52                               ` Michael S. Tsirkin
2022-01-31 15:48                                 ` [virtio-dev] " Cornelia Huck
2022-01-31 16:00                                   ` Michael S. Tsirkin
2022-01-31 16:12                                 ` Halil Pasic
2022-01-31 17:10                                   ` [virtio-dev] " Cornelia Huck
2022-01-31 17:22                                     ` Michael S. Tsirkin
2022-02-01 11:53                                     ` [virtio-dev] " Halil Pasic
2022-02-01 17:01                                       ` Cornelia Huck
2022-02-01 18:34                                         ` Michael S. Tsirkin
2022-01-31 15:47                           ` Halil Pasic
2022-01-31 16:01                             ` Michael S. Tsirkin
2022-01-31 16:12                             ` Cornelia Huck
2022-02-09  2:27                         ` Jason Wang
2022-02-09  7:46                           ` Michael S. Tsirkin
2022-01-30  9:39             ` Michael S. Tsirkin
2022-01-30 11:21     ` [virtio-comment] " Max Gurtovoy
2022-01-30 14:37       ` Michael S. Tsirkin
2022-01-24  9:39 ` [virtio-comment] [PATCH v2 2/4] virtio-blk: add support for VIRTIO_F_ADMIN_VQ Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 3/4] virtio-net: " Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 4/4] Add support for MSI-X vectors configuration for PCI VFs Max Gurtovoy
2022-01-25 11:53   ` Michael S. Tsirkin
2022-01-26 13:03     ` Parav Pandit
2022-01-26 14:08       ` [virtio-comment] " Michael S. Tsirkin
2022-01-27  3:40         ` Parav Pandit
2022-01-27 12:39           ` Michael S. Tsirkin
2022-01-27 14:16             ` Parav Pandit
2022-01-27 17:28               ` Michael S. Tsirkin
2022-01-27  3:36   ` Jason Wang
2022-01-27  5:22     ` Parav Pandit
2022-01-28  3:23       ` [virtio-comment] " Jason Wang
2022-01-28  3:30         ` Parav Pandit
2022-01-28  3:35           ` Jason Wang
2022-01-28  3:45             ` Parav Pandit

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=87ilu0z2mc.fsf@redhat.com \
    --to=cohuck@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=mst@redhat.com \
    --cc=oren@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=pasic@linux.ibm.com \
    --cc=shahafs@nvidia.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@lists.oasis-open.org \
    /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