diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2023-12-20 08:47:54 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-12-21 22:49:28 +0100 |
commit | cf03a152c5d749fd0083bfe540df9524f1d2ff1d (patch) | |
tree | 231d2e5f03266974195ac5d39571baeba89382a7 /qapi | |
parent | 350147a871a545ab56b4a1062c8485635d9ffc24 (diff) | |
download | qemu-cf03a152c5d749fd0083bfe540df9524f1d2ff1d.zip qemu-cf03a152c5d749fd0083bfe540df9524f1d2ff1d.tar.gz qemu-cf03a152c5d749fd0083bfe540df9524f1d2ff1d.tar.bz2 |
qdev: add IOThreadVirtQueueMappingList property type
virtio-blk and virtio-scsi devices will need a way to specify the
mapping between IOThreads and virtqueues. At the moment all virtqueues
are assigned to a single IOThread or the main loop. This single thread
can be a CPU bottleneck, so it is necessary to allow finer-grained
assignment to spread the load.
Introduce DEFINE_PROP_IOTHREAD_VQ_MAPPING_LIST() so devices can take a
parameter that maps virtqueues to IOThreads. The command-line syntax for
this new property is as follows:
--device '{"driver":"foo","iothread-vq-mapping":[{"iothread":"iothread0","vqs":[0,1,2]},...]}'
IOThreads are specified by name and virtqueues are specified by 0-based
index.
It will be common to simply assign virtqueues round-robin across a set
of IOThreads. A convenient syntax that does not require specifying
individual virtqueue indices is available:
--device '{"driver":"foo","iothread-vq-mapping":[{"iothread":"iothread0"},{"iothread":"iothread1"},...]}'
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20231220134755.814917-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/virtio.json | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/qapi/virtio.json b/qapi/virtio.json index e6dcee7..19c7c36 100644 --- a/qapi/virtio.json +++ b/qapi/virtio.json @@ -928,3 +928,32 @@ 'data': { 'path': 'str', 'queue': 'uint16', '*index': 'uint16' }, 'returns': 'VirtioQueueElement', 'features': [ 'unstable' ] } + +## +# @IOThreadVirtQueueMapping: +# +# Describes the subset of virtqueues assigned to an IOThread. +# +# @iothread: the id of IOThread object +# +# @vqs: an optional array of virtqueue indices that will be handled by this +# IOThread. When absent, virtqueues are assigned round-robin across all +# IOThreadVirtQueueMappings provided. Either all IOThreadVirtQueueMappings +# must have @vqs or none of them must have it. +# +# Since: 9.0 +## + +{ 'struct': 'IOThreadVirtQueueMapping', + 'data': { 'iothread': 'str', '*vqs': ['uint16'] } } + +## +# @DummyVirtioForceArrays: +# +# Not used by QMP; hack to let us use IOThreadVirtQueueMappingList internally +# +# Since: 9.0 +## + +{ 'struct': 'DummyVirtioForceArrays', + 'data': { 'unused-iothread-vq-mapping': ['IOThreadVirtQueueMapping'] } } |