Received: from eggs.gnu.org ([208.118.235.92]:42832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum5y-0008Sh-VZ for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sum5t-0007aV-4w for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:04:50 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:49300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum5t-0007Xk-18 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:04:45 -0400 Received: by mail-yw0-f45.google.com with SMTP id p34so3210316yhp.4 for ; Fri, 27 Jul 2012 08:04:44 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 27 Jul 2012 17:02:59 +0200 Message-Id: <1343401379-19495-33-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343401379-19495-1-git-send-email-pbonzini@redhat.com> References: <1343401379-19495-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 32/32] 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