Xuan Zhuo
2022-Feb-14 08:39 UTC
[PATCH] virtio_pci: remove the check that queue size is power of 2
Based on the spec below, we no longer require the queue size of PCI is
power of 2. In the case of a packed ring, it is reasonable that this
value is not power of 2.
https://github.com/oasis-tcs/virtio-spec/issues/28
And there is a check for this in vring_create_virtqueue_split() . So
this check can be removed here.
Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
---
drivers/virtio/virtio_pci_modern.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/virtio/virtio_pci_modern.c
b/drivers/virtio/virtio_pci_modern.c
index 5455bc041fb6..ce7bde0b7612 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -203,11 +203,6 @@ static struct virtqueue *setup_vq(struct virtio_pci_device
*vp_dev,
if (!num || vp_modern_get_queue_enable(mdev, index))
return ERR_PTR(-ENOENT);
- if (num & (num - 1)) {
- dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
num);
- return ERR_PTR(-EINVAL);
- }
-
info->msix_vector = msix_vec;
/* create the vring */
--
2.31.0