aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2016-11-24 21:32:04 +0000
committerAndriy Gapon <avg@FreeBSD.org>2016-11-24 21:32:04 +0000
commit18ec6fbc3a51e1f237a17ed6a702ae3cf36833aa (patch)
treeaf0d431f941c18948890edf03ecfcf42c8870817 /sys/dev/virtio
parent8be1b98cae8226d4d75e5e67537be97f0702812d (diff)
downloadsrc-18ec6fbc3a51e1f237a17ed6a702ae3cf36833aa.tar.gz
src-18ec6fbc3a51e1f237a17ed6a702ae3cf36833aa.zip
virtio_pci: fix announcement of MSI-X interrupts for queues
Queues that do not need interrupts - for instance, output queues - do not have a corresponding entry in vtpci_msix_vq_interrupts. So, it was wrong to increment a pointer into that array when iterating over such a queue. I ran into this bug while trying to use virtio_console(4) that allocates a lot of queues with every other being an output queue without an interrupt handler (if MultiplePorts feature is negotiated). MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=309119
Diffstat (limited to 'sys/dev/virtio')
-rw-r--r--sys/dev/virtio/pci/virtio_pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/virtio/pci/virtio_pci.c b/sys/dev/virtio/pci/virtio_pci.c
index c4f81fda6f5c..121351fda26b 100644
--- a/sys/dev/virtio/pci/virtio_pci.c
+++ b/sys/dev/virtio/pci/virtio_pci.c
@@ -1087,7 +1087,8 @@ vtpci_set_host_msix_vectors(struct vtpci_softc *sc)
* For shared MSIX, all the virtqueues share the first
* interrupt.
*/
- if ((sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
+ if (!sc->vtpci_vqs[idx].vtv_no_intr &&
+ (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
intr++;
}