virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: virtualization@lists.linux.dev, jasowang@redhat.com,
	xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	parav@nvidia.com, feliu@nvidia.com, hengqi@linux.alibaba.com
Subject: Re: [PATCH virtio v2 10/13] virtio_pci_modern: create admin queue of queried size
Date: Sun, 14 Jul 2024 03:55:12 -0400	[thread overview]
Message-ID: <20240714035231-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20240710063601.2000149-11-jiri@resnulli.us>

On Wed, Jul 10, 2024 at 08:35:58AM +0200, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> Don't limit the admin queue size to VIRTIO_AVQ_SGS_MAX and rather rely
> on the queried queue size.
> 
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>

I have some doubts about this one. Can't we limit the size to something
sensible? E.g. max number of CPUs? Number of VFs? I don't see why we
should just follow what device did blindly, the device has no idea about
use so would tend to over-provision.

> ---
>  drivers/virtio/virtio_pci_modern.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index 5ceb4b2c18df..a649c9dc436d 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -550,8 +550,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
>  	if (index >= vp_modern_get_num_queues(mdev) && !is_avq)
>  		return ERR_PTR(-EINVAL);
>  
> -	num = is_avq ?
> -		VIRTIO_AVQ_SGS_MAX : vp_modern_get_queue_size(mdev, index);
> +	num = vp_modern_get_queue_size(mdev, index);
>  	/* Check if queue is either not available or already active. */
>  	if (!num || vp_modern_get_queue_enable(mdev, index))
>  		return ERR_PTR(-ENOENT);
> -- 
> 2.45.2


  reply	other threads:[~2024-07-14  7:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10  6:35 [PATCH virtio v2 00/13] virtio_pci_modern: allow parallel admin queue commands execution Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 01/13] virtio_pci: push out single vq find code to vp_find_one_vq_msix() Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 02/13] virtio_pci: simplify vp_request_msix_vectors() call a bit Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 03/13] virtio_pci: pass vector policy enum to vp_find_vqs_msix() Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 04/13] virtio_pci: pass vector policy enum to vp_find_one_vq_msix() Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 05/13] virtio_pci: introduce vector allocation fallback for slow path virtqueues Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 06/13] virtio_pci_modern: treat vp_dev->admin_vq.info.vq pointer as static Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 07/13] virtio: push out code to vp_avq_index() Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 08/13] virtio_pci: pass vq info as an argument to vp_setup_vq() Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 09/13] virtio: create admin queues alongside other virtqueues Jiri Pirko
2024-07-10  6:35 ` [PATCH virtio v2 10/13] virtio_pci_modern: create admin queue of queried size Jiri Pirko
2024-07-14  7:55   ` Michael S. Tsirkin [this message]
2024-07-14 14:28     ` Parav Pandit
2024-07-15  7:57       ` Jiri Pirko
2024-07-15  9:03         ` Michael S. Tsirkin
2024-07-10  6:35 ` [PATCH virtio v2 11/13] virtio_pci_modern: pass cmd as an identification token Jiri Pirko
2024-07-10  6:36 ` [PATCH virtio v2 12/13] virtio_pci_modern: use completion instead of busy loop to wait on admin cmd result Jiri Pirko
2024-07-10 11:47   ` Michael S. Tsirkin
2024-07-10 13:03     ` Jiri Pirko
2024-07-10 13:06       ` Michael S. Tsirkin
2024-07-11  8:10         ` Jiri Pirko
2024-07-11  8:19           ` Michael S. Tsirkin
2024-07-11 12:46             ` Jiri Pirko
2024-07-10  6:36 ` [PATCH virtio v2 13/13] virtio_pci_modern: remove admin queue serialization lock Jiri Pirko

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=20240714035231-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=feliu@nvidia.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=parav@nvidia.com \
    --cc=virtualization@lists.linux.dev \
    --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;
as well as URLs for NNTP newsgroup(s).