diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-19 11:57:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-19 11:57:55 -0700 |
| commit | f4f92db4391285ef3a688cdad25d5c76db200a30 (patch) | |
| tree | f13b26b236e6a2f124cfec88ee14ca9ca872624c /drivers/block | |
| parent | Merge tag 'vfio-v6.11-rc1' of https://github.com/awilliam/linux-vfio (diff) | |
| parent | virtio: rename virtio_find_vqs_info() to virtio_find_vqs() (diff) | |
| download | linux-f4f92db4391285ef3a688cdad25d5c76db200a30.tar.gz linux-f4f92db4391285ef3a688cdad25d5c76db200a30.zip | |
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio updates from Michael Tsirkin:
"Several new features here:
- Virtio find vqs API has been reworked (required to fix the
scalability issue we have with adminq, which I hope to merge later
in the cycle)
- vDPA driver for Marvell OCTEON
- virtio fs performance improvement
- mlx5 migration speedups
Fixes, cleanups all over the place"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (56 commits)
virtio: rename virtio_find_vqs_info() to virtio_find_vqs()
virtio: remove unused virtio_find_vqs() and virtio_find_vqs_ctx() helpers
virtio: convert the rest virtio_find_vqs() users to virtio_find_vqs_info()
virtio_balloon: convert to use virtio_find_vqs_info()
virtiofs: convert to use virtio_find_vqs_info()
scsi: virtio_scsi: convert to use virtio_find_vqs_info()
virtio_net: convert to use virtio_find_vqs_info()
virtio_crypto: convert to use virtio_find_vqs_info()
virtio_console: convert to use virtio_find_vqs_info()
virtio_blk: convert to use virtio_find_vqs_info()
virtio: rename find_vqs_info() op to find_vqs()
virtio: remove the original find_vqs() op
virtio: call virtio_find_vqs_info() from virtio_find_single_vq() directly
virtio: convert find_vqs() op implementations to find_vqs_info()
virtio_pci: convert vp_*find_vqs() ops to find_vqs_info()
virtio: introduce virtio_queue_info struct and find_vqs_info() config op
virtio: make virtio_find_single_vq() call virtio_find_vqs()
virtio: make virtio_find_vqs() call virtio_find_vqs_ctx()
caif_virtio: use virtio_find_single_vq() for single virtqueue finding
vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready()
...
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/virtio_blk.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index e3147a611151..194417abc105 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -964,8 +964,7 @@ static int init_vq(struct virtio_blk *vblk) { int err; unsigned short i; - vq_callback_t **callbacks; - const char **names; + struct virtqueue_info *vqs_info; struct virtqueue **vqs; unsigned short num_vqs; unsigned short num_poll_vqs; @@ -1002,28 +1001,26 @@ static int init_vq(struct virtio_blk *vblk) if (!vblk->vqs) return -ENOMEM; - names = kmalloc_array(num_vqs, sizeof(*names), GFP_KERNEL); - callbacks = kmalloc_array(num_vqs, sizeof(*callbacks), GFP_KERNEL); + vqs_info = kcalloc(num_vqs, sizeof(*vqs_info), GFP_KERNEL); vqs = kmalloc_array(num_vqs, sizeof(*vqs), GFP_KERNEL); - if (!names || !callbacks || !vqs) { + if (!vqs_info || !vqs) { err = -ENOMEM; goto out; } for (i = 0; i < num_vqs - num_poll_vqs; i++) { - callbacks[i] = virtblk_done; + vqs_info[i].callback = virtblk_done; snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%u", i); - names[i] = vblk->vqs[i].name; + vqs_info[i].name = vblk->vqs[i].name; } for (; i < num_vqs; i++) { - callbacks[i] = NULL; snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%u", i); - names[i] = vblk->vqs[i].name; + vqs_info[i].name = vblk->vqs[i].name; } /* Discover virtqueues and write information to configuration. */ - err = virtio_find_vqs(vdev, num_vqs, vqs, callbacks, names, &desc); + err = virtio_find_vqs(vdev, num_vqs, vqs, vqs_info, &desc); if (err) goto out; @@ -1035,8 +1032,7 @@ static int init_vq(struct virtio_blk *vblk) out: kfree(vqs); - kfree(callbacks); - kfree(names); + kfree(vqs_info); if (err) kfree(vblk->vqs); return err; |
