qemu-e2k/qapi
Stefan Hajnoczi d9b495f9c6 block/export: add vhost-user-blk multi-queue support
Allow the number of queues to be configured using --export
vhost-user-blk,num-queues=N. This setting should match the QEMU --device
vhost-user-blk-pci,num-queues=N setting but QEMU vhost-user-blk.c lowers
its own value if the vhost-user-blk backend offers fewer queues than
QEMU.

The vhost-user-blk-server.c code is already capable of multi-queue. All
virtqueue processing runs in the same AioContext. No new locking is
needed.

Add the num-queues=N option and set the VIRTIO_BLK_F_MQ feature bit.
Note that the feature bit only announces the presence of the num_queues
configuration space field. It does not promise that there is more than 1
virtqueue, so we can set it unconditionally.

I tested multi-queue by running a random read fio test with numjobs=4 on
an -smp 4 guest. After the benchmark finished the guest /proc/interrupts
file showed activity on all 4 virtio-blk MSI-X. The /sys/block/vda/mq/
directory shows that Linux blk-mq has 4 queues configured.

An automated test is included in the next commit.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20201001144604.559733-2-stefanha@redhat.com
[Fixed accidental tab characters as suggested by Markus Armbruster
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-10-23 13:42:16 +01:00
..
acpi.json qapi: Extract ACPI commands to 'acpi.json' 2020-09-29 15:41:36 +02:00
audio.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
authz.json
block-core.json block/nvme: Add driver statistics for access alignment and hw errors 2020-10-23 13:42:16 +01:00
block-export.json block/export: add vhost-user-blk multi-queue support 2020-10-23 13:42:16 +01:00
block.json qapi/block.json: Add newline after "Example:" for block-latency-histogram-set 2020-09-29 17:55:39 +02:00
char.json qapi: Document event VSERPORT_CHANGE is rate-limited 2020-09-03 09:58:26 +02:00
common.json
control.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
crypto.json qapi/: fix some comment spelling errors 2020-09-17 20:41:08 +02:00
dump.json
error.json
introspect.json
job.json
machine-target.json cpu: Introduce CPU model deprecation API 2020-10-14 15:28:54 -04:00
machine.json qapi: Restrict 'query-kvm' command to machine code 2020-10-21 05:00:44 +02:00
meson.build qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
migration.json qapi: Restrict Xen migration commands to migration.json 2020-10-21 05:00:44 +02:00
misc-target.json
misc.json qapi: Restrict Xen migration commands to migration.json 2020-10-21 05:00:44 +02:00
net.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
opts-visitor.c
pci.json qapi: Extract PCI commands to 'pci.json' 2020-09-29 15:41:36 +02:00
pragma.json
qapi-clone-visitor.c
qapi-dealloc-visitor.c
qapi-schema.json qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
qapi-util.c
qapi-visit-core.c
qdev.json
qmp-dispatch.c qmp: Move dispatcher to a coroutine 2020-10-09 07:08:20 +02:00
qmp-event.c
qmp-registry.c qmp: Move dispatcher to a coroutine 2020-10-09 07:08:20 +02:00
qobject-input-visitor.c keyval: Parse help options 2020-10-15 16:06:27 +02:00
qobject-output-visitor.c
qom.json
rdma.json
replay.json replay: implement replay-seek command 2020-10-06 08:34:49 +02:00
rocker.json
run-state.json qapi/run-state.json: introduce memory failure event 2020-10-04 18:36:23 +02:00
sockets.json
string-input-visitor.c
string-output-visitor.c
tpm.json
trace-events
trace.h
trace.json
transaction.json
ui.json