Skip to contentSkip to conversation

vhost: accept indirect descriptors in shadow virtqueue

PATCH In review Eugenio Pérez 2 participants 2 messages Dec 1, 2025 – Dec 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: accept indirect descriptors in shadow virtqueue

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.

--

Tested functionally by forwarding the CVQ descriptors.

---
 hw/virtio/vhost-shadow-virtqueue.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/vhost-shadow-virtqueue.c +1 -0
index 2481d49345..6242aeb69c 100644
@@ -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:
Signature · 1 line
2.52.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Eugenio Pérez

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.

Quoted 9 lines

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.

--

Thanks