virtio-scsi-pci: default num_queues to -smp N
commit6a558822849fab604a1fcb71e7c4e528cafa21d9
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 18 Aug 2020 14:33:46 +0000 (18 15:33 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 27 Aug 2020 12:29:13 +0000 (27 08:29 -0400)
treebaeec7fcfa10f0b0ff3a3290c614453adc0f5e02
parent4e5163bd844429711b4d60d51030ab83048d80cd
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>
hw/core/machine.c
hw/scsi/vhost-scsi.c
hw/scsi/vhost-user-scsi.c
hw/scsi/virtio-scsi.c
hw/virtio/vhost-scsi-pci.c
hw/virtio/vhost-user-scsi-pci.c
hw/virtio/virtio-scsi-pci.c
include/hw/virtio/virtio-scsi.h