All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Maor Gottlieb <maorg@nvidia.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Jason Gunthorpe <jgg@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>
Subject: Re: [PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue
Date: Mon, 30 Oct 2023 19:31:38 -0400	[thread overview]
Message-ID: <20231030193110-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <PH0PR12MB548197CD7A10D5A89B7213CDDCA1A@PH0PR12MB5481.namprd12.prod.outlook.com>

On Mon, Oct 30, 2023 at 06:10:06PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, October 30, 2023 9:29 PM
> > On Mon, Oct 30, 2023 at 03:51:40PM +0000, Parav Pandit wrote:
> > >
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Monday, October 30, 2023 1:53 AM
> > > >
> > > > On Sun, Oct 29, 2023 at 05:59:45PM +0200, Yishai Hadas wrote:
> > > > > From: Feng Liu <feliu@nvidia.com>
> > > > >
> > > > > Introduce support for the admin virtqueue. By negotiating
> > > > > VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates
> > > > > one administration virtqueue. Administration virtqueue
> > > > > implementation in virtio pci generic layer, enables multiple types
> > > > > of upper layer drivers such as vfio, net, blk to utilize it.
> > > > >
> > > > > Signed-off-by: Feng Liu <feliu@nvidia.com>
> > > > > Reviewed-by: Parav Pandit <parav@nvidia.com>
> > > > > Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> > > > > Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> > > > > ---
> > > > >  drivers/virtio/virtio.c                | 37 ++++++++++++++--
> > > > >  drivers/virtio/virtio_pci_common.c     |  3 ++
> > > > >  drivers/virtio/virtio_pci_common.h     | 15 ++++++-
> > > > >  drivers/virtio/virtio_pci_modern.c     | 61 +++++++++++++++++++++++++-
> > > > >  drivers/virtio/virtio_pci_modern_dev.c | 18 ++++++++
> > > > >  include/linux/virtio_config.h          |  4 ++
> > > > >  include/linux/virtio_pci_modern.h      |  5 +++
> > > > >  7 files changed, 137 insertions(+), 6 deletions(-)
> > > > >
> > > > > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> > > > > index
> > > > > 3893dc29eb26..f4080692b351 100644
> > > > > --- a/drivers/virtio/virtio.c
> > > > > +++ b/drivers/virtio/virtio.c
> > > > > @@ -302,9 +302,15 @@ static int virtio_dev_probe(struct device *_d)
> > > > >  	if (err)
> > > > >  		goto err;
> > > > >
> > > > > +	if (dev->config->create_avq) {
> > > > > +		err = dev->config->create_avq(dev);
> > > > > +		if (err)
> > > > > +			goto err;
> > > > > +	}
> > > > > +
> > > > >  	err = drv->probe(dev);
> > > > >  	if (err)
> > > > > -		goto err;
> > > > > +		goto err_probe;
> > > > >
> > > > >  	/* If probe didn't do it, mark device DRIVER_OK ourselves. */
> > > > >  	if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK))
> > > >
> > > > Hmm I am not all that happy that we are just creating avq unconditionally.
> > > > Can't we do it on demand to avoid wasting resources if no one uses it?
> > > >
> > > Virtio queues must be enabled before driver_ok as we discussed in
> > F_DYNAMIC bit exercise.
> > > So creating AQ when first legacy command is invoked, would be too late.
> > 
> > Well we didn't release the spec with AQ so I am pretty sure there are no devices
> > using the feature. Do we want to already make an exception for AQ and allow
> > creating AQs after DRIVER_OK even without F_DYNAMIC?
> > 
> No. it would abuse the init time config registers for the dynamic things like this.
> For flow filters and others there is need for dynamic q creation with multiple physical address anyway.

That seems like a completely unrelated issue.

> So creating virtqueues dynamically using a generic scheme is desired with new feature bit.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: Yishai Hadas <yishaih@nvidia.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Feng Liu <feliu@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	"joao.m.martins@oracle.com" <joao.m.martins@oracle.com>,
	"si-wei.liu@oracle.com" <si-wei.liu@oracle.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Maor Gottlieb <maorg@nvidia.com>
Subject: Re: [PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue
Date: Mon, 30 Oct 2023 19:31:38 -0400	[thread overview]
Message-ID: <20231030193110-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <PH0PR12MB548197CD7A10D5A89B7213CDDCA1A@PH0PR12MB5481.namprd12.prod.outlook.com>

On Mon, Oct 30, 2023 at 06:10:06PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, October 30, 2023 9:29 PM
> > On Mon, Oct 30, 2023 at 03:51:40PM +0000, Parav Pandit wrote:
> > >
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Monday, October 30, 2023 1:53 AM
> > > >
> > > > On Sun, Oct 29, 2023 at 05:59:45PM +0200, Yishai Hadas wrote:
> > > > > From: Feng Liu <feliu@nvidia.com>
> > > > >
> > > > > Introduce support for the admin virtqueue. By negotiating
> > > > > VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates
> > > > > one administration virtqueue. Administration virtqueue
> > > > > implementation in virtio pci generic layer, enables multiple types
> > > > > of upper layer drivers such as vfio, net, blk to utilize it.
> > > > >
> > > > > Signed-off-by: Feng Liu <feliu@nvidia.com>
> > > > > Reviewed-by: Parav Pandit <parav@nvidia.com>
> > > > > Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> > > > > Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> > > > > ---
> > > > >  drivers/virtio/virtio.c                | 37 ++++++++++++++--
> > > > >  drivers/virtio/virtio_pci_common.c     |  3 ++
> > > > >  drivers/virtio/virtio_pci_common.h     | 15 ++++++-
> > > > >  drivers/virtio/virtio_pci_modern.c     | 61 +++++++++++++++++++++++++-
> > > > >  drivers/virtio/virtio_pci_modern_dev.c | 18 ++++++++
> > > > >  include/linux/virtio_config.h          |  4 ++
> > > > >  include/linux/virtio_pci_modern.h      |  5 +++
> > > > >  7 files changed, 137 insertions(+), 6 deletions(-)
> > > > >
> > > > > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> > > > > index
> > > > > 3893dc29eb26..f4080692b351 100644
> > > > > --- a/drivers/virtio/virtio.c
> > > > > +++ b/drivers/virtio/virtio.c
> > > > > @@ -302,9 +302,15 @@ static int virtio_dev_probe(struct device *_d)
> > > > >  	if (err)
> > > > >  		goto err;
> > > > >
> > > > > +	if (dev->config->create_avq) {
> > > > > +		err = dev->config->create_avq(dev);
> > > > > +		if (err)
> > > > > +			goto err;
> > > > > +	}
> > > > > +
> > > > >  	err = drv->probe(dev);
> > > > >  	if (err)
> > > > > -		goto err;
> > > > > +		goto err_probe;
> > > > >
> > > > >  	/* If probe didn't do it, mark device DRIVER_OK ourselves. */
> > > > >  	if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK))
> > > >
> > > > Hmm I am not all that happy that we are just creating avq unconditionally.
> > > > Can't we do it on demand to avoid wasting resources if no one uses it?
> > > >
> > > Virtio queues must be enabled before driver_ok as we discussed in
> > F_DYNAMIC bit exercise.
> > > So creating AQ when first legacy command is invoked, would be too late.
> > 
> > Well we didn't release the spec with AQ so I am pretty sure there are no devices
> > using the feature. Do we want to already make an exception for AQ and allow
> > creating AQs after DRIVER_OK even without F_DYNAMIC?
> > 
> No. it would abuse the init time config registers for the dynamic things like this.
> For flow filters and others there is need for dynamic q creation with multiple physical address anyway.

That seems like a completely unrelated issue.

> So creating virtqueues dynamically using a generic scheme is desired with new feature bit.


  reply	other threads:[~2023-10-30 23:31 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 15:59 [PATCH V2 vfio 0/9] Introduce a vfio driver over virtio devices Yishai Hadas via Virtualization
2023-10-29 15:59 ` Yishai Hadas
2023-10-29 15:59 ` [PATCH V2 vfio 1/9] virtio: Define feature bit for administration virtqueue Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 15:59 ` [PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 20:22   ` Michael S. Tsirkin
2023-10-29 20:22     ` Michael S. Tsirkin
2023-10-30 15:51     ` Parav Pandit via Virtualization
2023-10-30 15:51       ` Parav Pandit
2023-10-30 15:59       ` Michael S. Tsirkin
2023-10-30 15:59         ` Michael S. Tsirkin
2023-10-30 18:10         ` Parav Pandit via Virtualization
2023-10-30 18:10           ` Parav Pandit
2023-10-30 23:31           ` Michael S. Tsirkin [this message]
2023-10-30 23:31             ` Michael S. Tsirkin
2023-10-31  3:11             ` Parav Pandit via Virtualization
2023-10-31  3:11               ` Parav Pandit
2023-10-31  7:59               ` Michael S. Tsirkin
2023-10-31  7:59                 ` Michael S. Tsirkin
2023-10-31 12:11                 ` Parav Pandit via Virtualization
2023-10-31 12:11                   ` Parav Pandit
2023-10-29 15:59 ` [PATCH V2 vfio 3/9] virtio-pci: Introduce admin command sending function Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 20:26   ` Michael S. Tsirkin
2023-10-29 20:26     ` Michael S. Tsirkin
2023-10-29 15:59 ` [PATCH V2 vfio 4/9] virtio-pci: Introduce admin commands Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 15:59 ` [PATCH V2 vfio 5/9] virtio-pci: Initialize the supported " Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 20:17   ` Michael S. Tsirkin
2023-10-29 20:17     ` Michael S. Tsirkin
2023-10-30 15:27     ` Yishai Hadas via Virtualization
2023-10-30 15:27       ` Yishai Hadas
2023-10-30 15:57       ` Michael S. Tsirkin
2023-10-30 15:57         ` Michael S. Tsirkin
2023-10-30 16:06         ` Yishai Hadas via Virtualization
2023-10-30 16:06           ` Yishai Hadas
2023-10-30 23:30           ` Michael S. Tsirkin
2023-10-30 23:30             ` Michael S. Tsirkin
2023-11-03  0:33   ` kernel test robot
2023-11-03  0:33     ` kernel test robot
2023-11-03  7:39     ` Michael S. Tsirkin
2023-11-03  7:39       ` Michael S. Tsirkin
2023-10-29 15:59 ` [PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO " Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-31  8:09   ` Michael S. Tsirkin
2023-10-31  8:09     ` Michael S. Tsirkin
2023-10-31  8:30     ` Yishai Hadas via Virtualization
2023-10-31  8:30       ` Yishai Hadas
2023-10-31  9:00       ` Michael S. Tsirkin
2023-10-31  9:00         ` Michael S. Tsirkin
2023-10-29 15:59 ` [PATCH V2 vfio 7/9] vfio/pci: Expose vfio_pci_core_setup_barmap() Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 15:59 ` [PATCH V2 vfio 8/9] vfio/pci: Expose vfio_pci_iowrite/read##size() Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-29 15:59 ` [PATCH V2 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices Yishai Hadas via Virtualization
2023-10-29 15:59   ` Yishai Hadas
2023-10-31  8:17   ` Yi Liu
2023-10-31  8:23     ` Michael S. Tsirkin
2023-10-31  8:23       ` Michael S. Tsirkin
2023-10-31  8:34       ` Yi Liu

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=20231030193110-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=leonro@nvidia.com \
    --cc=maorg@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.