mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
virtio_pci: Revert "virtio_pci: support the arg sizes of find_vqs()"
This reverts commitcdb44806fc: the legacy path is wrong and in fact can not support the proposed API since for a legacy device we never communicate the vq size to the hypervisor. Reported-by: Andres Freund <andres@anarazel.de> Fixes:cdb44806fc("virtio_pci: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220816053602.173815-5-mst@redhat.com>
This commit is contained in:
@@ -293,7 +293,6 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
|
||||
unsigned int index,
|
||||
void (*callback)(struct virtqueue *vq),
|
||||
const char *name,
|
||||
u32 size,
|
||||
bool ctx,
|
||||
u16 msix_vec)
|
||||
{
|
||||
@@ -311,18 +310,15 @@ 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 (!size || size > num)
|
||||
size = num;
|
||||
|
||||
if (size & (size - 1)) {
|
||||
dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", size);
|
||||
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 */
|
||||
vq = vring_create_virtqueue(index, size,
|
||||
vq = vring_create_virtqueue(index, num,
|
||||
SMP_CACHE_BYTES, &vp_dev->vdev,
|
||||
true, true, ctx,
|
||||
vp_notify, callback, name);
|
||||
|
||||
Reference in New Issue
Block a user