diff options
author | Jiri Pirko | 2024-07-08 09:48:01 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2024-07-17 05:20:57 -0400 |
commit | 3c93b576e038577490e8b906025e38b6fd7241b3 (patch) | |
tree | 2a3a97b2445d0720a213442f26dce2fa6f0a75b9 /drivers/virtio | |
parent | ad9a12576bccd4cf1bbef7f8574421804cdff403 (diff) |
virtio: convert find_vqs() op implementations to find_vqs_info()
Convert existing find_vqs() transport implementations
to use find_vqs_info() config op.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240708074814.1739223-7-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_mmio.c | 14 | ||||
-rw-r--r-- | drivers/virtio/virtio_vdpa.c | 15 |
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 173596589c71..57903685d505 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -489,9 +489,7 @@ error_available: static int vm_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], - vq_callback_t *callbacks[], - const char * const names[], - const bool *ctx, + struct virtqueue_info vqs_info[], struct irq_affinity *desc) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); @@ -510,13 +508,15 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned int nvqs, enable_irq_wake(irq); for (i = 0; i < nvqs; ++i) { - if (!names[i]) { + struct virtqueue_info *vqi = &vqs_info[i]; + + if (!vqi->name) { vqs[i] = NULL; continue; } - vqs[i] = vm_setup_vq(vdev, queue_idx++, callbacks[i], names[i], - ctx ? ctx[i] : false); + vqs[i] = vm_setup_vq(vdev, queue_idx++, vqi->callback, + vqi->name, vqi->ctx); if (IS_ERR(vqs[i])) { vm_del_vqs(vdev); return PTR_ERR(vqs[i]); @@ -570,7 +570,7 @@ static const struct virtio_config_ops virtio_mmio_config_ops = { .get_status = vm_get_status, .set_status = vm_set_status, .reset = vm_reset, - .find_vqs = vm_find_vqs, + .find_vqs_info = vm_find_vqs, .del_vqs = vm_del_vqs, .get_features = vm_get_features, .finalize_features = vm_finalize_features, diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index e803db0da307..bc86d81c7cd2 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -358,9 +358,7 @@ create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], - vq_callback_t *callbacks[], - const char * const names[], - const bool *ctx, + struct virtqueue_info vqs_info[], struct irq_affinity *desc) { struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev); @@ -379,14 +377,15 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs, } for (i = 0; i < nvqs; ++i) { - if (!names[i]) { + struct virtqueue_info *vqi = &vqs_info[i]; + + if (!vqi->name) { vqs[i] = NULL; continue; } - vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, - callbacks[i], names[i], ctx ? - ctx[i] : false); + vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, vqi->callback, + vqi->name, vqi->ctx); if (IS_ERR(vqs[i])) { err = PTR_ERR(vqs[i]); goto err_setup_vq; @@ -470,7 +469,7 @@ static const struct virtio_config_ops virtio_vdpa_config_ops = { .get_status = virtio_vdpa_get_status, .set_status = virtio_vdpa_set_status, .reset = virtio_vdpa_reset, - .find_vqs = virtio_vdpa_find_vqs, + .find_vqs_info = virtio_vdpa_find_vqs, .del_vqs = virtio_vdpa_del_vqs, .get_features = virtio_vdpa_get_features, .finalize_features = virtio_vdpa_finalize_features, |