virtio_pci - Fix vtpci_reinit MSI-X vector reinitialization.
virtio - Get rid of unused flags option in virtio_alloc_virtqueues().
virtio - Move virtqueue_pending() checks into the child driver.* This makes it easier for now, to deal with virtqueue locking, when multiple virtqueues are mapped to a single interrupt vector.
virtio - Get rid of config_change devmethod, treat like vq interrupts.
virtio - Specify handler and argument in bind_intr, instead of vq alloc.
virtio - Refactor virtio bus API, to untangle virtuques from IRQ allocation.* These API changes allow each virtio device driver to explicitly control the assignment of virtqueues to IRQ vectors.
virtio - Refactor virtio bus API, to untangle virtuques from IRQ allocation.* These API changes allow each virtio device driver to explicitly control the assignment of virtqueues to IRQ vectors.* This allows explicitly assigning IRQ vectors to cpus. And virtio device drivers also get to know, on which cpu each virtqueue interrupt is running.
show more ...
virtio_pci - Remove int return value from interrupt handler functions.
virtio: Fix and activate PCI MSI-X support.* Change pci_msi_blacklisted() test to always assume working MSI and MSI-X interrupts on virtual-machines. We should assume that a hypervisor without
virtio: Fix and activate PCI MSI-X support.* Change pci_msi_blacklisted() test to always assume working MSI and MSI-X interrupts on virtual-machines. We should assume that a hypervisor without MSI or MSI-X support shouldn't even indicate supported MSI(-X) via the PCI config space.* Move vtblk_alloc_disk() to the end of virtio_blk's attach method. This avoids a race between irq enabling in virtio, and the disk probing.* Fix allocation and teardown of MSI-X interrupts.* Get rid of rather confusing VIRTIO_PCI_FLAG_NO_MSI and VIRTIO_PCI_FLAG_NO_MSIX flags. The VIRTIO_PCI_FLAG_NO_MSI is unneeded when using pci_alloc_1intr() for MSI allocation, and instead of VIRTIO_PCI_FLAG_NO_MSIX we can just check sc->vtpci_msix_res.* For now, MSI-X vectors are simply assigned to subsequent cores (plus adding the device_get_unit() value to shuffle things a bit), i.e.: (device_get_unit(dev) + cnt) % ncpus* For the if_vtnet network driver this means that the rx and tx queues run on different cores, but both queues still use the same serializer for now.* One major advantages in using MSI-X interrupts instead of the legacy IRQ is, that this avoids interrupt sharing in many virtual-machine configurations.* Tested on qemu with TCG (unaccelerated emulation) and 1 core, and with KVM acceleration and 2 cores, with both virtio network and disk devices.
virtio: Fix MSI support; thus unbreak booting on bhyveI'd like to thank Peter Grehan <grehan freebsd org> very much forproviding various information on bhyve side and helping testingthis patch.
kernel/virtio: Some small stylistic cleanup.
virtio_pci: Use device_probe_and_attach(), instead of DEVICE_ATTACH().* By directly calling DEVICE_ATTACH(), we didn't get automatically created sysctl nodes (added in 8e4d13764bdfc916c23fb22158c
virtio_pci: Use device_probe_and_attach(), instead of DEVICE_ATTACH().* By directly calling DEVICE_ATTACH(), we didn't get automatically created sysctl nodes (added in 8e4d13764bdfc916c23fb22158c65e486dce631c), and we didn't get automatic dmesg messages on child driver attachement (e.g. "vtblk0: <VirtIO Block Adapter> on virtio_pci1") .* Since we have no direct equivalent to FreeBSD's device_attach(), use device_probe_and_attach(). This means we do a vtpci_set_status() cycle even if no matching driver is found.
kernel/dev: Remove some #include duplicates.
kernel: Use NULL for pointers in DRIVER_MODULE()s.
kernel/virtio: Fix -Wundef.
kernel: Use DEVMETHOD_END in the drivers.
kernel/virtio: Remove some unneeded inclusions of <sys/cdefs.h>.
kernel -- virtio: Implement virtio-layer lwkt_serializer for devices* Switch virtio device targets (currently only -blk) to use a serializer for synchronizing per-target state. Thread the seria
kernel -- virtio: Implement virtio-layer lwkt_serializer for devices* Switch virtio device targets (currently only -blk) to use a serializer for synchronizing per-target state. Thread the serializer through virtqueue_notify (release around kick) and into the bus interrupt setup code.* Remove dump support from virtio-blk for now; it doesn't work and results in further panics from an incorrectly setup bio.* Other cleanups of virtio-blk (de-indirect locks).
Build fixes.
kernel/virtio: Some cleanup (Makefiles and gcc47 warnings).
kernel -- Import virtio & virtio-block drivers.virtio-blk provides a paravirtualized storage controller, with onedisk per virtio device.This driver is based on Tim Bisson's port of FreeBSD's vir
kernel -- Import virtio & virtio-block drivers.virtio-blk provides a paravirtualized storage controller, with onedisk per virtio device.This driver is based on Tim Bisson's port of FreeBSD's virtio andvirtio-blk devices. Differences from Tim's port:* Import all FreeBSD updates from 4/16 on.* Remove indirect descriptor support from virtio device.* Mark devices as D_MPSAFE; removes mplock around disk routines, they are all correctly self-synchronized.* Implement devstat support.* Move I/O completion routine to threaded taskqueue.* Do not hold target spinlock around virtqueue notify.* Move objcache caches to kmalloc.