summaryrefslogtreecommitdiffstats
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorStefan Hajnoczi2020-08-18 16:33:46 +0200
committerMichael S. Tsirkin2020-08-27 14:29:13 +0200
commit6a558822849fab604a1fcb71e7c4e528cafa21d9 (patch)
treebaeec7fcfa10f0b0ff3a3290c614453adc0f5e02 /include/hw/virtio
parentvirtio-scsi: introduce a constant for fixed virtqueues (diff)
downloadqemu-6a558822849fab604a1fcb71e7c4e528cafa21d9.tar.gz
qemu-6a558822849fab604a1fcb71e7c4e528cafa21d9.tar.xz
qemu-6a558822849fab604a1fcb71e7c4e528cafa21d9.zip
virtio-scsi-pci: default num_queues to -smp N
Automatically size the number of virtio-scsi-pci, vhost-scsi-pci, and vhost-user-scsi-pci request virtqueues to match the number of vCPUs. Other transports continue to default to 1 request virtqueue. A 1:1 virtqueue:vCPU mapping ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is necessary to complete an I/O request and performance is improved. The maximum number of MSI-X vectors and virtqueues limit are respected. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200818143348.310613-6-stefanha@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r--include/hw/virtio/virtio-scsi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 9f293bcb80..c0b8e4dd7e 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -39,6 +39,8 @@
/* Number of virtqueues that are always present */
#define VIRTIO_SCSI_VQ_NUM_FIXED 2
+#define VIRTIO_SCSI_AUTO_NUM_QUEUES UINT32_MAX
+
typedef struct virtio_scsi_cmd_req VirtIOSCSICmdReq;
typedef struct virtio_scsi_cmd_resp VirtIOSCSICmdResp;
typedef struct virtio_scsi_ctrl_tmf_req VirtIOSCSICtrlTMFReq;