]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
vhost: accept indirect descriptors in shadow virtqueue
authorEugenio Pérez <eperezma@redhat.com>
Mon, 1 Dec 2025 12:51:49 +0000 (13:51 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 5 Feb 2026 10:06:45 +0000 (05:06 -0500)
The device is not able to generate indirect descriptors by itself, only
the driver can do it.  And SVQ is already able to handle them by reusing
VirtQueue struct.

Shadow VirtQueue just transform the indirect descriptors to chained
buffers.  This way we don't need to map a new buffer for the indirect
table and handle its exhaustion etc.  As they are only used in control
plane and HW devices don't like indirect, we should not see significant
downsides with these.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
--

Tested functionally by forwarding the CVQ descriptors.

Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201125149.2151026-1-eperezma@redhat.com>

hw/virtio/vhost-shadow-virtqueue.c

index 2481d49345dd50cc0ddfdea40bd14587bdde6c7d..6242aeb69c1a04230608abed59d9c0fe57c215b2 100644 (file)
@@ -34,6 +34,7 @@ bool vhost_svq_valid_features(uint64_t features, Error **errp)
         switch (b) {
         case VIRTIO_F_ANY_LAYOUT:
         case VIRTIO_RING_F_EVENT_IDX:
+        case VIRTIO_RING_F_INDIRECT_DESC:
             continue;
 
         case VIRTIO_F_ACCESS_PLATFORM: