Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2016 21:32:04 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309119 - head/sys/dev/virtio/pci
Message-ID:  <201611242132.uAOLW4Pr044547@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Nov 24 21:32:04 2016
New Revision: 309119
URL: https://svnweb.freebsd.org/changeset/base/309119

Log:
  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

Modified:
  head/sys/dev/virtio/pci/virtio_pci.c

Modified: head/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.c	Thu Nov 24 21:14:22 2016	(r309118)
+++ head/sys/dev/virtio/pci/virtio_pci.c	Thu Nov 24 21:32:04 2016	(r309119)
@@ -1087,7 +1087,8 @@ vtpci_set_host_msix_vectors(struct vtpci
 		 * 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++;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611242132.uAOLW4Pr044547>