qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] small virtio-scsi fixes
@ 2012-07-27 12:39 Paolo Bonzini
  2012-07-27 12:39 ` [Qemu-devel] [PATCH 1/2] virtio-scsi: add ioeventfd support Paolo Bonzini
  2012-07-27 12:39 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: enable MSI-X support Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-07-27 12:39 UTC (permalink / raw)
  To: qemu-devel

A couple of small mistakes in virtio-scsi-pci, noticed by code inspection.

Paolo Bonzini (2):
  virtio-scsi: add ioeventfd support
  virtio-scsi: enable MSI-X support

 hw/virtio-pci.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] virtio-scsi: add ioeventfd support
  2012-07-27 12:39 [Qemu-devel] [PATCH 0/2] small virtio-scsi fixes Paolo Bonzini
@ 2012-07-27 12:39 ` Paolo Bonzini
  2012-07-27 12:39 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: enable MSI-X support Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-07-27 12:39 UTC (permalink / raw)
  To: qemu-devel

Probably due to bad merge months ago, virtio-scsi-pci did not have
ioeventfd support.  Fix this and enable it by default, as is the
case for other virtio-pci devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio-pci.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 4e03f0b..82859a5 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -1040,6 +1040,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_VIRTIO_SCSI_PROPERTIES(VirtIOPCIProxy, host_features, scsi),
     DEFINE_PROP_END_OF_LIST(),
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] virtio-scsi: enable MSI-X support
  2012-07-27 12:39 [Qemu-devel] [PATCH 0/2] small virtio-scsi fixes Paolo Bonzini
  2012-07-27 12:39 ` [Qemu-devel] [PATCH 1/2] virtio-scsi: add ioeventfd support Paolo Bonzini
@ 2012-07-27 12:39 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-07-27 12:39 UTC (permalink / raw)
  To: qemu-devel

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 <pbonzini@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-27 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27 12:39 [Qemu-devel] [PATCH 0/2] small virtio-scsi fixes Paolo Bonzini
2012-07-27 12:39 ` [Qemu-devel] [PATCH 1/2] virtio-scsi: add ioeventfd support Paolo Bonzini
2012-07-27 12:39 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: enable MSI-X support Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).