Skip to content

Commit 9e82eb5

Browse files
committed
virtio_vdpa: Revert "virtio_vdpa: support the arg sizes of find_vqs()"
This reverts commit 99e8927: 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: 99e8927 ("virtio_vdpa: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin <[email protected]> Message-Id: <[email protected]>
1 parent 13aa8c6 commit 9e82eb5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/virtio/virtio_vdpa.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static irqreturn_t virtio_vdpa_virtqueue_cb(void *private)
131131
static struct virtqueue *
132132
virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
133133
void (*callback)(struct virtqueue *vq),
134-
const char *name, u32 size, bool ctx)
134+
const char *name, bool ctx)
135135
{
136136
struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
137137
struct vdpa_device *vdpa = vd_get_vdpa(vdev);
@@ -168,17 +168,14 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
168168
goto error_new_virtqueue;
169169
}
170170

171-
if (!size || size > max_num)
172-
size = max_num;
173-
174171
if (ops->get_vq_num_min)
175172
min_num = ops->get_vq_num_min(vdpa);
176173

177-
may_reduce_num = (size == min_num) ? false : true;
174+
may_reduce_num = (max_num == min_num) ? false : true;
178175

179176
/* Create the vring */
180177
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,
182179
true, may_reduce_num, ctx,
183180
virtio_vdpa_notify, callback, name);
184181
if (!vq) {
@@ -288,9 +285,9 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
288285
continue;
289286
}
290287

291-
vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, callbacks[i],
292-
names[i], sizes ? sizes[i] : 0,
293-
ctx ? ctx[i] : false);
288+
vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++,
289+
callbacks[i], names[i], ctx ?
290+
ctx[i] : false);
294291
if (IS_ERR(vqs[i])) {
295292
err = PTR_ERR(vqs[i]);
296293
goto err_setup_vq;

0 commit comments

Comments
 (0)