Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio_vdpa: Revert "virtio_vdpa: support the arg sizes of find_vqs()"

This reverts commit 99e8927d8a4da8eb8a8a5904dc13a3156be8e7c0:
proposed API isn't supported on all transports but no
effort was made to address this.

It might not be hard to fix if we want to: maybe just rename size to
size_hint and make sure legacy transports ignore the hint.

But it's not sure what the benefit is in any case, so let's drop it.

Fixes: 99e8927d8a4d ("virtio_vdpa: support the arg sizes of find_vqs()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220816053602.173815-6-mst@redhat.com>

+6 -9
+6 -9
drivers/virtio/virtio_vdpa.c
··· 131 131 static struct virtqueue * 132 132 virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index, 133 133 void (*callback)(struct virtqueue *vq), 134 - const char *name, u32 size, bool ctx) 134 + const char *name, bool ctx) 135 135 { 136 136 struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev); 137 137 struct vdpa_device *vdpa = vd_get_vdpa(vdev); ··· 168 168 goto error_new_virtqueue; 169 169 } 170 170 171 - if (!size || size > max_num) 172 - size = max_num; 173 - 174 171 if (ops->get_vq_num_min) 175 172 min_num = ops->get_vq_num_min(vdpa); 176 173 177 - may_reduce_num = (size == min_num) ? false : true; 174 + may_reduce_num = (max_num == min_num) ? false : true; 178 175 179 176 /* Create the vring */ 180 177 align = ops->get_vq_align(vdpa); 181 - vq = vring_create_virtqueue(index, size, align, vdev, 178 + vq = vring_create_virtqueue(index, max_num, align, vdev, 182 179 true, may_reduce_num, ctx, 183 180 virtio_vdpa_notify, callback, name); 184 181 if (!vq) { ··· 285 288 continue; 286 289 } 287 290 288 - vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, callbacks[i], 289 - names[i], sizes ? sizes[i] : 0, 290 - ctx ? ctx[i] : false); 291 + vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, 292 + callbacks[i], names[i], ctx ? 293 + ctx[i] : false); 291 294 if (IS_ERR(vqs[i])) { 292 295 err = PTR_ERR(vqs[i]); 293 296 goto err_setup_vq;