public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/3] Decouple iovec management from virtqueue elements
@ 2026-03-13  7:21 Laurent Vivier
  2026-03-13  7:21 ` [PATCH 1/3] virtio: Pass iovec arrays as separate parameters to vu_queue_pop() Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Vivier @ 2026-03-13  7:21 UTC (permalink / raw)
  To: passt-dev; +Cc: Laurent Vivier

This series prepares the vhost-user path for multi-buffer support,
where a single virtqueue element can use more than one iovec entry.

Currently, iovec arrays are tightly coupled to virtqueue elements:
callers must pre-initialize each element's in_sg/out_sg pointers
before calling vu_queue_pop(), and each element is assumed to own
exactly one iovec slot. This makes it impossible for a single element
to span multiple iovec entries, which is needed for UDP multi-buffer
reception.

The series decouples iovec storage from elements in three patches:

- Patch 1 passes iovec arrays as separate parameters to vu_queue_pop()
  and vu_queue_map_desc(), so the caller controls where descriptors
  are mapped rather than reading them from pre-initialized element
  fields.

- Patch 2 passes the actual remaining out_sg capacity to
  vu_queue_pop() in vu_handle_tx() instead of a fixed per-element
  constant, enabling dynamic iovec allocation.

- Patch 3 moves iovec pool management into vu_collect(), which now
  accepts the iovec array and tracks consumed entries across elements
  with a running counter. This removes vu_set_element() and
  vu_init_elem() entirely. Callers that still assume one iovec per
  element assert this invariant explicitly until they are updated for
  multi-buffer.

The follow-up udp-iov_vu series builds on this to implement actual
multi-buffer support in the UDP vhost-user path.

Laurent Vivier (3):
  virtio: Pass iovec arrays as separate parameters to vu_queue_pop()
  vu_handle_tx: Pass actual remaining out_sg capacity to vu_queue_pop()
  vu_common: Move iovec management into vu_collect()

 tcp_vu.c    | 23 ++++++++-------
 udp_vu.c    | 21 ++++++++------
 virtio.c    | 29 ++++++++++++++-----
 virtio.h    |  4 ++-
 vu_common.c | 83 ++++++++++++++++++++++++-----------------------------
 vu_common.h | 22 ++------------
 6 files changed, 91 insertions(+), 91 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-13  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-13  7:21 [PATCH 0/3] Decouple iovec management from virtqueue elements Laurent Vivier
2026-03-13  7:21 ` [PATCH 1/3] virtio: Pass iovec arrays as separate parameters to vu_queue_pop() Laurent Vivier
2026-03-13  7:21 ` [PATCH 2/3] vu_handle_tx: Pass actual remaining out_sg capacity " Laurent Vivier
2026-03-13  7:21 ` [PATCH 3/3] vu_common: Move iovec management into vu_collect() Laurent Vivier

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).