git: 180c02405b12 - main - virtio: remove virtio_alloc_virtqueues' flags arg
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 18 Sep 2023 20:04:44 UTC
The branch main has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=180c02405b12e08bbb69bb693a38077db0c85e9b commit 180c02405b12e08bbb69bb693a38077db0c85e9b Author: Mina Galić <freebsd@igalic.co> AuthorDate: 2023-09-18 20:02:42 +0000 Commit: Olivier Houchard <cognet@FreeBSD.org> CommitDate: 2023-09-18 20:03:31 +0000 virtio: remove virtio_alloc_virtqueues' flags arg Summary: the flags argument is unused. Its initial design idea has been superceded by the addition of virtio_setup_intr and related APIs. Sponsored by: The FreeBSD Foundation Reviewers: bryanv Reviewed By: bryanv Subscribers: cognet, imp Differential Revision: https://reviews.freebsd.org/D41850 --- sys/dev/virtio/balloon/virtio_balloon.c | 2 +- sys/dev/virtio/block/virtio_blk.c | 2 +- sys/dev/virtio/console/virtio_console.c | 2 +- sys/dev/virtio/gpu/virtio_gpu.c | 2 +- sys/dev/virtio/mmio/virtio_mmio.c | 4 ++-- sys/dev/virtio/network/if_vtnet.c | 12 ++---------- sys/dev/virtio/pci/virtio_pci.c | 2 +- sys/dev/virtio/pci/virtio_pci.h | 2 +- sys/dev/virtio/pci/virtio_pci_legacy.c | 6 +++--- sys/dev/virtio/pci/virtio_pci_modern.c | 6 +++--- sys/dev/virtio/random/virtio_random.c | 2 +- sys/dev/virtio/scsi/virtio_scsi.c | 2 +- sys/dev/virtio/virtio.c | 5 ++--- sys/dev/virtio/virtio.h | 2 +- sys/dev/virtio/virtio_bus_if.m | 1 - 15 files changed, 21 insertions(+), 31 deletions(-) diff --git a/sys/dev/virtio/balloon/virtio_balloon.c b/sys/dev/virtio/balloon/virtio_balloon.c index c5d0e54dbee4..e1c373291d0b 100644 --- a/sys/dev/virtio/balloon/virtio_balloon.c +++ b/sys/dev/virtio/balloon/virtio_balloon.c @@ -314,7 +314,7 @@ vtballoon_alloc_virtqueues(struct vtballoon_softc *sc) VQ_ALLOC_INFO_INIT(&vq_info[1], 0, vtballoon_vq_intr, sc, &sc->vtballoon_deflate_vq, "%s deflate", device_get_nameunit(dev)); - return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); + return (virtio_alloc_virtqueues(dev, nvqs, vq_info)); } static void diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c index eb693c7f2f51..43952a93dc75 100644 --- a/sys/dev/virtio/block/virtio_blk.c +++ b/sys/dev/virtio/block/virtio_blk.c @@ -707,7 +707,7 @@ vtblk_alloc_virtqueue(struct vtblk_softc *sc) vtblk_vq_intr, sc, &sc->vtblk_vq, "%s request", device_get_nameunit(dev)); - return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info)); + return (virtio_alloc_virtqueues(dev, 1, &vq_info)); } static void diff --git a/sys/dev/virtio/console/virtio_console.c b/sys/dev/virtio/console/virtio_console.c index d8048d0f1f6e..b69a473cf8a4 100644 --- a/sys/dev/virtio/console/virtio_console.c +++ b/sys/dev/virtio/console/virtio_console.c @@ -543,7 +543,7 @@ vtcon_alloc_virtqueues(struct vtcon_softc *sc) portidx++; } - error = virtio_alloc_virtqueues(dev, 0, nvqs, info); + error = virtio_alloc_virtqueues(dev, nvqs, info); free(info, M_TEMP); return (error); diff --git a/sys/dev/virtio/gpu/virtio_gpu.c b/sys/dev/virtio/gpu/virtio_gpu.c index 0472bc98b3ba..0009d7bb3ec1 100644 --- a/sys/dev/virtio/gpu/virtio_gpu.c +++ b/sys/dev/virtio/gpu/virtio_gpu.c @@ -429,7 +429,7 @@ vtgpu_alloc_virtqueue(struct vtgpu_softc *sc) VQ_ALLOC_INFO_INIT(&vq_info[0], 0, NULL, sc, &sc->vtgpu_ctrl_vq, "%s control", device_get_nameunit(dev)); - return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); + return (virtio_alloc_virtqueues(dev, nvqs, vq_info)); } static int diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index 6059ef76eceb..c706f91ecd15 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -76,7 +76,7 @@ static int vtmmio_finalize_features(device_t); static bool vtmmio_with_feature(device_t, uint64_t); static void vtmmio_set_virtqueue(struct vtmmio_softc *sc, struct virtqueue *vq, uint32_t size); -static int vtmmio_alloc_virtqueues(device_t, int, int, +static int vtmmio_alloc_virtqueues(device_t, int, struct vq_alloc_info *); static int vtmmio_setup_intr(device_t, enum intr_type); static void vtmmio_stop(device_t); @@ -537,7 +537,7 @@ vtmmio_set_virtqueue(struct vtmmio_softc *sc, struct virtqueue *vq, } static int -vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs, +vtmmio_alloc_virtqueues(device_t dev, int nvqs, struct vq_alloc_info *vq_info) { struct vtmmio_virtqueue *vqx; diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index f7ad385b3955..6445a9ebb998 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1018,10 +1018,9 @@ vtnet_alloc_virtqueues(struct vtnet_softc *sc) struct vq_alloc_info *info; struct vtnet_rxq *rxq; struct vtnet_txq *txq; - int i, idx, flags, nvqs, error; + int i, idx, nvqs, error; dev = sc->vtnet_dev; - flags = 0; nvqs = sc->vtnet_max_vq_pairs * 2; if (sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) @@ -1059,14 +1058,7 @@ vtnet_alloc_virtqueues(struct vtnet_softc *sc) &sc->vtnet_ctrl_vq, "%s ctrl", device_get_nameunit(dev)); } - /* - * TODO: Enable interrupt binding if this is multiqueue. This will - * only matter when per-virtqueue MSIX is available. - */ - if (sc->vtnet_flags & VTNET_FLAG_MQ) - flags |= 0; - - error = virtio_alloc_virtqueues(dev, flags, nvqs, info); + error = virtio_alloc_virtqueues(dev, nvqs, info); free(info, M_TEMP); return (error); diff --git a/sys/dev/virtio/pci/virtio_pci.c b/sys/dev/virtio/pci/virtio_pci.c index 1470dc83949c..b9aa36ef6d0f 100644 --- a/sys/dev/virtio/pci/virtio_pci.c +++ b/sys/dev/virtio/pci/virtio_pci.c @@ -324,7 +324,7 @@ vtpci_write_ivar(struct vtpci_common *cn, int index, uintptr_t value) } int -vtpci_alloc_virtqueues(struct vtpci_common *cn, int flags, int nvqs, +vtpci_alloc_virtqueues(struct vtpci_common *cn, int nvqs, struct vq_alloc_info *vq_info) { device_t dev; diff --git a/sys/dev/virtio/pci/virtio_pci.h b/sys/dev/virtio/pci/virtio_pci.h index 401cba25bbf4..2449cfc2826c 100644 --- a/sys/dev/virtio/pci/virtio_pci.h +++ b/sys/dev/virtio/pci/virtio_pci.h @@ -122,7 +122,7 @@ bool vtpci_with_feature(struct vtpci_common *cn, uint64_t feature); int vtpci_read_ivar(struct vtpci_common *cn, int index, uintptr_t *result); int vtpci_write_ivar(struct vtpci_common *cn, int index, uintptr_t value); -int vtpci_alloc_virtqueues(struct vtpci_common *cn, int flags, int nvqs, +int vtpci_alloc_virtqueues(struct vtpci_common *cn, int nvqs, struct vq_alloc_info *vq_info); int vtpci_setup_interrupts(struct vtpci_common *cn, enum intr_type type); void vtpci_release_child_resources(struct vtpci_common *cn); diff --git a/sys/dev/virtio/pci/virtio_pci_legacy.c b/sys/dev/virtio/pci/virtio_pci_legacy.c index 72d637fb0f55..9853546e1af2 100644 --- a/sys/dev/virtio/pci/virtio_pci_legacy.c +++ b/sys/dev/virtio/pci/virtio_pci_legacy.c @@ -87,7 +87,7 @@ static int vtpci_legacy_register_vq_msix(device_t, int idx, static uint64_t vtpci_legacy_negotiate_features(device_t, uint64_t); static bool vtpci_legacy_with_feature(device_t, uint64_t); -static int vtpci_legacy_alloc_virtqueues(device_t, int, int, +static int vtpci_legacy_alloc_virtqueues(device_t, int, struct vq_alloc_info *); static int vtpci_legacy_setup_interrupts(device_t, enum intr_type); static void vtpci_legacy_stop(device_t); @@ -390,7 +390,7 @@ vtpci_legacy_with_feature(device_t dev, uint64_t feature) } static int -vtpci_legacy_alloc_virtqueues(device_t dev, int flags, int nvqs, +vtpci_legacy_alloc_virtqueues(device_t dev, int nvqs, struct vq_alloc_info *vq_info) { struct vtpci_legacy_softc *sc; @@ -399,7 +399,7 @@ vtpci_legacy_alloc_virtqueues(device_t dev, int flags, int nvqs, sc = device_get_softc(dev); cn = &sc->vtpci_common; - return (vtpci_alloc_virtqueues(cn, flags, nvqs, vq_info)); + return (vtpci_alloc_virtqueues(cn, nvqs, vq_info)); } static int diff --git a/sys/dev/virtio/pci/virtio_pci_modern.c b/sys/dev/virtio/pci/virtio_pci_modern.c index 84d9511798e0..6e3b08e244c0 100644 --- a/sys/dev/virtio/pci/virtio_pci_modern.c +++ b/sys/dev/virtio/pci/virtio_pci_modern.c @@ -112,7 +112,7 @@ static int vtpci_modern_register_vq_msix(device_t, int idx, static uint64_t vtpci_modern_negotiate_features(device_t, uint64_t); static int vtpci_modern_finalize_features(device_t); static bool vtpci_modern_with_feature(device_t, uint64_t); -static int vtpci_modern_alloc_virtqueues(device_t, int, int, +static int vtpci_modern_alloc_virtqueues(device_t, int, struct vq_alloc_info *); static int vtpci_modern_setup_interrupts(device_t, enum intr_type); static void vtpci_modern_stop(device_t); @@ -507,7 +507,7 @@ vtpci_modern_write_features(struct vtpci_modern_softc *sc, uint64_t features) } static int -vtpci_modern_alloc_virtqueues(device_t dev, int flags, int nvqs, +vtpci_modern_alloc_virtqueues(device_t dev, int nvqs, struct vq_alloc_info *vq_info) { struct vtpci_modern_softc *sc; @@ -524,7 +524,7 @@ vtpci_modern_alloc_virtqueues(device_t dev, int flags, int nvqs, return (E2BIG); } - return (vtpci_alloc_virtqueues(cn, flags, nvqs, vq_info)); + return (vtpci_alloc_virtqueues(cn, nvqs, vq_info)); } static int diff --git a/sys/dev/virtio/random/virtio_random.c b/sys/dev/virtio/random/virtio_random.c index d54e2e6b70d4..0b6ee1dcbf6b 100644 --- a/sys/dev/virtio/random/virtio_random.c +++ b/sys/dev/virtio/random/virtio_random.c @@ -265,7 +265,7 @@ vtrnd_alloc_virtqueue(struct vtrnd_softc *sc) VQ_ALLOC_INFO_INIT(&vq_info, 0, NULL, sc, &sc->vtrnd_vq, "%s request", device_get_nameunit(dev)); - return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info)); + return (virtio_alloc_virtqueues(dev, 1, &vq_info)); } static void diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c index 0355962c7af9..f6278434e5f9 100644 --- a/sys/dev/virtio/scsi/virtio_scsi.c +++ b/sys/dev/virtio/scsi/virtio_scsi.c @@ -504,7 +504,7 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc) vtscsi_request_vq_intr, sc, &sc->vtscsi_request_vq, "%s request", device_get_nameunit(dev)); - return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); + return (virtio_alloc_virtqueues(dev, nvqs, vq_info)); } static void diff --git a/sys/dev/virtio/virtio.c b/sys/dev/virtio/virtio.c index 45a657542e28..8cfb045183b8 100644 --- a/sys/dev/virtio/virtio.c +++ b/sys/dev/virtio/virtio.c @@ -260,12 +260,11 @@ virtio_finalize_features(device_t dev) } int -virtio_alloc_virtqueues(device_t dev, int flags, int nvqs, +virtio_alloc_virtqueues(device_t dev, int nvqs, struct vq_alloc_info *info) { - return (VIRTIO_BUS_ALLOC_VIRTQUEUES(device_get_parent(dev), flags, - nvqs, info)); + return (VIRTIO_BUS_ALLOC_VIRTQUEUES(device_get_parent(dev), nvqs, info)); } int diff --git a/sys/dev/virtio/virtio.h b/sys/dev/virtio/virtio.h index 96ebaf653428..855dafd63033 100644 --- a/sys/dev/virtio/virtio.h +++ b/sys/dev/virtio/virtio.h @@ -103,7 +103,7 @@ void virtio_read_ivar(device_t dev, int ivar, uintptr_t *val); void virtio_write_ivar(device_t dev, int ivar, uintptr_t val); uint64_t virtio_negotiate_features(device_t dev, uint64_t child_features); int virtio_finalize_features(device_t dev); -int virtio_alloc_virtqueues(device_t dev, int flags, int nvqs, +int virtio_alloc_virtqueues(device_t dev, int nvqs, struct vq_alloc_info *info); int virtio_setup_intr(device_t dev, enum intr_type type); bool virtio_with_feature(device_t dev, uint64_t feature); diff --git a/sys/dev/virtio/virtio_bus_if.m b/sys/dev/virtio/virtio_bus_if.m index 848c6ac05b62..57ae90bdc917 100644 --- a/sys/dev/virtio/virtio_bus_if.m +++ b/sys/dev/virtio/virtio_bus_if.m @@ -63,7 +63,6 @@ METHOD bool with_feature { METHOD int alloc_virtqueues { device_t dev; - int flags; int nvqs; struct vq_alloc_info *info; };