From 6a558822849fab604a1fcb71e7c4e528cafa21d9 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 18 Aug 2020 15:33:46 +0100 Subject: 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 Message-Id: <20200818143348.310613-6-stefanha@redhat.com> Reviewed-by: Cornelia Huck Reviewed-by: Raphael Norwitz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/core/machine.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hw/core') diff --git a/hw/core/machine.c b/hw/core/machine.c index cf5f2df..9ee2aa0 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -28,7 +28,11 @@ #include "hw/mem/nvdimm.h" #include "migration/vmstate.h" -GlobalProperty hw_compat_5_1[] = {}; +GlobalProperty hw_compat_5_1[] = { + { "vhost-scsi", "num_queues", "1"}, + { "vhost-user-scsi", "num_queues", "1"}, + { "virtio-scsi-device", "num_queues", "1"}, +}; const size_t hw_compat_5_1_len = G_N_ELEMENTS(hw_compat_5_1); GlobalProperty hw_compat_5_0[] = { -- cgit v1.1