From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sujpa-000164-A6 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 08:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SujpU-0003jl-GJ for qemu-devel@nongnu.org; Fri, 27 Jul 2012 08:39:46 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:47671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SujpU-0003jc-9c for qemu-devel@nongnu.org; Fri, 27 Jul 2012 08:39:40 -0400 Received: by pbbro12 with SMTP id ro12so4807151pbb.4 for ; Fri, 27 Jul 2012 05:39:39 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 27 Jul 2012 14:39:23 +0200 Message-Id: <1343392763-17308-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343392763-17308-1-git-send-email-pbonzini@redhat.com> References: <1343392763-17308-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] virtio-scsi: enable MSI-X support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org While virtio-scsi does support multiqueue, the default number of interrupt vectors is not enough to actually enable usage of multiple queues in the driver; this is because with only 2 vectors the driver will not be able to use a separate interrupt for each request queue. Derive the desired number of vectors from the number of request queues. Signed-off-by: Paolo Bonzini --- hw/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 82859a5..1109467 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -1023,7 +1023,9 @@ static int virtio_scsi_init_pci(PCIDevice *pci_dev) return -EINVAL; } - vdev->nvectors = proxy->nvectors; + vdev->nvectors = proxy->nvectors == DEV_NVECTORS_UNSPECIFIED + ? proxy->scsi.num_queues + 3 + : proxy->nvectors; virtio_init_pci(proxy, vdev); /* make the actual value visible */ @@ -1041,7 +1043,7 @@ static int virtio_scsi_exit_pci(PCIDevice *pci_dev) static Property virtio_scsi_properties[] = { DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOPCIProxy, host_features, scsi), DEFINE_PROP_END_OF_LIST(), }; -- 1.7.10.4