On Wed, Jul 03, 2024 at 02:38:54PM +0200, Jiri Pirko wrote: > From: Jiri Pirko <jiri@xxxxxxxxxx> > > Currently, virtio_find_vqs() and virtio_find_vqs_ctx() accept array of > names, callbacks and ctx (in case of the second one) as separate args. > That became inconvenient as the ctx addition showed. > > For virtio_net control queue, an indication of queue flavour (slow path) > is going to be needed to be passed to PCI transport in order to > assign vectors properly, another array added to virtio_find_vqs_ctx() > arg list would not be nice and convenient. > > Instead, introduce a structure to carry vq callback, name and ctx. Pass > array of these structures to virtio_find_vqs() and all the way down to > transport find_vqs() op implementation. > > That allows to easily extend what needs to be passed down. Also, it > makes the code a bit more cleaner. We get rid of separate > virtio_find_vqs_ctx() helper. > > This patchset does the conversion in steps, using temporary _info() op > and helper. Note they are renamed back. Thanks a lot Jiri, looks very good. Some minor comments. > Patch #1 does one forgotten conversion to virtio_find_single_vq(). > Patches #2 and #3 do preparations for find_vqs_info() op introduction. > Patch #4 introduces new op find_vqs_info() to replace find_vqs() it also > introduces struct virtio_queue_info and virtio_find_vqs_info() helper. > Patches #5 and #6 convert transports to implement find_vqs_info() op > that accepts array of virtio_queue_info structs. > Patch #7 converts virtio_find_single_vq() to use the new way as well. > Patch #8 removes original find_vqs() op. > Patch #9 renames find_vqs_info() to find_vqs() and completes first part > of conversion this patches does. > Patches #10-#17 convert virtio_find_vqs() and virtio_find_vqs_ctx() > users to use new virtio_find_vqs_info() helper. > Patch #18 removes no longer used virtio_find_vqs() and > virtio_find_vqs_ctx() helpers. > Patch #19 finalizes the conversion by renaming virtio_find_vqs_info() > to virtio_find_vqs(). > > Jiri Pirko (19): > caif_virtio: use virtio_find_single_vq() for single virtqueue finding > virtio: make virtio_find_vqs() call virtio_find_vqs_ctx() > virtio: make virtio_find_single_vq() call virtio_find_vqs() > virtio: introduce virtio_queue_info struct and find_vqs_info() config > op > virtio_pci: convert vp_*find_vqs() ops to find_vqs_info() > virtio: convert find_vqs() op implementations to find_vqs_info() > virtio: call virtio_find_vqs_info() from virtio_find_single_vq() > directly > virtio: remove the original find_vqs() op > virtio: rename find_vqs_info() op to find_vqs() > virtio_blk: convert to use virtio_find_vqs_info() > virtio_console: convert to use virtio_find_vqs_info() > virtio_crypto: convert to use virtio_find_vqs_info() > virtio_net: convert to use virtio_find_vqs_info() > scsi: virtio_scsi: convert to use virtio_find_vqs_info() > virtiofs: convert to use virtio_find_vqs_info() > virtio_balloon: convert to use virtio_find_vqs_info() > virtio: convert the rest virtio_find_vqs() users to > virtio_find_vqs_info() > virtio: remove unused virtio_find_vqs() and virtio_find_vqs_ctx() > helpers > virtio: rename virtio_find_vqs_info() to virtio_find_vqs() > > arch/um/drivers/virt-pci.c | 8 ++- > arch/um/drivers/virtio_uml.c | 12 ++-- > drivers/block/virtio_blk.c | 20 +++---- > drivers/bluetooth/virtio_bt.c | 13 ++-- > drivers/char/virtio_console.c | 43 ++++++------- > drivers/crypto/virtio/virtio_crypto_core.c | 31 ++++------ > drivers/firmware/arm_scmi/virtio.c | 11 ++-- > drivers/gpio/gpio-virtio.c | 10 ++-- > drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++- > drivers/iommu/virtio-iommu.c | 11 ++-- > drivers/net/caif/caif_virtio.c | 8 +-- > drivers/net/virtio_net.c | 34 ++++------- > drivers/net/wireless/virtual/mac80211_hwsim.c | 12 ++-- > drivers/platform/mellanox/mlxbf-tmfifo.c | 10 ++-- > drivers/remoteproc/remoteproc_virtio.c | 12 ++-- > drivers/rpmsg/virtio_rpmsg_bus.c | 8 ++- > drivers/s390/virtio/virtio_ccw.c | 13 ++-- > drivers/scsi/virtio_scsi.c | 32 ++++------ > drivers/virtio/virtio_balloon.c | 32 ++++------ > drivers/virtio/virtio_input.c | 9 +-- > drivers/virtio/virtio_mmio.c | 12 ++-- > drivers/virtio/virtio_pci_common.c | 49 ++++++++------- > drivers/virtio/virtio_pci_common.h | 4 +- > drivers/virtio/virtio_pci_modern.c | 5 +- > drivers/virtio/virtio_vdpa.c | 13 ++-- > fs/fuse/virtio_fs.c | 22 +++---- > include/linux/virtio_config.h | 60 +++++++++---------- > net/vmw_vsock/virtio_transport.c | 16 ++--- > sound/virtio/virtio_card.c | 23 ++++--- > 29 files changed, 240 insertions(+), 302 deletions(-) > > -- > 2.45.2