From: "Michael S. Tsirkin" <mst@redhat.com>
To: Feng Liu <feliu@nvidia.com>
Cc: "virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
Jiri Pirko <jiri@nvidia.com>, Bodong Wang <bodong@nvidia.com>,
Gavin Li <gavinl@nvidia.com>
Subject: Re: [PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
Date: Sat, 11 Mar 2023 14:05:06 -0500 [thread overview]
Message-ID: <20230311140355-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <bd763bf7-0b8e-ba9e-cbd2-a0302e820cc6@nvidia.com>
On Fri, Mar 10, 2023 at 10:23:16AM -0500, Feng Liu wrote:
>
>
> On 2023-03-10 a.m.8:36, Parav Pandit wrote:
> >
> >
> > > From: Feng Liu <feliu@nvidia.com>
> > > Sent: Friday, March 10, 2023 12:34 AM
> >
> > >
> > > - if (!is_power_of_2(num)) {
> > > - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
> > > num);
> > > - return ERR_PTR(-EINVAL);
> > > - }
> > > -
> >
> > The check is still valid for split q.
> > Maybe the right place for such a check is not the pci transport driver.
> > But layer below where split vs packed q knowledge resides and hence, power of 2 check can be omitted for packed vq.
>
> Hi, Parav
> I think you are right, I checked the virtio spec, only packed virtqueue
> can use queue size which is not power_of_2; so, I think the check can be
> reserved only for split queue here, something like
>
> struct virtio_device *vdev = &vp_dev->vdev;
> if (!virtio_has_feature(vdev, VIRTIO_F_RING_PACKED)
> && !is_power_of_2(num)){
> dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", num);
> return ERR_PTR(-EINVAL);
> }
>
> I will fix it in next version
>
> Hi, Michael and Jason
> Do you have any comments on this?
>
Hmm good point. Which raises the question: so how did you test it then?
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-03-11 19:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 5:34 [PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci Feng Liu via Virtualization
2023-03-10 5:34 ` [PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues Feng Liu via Virtualization
2023-03-10 13:36 ` Parav Pandit via Virtualization
2023-03-10 15:23 ` Feng Liu via Virtualization
2023-03-11 19:05 ` Michael S. Tsirkin [this message]
2023-03-11 22:25 ` Feng Liu via Virtualization
2023-03-12 6:46 ` Michael S. Tsirkin
2023-03-12 12:05 ` Feng Liu via Virtualization
2023-03-10 5:34 ` [PATCH v2 2/3] virtio_ring: Avoid using inline for small functions Feng Liu via Virtualization
2023-03-10 5:34 ` [PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params Feng Liu via Virtualization
2023-03-10 8:06 ` [PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci Michael S. Tsirkin
2023-03-10 13:21 ` Feng Liu via Virtualization
2023-03-11 19:06 ` Michael S. Tsirkin
2023-03-11 22:19 ` Feng Liu via Virtualization
2023-03-12 6:47 ` Michael S. Tsirkin
2023-03-12 12:00 ` Feng Liu via Virtualization
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=20230311140355-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=bodong@nvidia.com \
--cc=feliu@nvidia.com \
--cc=gavinl@nvidia.com \
--cc=jiri@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.