qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Lei Yang" <leiyang@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>
Subject: [PATCH] vhost: accept indirect descriptors in shadow virtqueue
Date: Mon,  1 Dec 2025 13:51:49 +0100	[thread overview]
Message-ID: <20251201125149.2151026-1-eperezma@redhat.com> (raw)

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.
---
 hw/virtio/vhost-shadow-virtqueue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 2481d49345..6242aeb69c 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -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:
-- 
2.52.0



             reply	other threads:[~2025-12-01 12:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 12:51 Eugenio Pérez [this message]
2025-12-04  2:16 ` [PATCH] vhost: accept indirect descriptors in shadow virtqueue Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251201125149.2151026-1-eperezma@redhat.com \
    --to=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=leiyang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).