mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
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
This commit is contained in:
parent
ccb576a83c
commit
180c02405b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -63,7 +63,6 @@ METHOD bool with_feature {
|
|||
|
||||
METHOD int alloc_virtqueues {
|
||||
device_t dev;
|
||||
int flags;
|
||||
int nvqs;
|
||||
struct vq_alloc_info *info;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue