public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Jon Maloy <jmaloy@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH v3 00/10] vhost-user: Preparatory series for multiple iovec entries per virtqueue element
Date: Mon, 11 May 2026 05:53:12 -0400	[thread overview]
Message-ID: <f1cbae02-8cd2-452e-a22a-1e55fd28b7cb@redhat.com> (raw)
In-Reply-To: <20260416155721.3807225-1-lvivier@redhat.com>

Nice series. I responded directly on the patches where I saw some very 
minor issues.

For the rest:

Reviewed-by: Jon Maloy <jmaloy@redhat.com>


On 2026-04-16 11:57, Laurent Vivier wrote:
> Currently, the vhost-user path assumes each virtqueue element contains
> exactly one iovec entry covering the entire frame.  This assumption
> breaks as some virtio-net drivers (notably iPXE) provide descriptors where the
> vnet header and the frame payload are in separate buffers, resulting in
> two iovec entries per virtqueue element.
> 
> This series refactors the vhost-user data path so that frame lengths,
> header sizes, and padding are tracked and passed explicitly rather than
> being derived from iovec sizes.  This decoupling is a prerequisite for
> correctly handling padding of multi-buffer frames.
> 
> The changes in this series can be split in 3 groups:
> 
> - New iov helpers (patches 1-2):
> 
>     iov_memset() and iov_memcpy() operate across iovec boundaries.
>     These are needed by the final patch to pad and copy frame data
>     when a frame spans multiple iovec entries.
> 
> - Structural refactoring (patches 3-5):
> 
>     Move vnethdr setup into vu_flush(), separate virtqueue management
>     from socket I/O in the UDP path, and pass iov arrays explicitly
>     instead of using file-scoped state.  These changes make it possible
>     to pass explicit frame lengths through the stack, which is required
>     to pad frames independently of iovec layout.
> 
> - Explicit length passing throughout the stack (patches 6-10):
> 
>     Thread explicit L4, L2, frame, and data lengths through checksum,
>     pcap, vu_flush(), and tcp_fill_headers(), replacing lengths that
>     were previously derived from iovec sizes.  With lengths tracked
>     explicitly, the final patch can centralise Ethernet frame padding
>     into vu_collect() and a new vu_pad() helper that correctly pads
>     frames spanning multiple iovec entries.
> 
> v3:
> - csum_udp4()/csum_udp6()/udp_vu_csum receive payload length (dlen) rather than l4len
> - Add a length parameter to write_remainder() and use it in pcap_frame()
> 
> v2:
> - Rename iov_memcopy() to iov_memcpy() and use clearer parameter names
> - Use clearer code in pcap_frame()
> - Add braces around bodies in pcap.c and tcp_vu.c for style consistency
> - Extract l2len variable in tap_add_packet() and tcp_vu_send_flag()
>    to avoid repeating the same expression
> - Fix indentation alignment of iov_skip_bytes() arguments in tcp_vu_c
> - Introduce fill_size variable in vu_flush()
> - Reposition comment for ETH_ZLEN in vu_collect()
> 
> Laurent Vivier (10):
>    iov: Introduce iov_memset()
>    iov: Add iov_memcpy() to copy data between iovec arrays
>    vu_common: Move vnethdr setup into vu_flush()
>    udp_vu: Move virtqueue management from udp_vu_sock_recv() to its
>      caller
>    udp_vu: Pass iov explicitly to helpers instead of using file-scoped
>      array
>    checksum: Pass explicit L4 length to checksum functions
>    pcap: Pass explicit L2 length to pcap_iov()
>    vu_common: Pass explicit frame length to vu_flush()
>    tcp: Pass explicit data length to tcp_fill_headers()
>    vhost-user: Centralise Ethernet frame padding in vu_collect() and
>      vu_pad()
> 
>   checksum.c     |  43 +++++++-----
>   checksum.h     |   6 +-
>   iov.c          |  78 ++++++++++++++++++++++
>   iov.h          |   5 ++
>   pcap.c         |  28 +++++---
>   pcap.h         |   2 +-
>   tap.c          |  10 +--
>   tcp.c          |  14 ++--
>   tcp_buf.c      |   3 +-
>   tcp_internal.h |   2 +-
>   tcp_vu.c       |  66 ++++++++++---------
>   udp.c          |   5 +-
>   udp_vu.c       | 173 +++++++++++++++++++++++++------------------------
>   util.c         |  31 +++++++--
>   util.h         |   3 +-
>   vu_common.c    |  58 ++++++++++-------
>   vu_common.h    |   5 +-
>   17 files changed, 338 insertions(+), 194 deletions(-)
> 


      parent reply	other threads:[~2026-05-11  9:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 15:57 Laurent Vivier
2026-04-16 15:57 ` [PATCH v3 01/10] iov: Introduce iov_memset() Laurent Vivier
2026-04-16 15:57 ` [PATCH v3 02/10] iov: Add iov_memcpy() to copy data between iovec arrays Laurent Vivier
2026-05-11  9:07   ` Jon Maloy
2026-04-16 15:57 ` [PATCH v3 03/10] vu_common: Move vnethdr setup into vu_flush() Laurent Vivier
2026-04-16 15:57 ` [PATCH v3 04/10] udp_vu: Move virtqueue management from udp_vu_sock_recv() to its caller Laurent Vivier
2026-05-11  9:30   ` Jon Maloy
2026-05-11 10:44     ` David Gibson
2026-04-16 15:57 ` [PATCH v3 05/10] udp_vu: Pass iov explicitly to helpers instead of using file-scoped array Laurent Vivier
2026-05-11  9:37   ` Jon Maloy
2026-04-16 15:57 ` [PATCH v3 06/10] checksum: Pass explicit L4 length to checksum functions Laurent Vivier
2026-05-11  1:33   ` David Gibson
2026-04-16 15:57 ` [PATCH v3 07/10] pcap: Pass explicit L2 length to pcap_iov() Laurent Vivier
2026-05-11  1:42   ` David Gibson
2026-05-11  9:50   ` Jon Maloy
2026-04-16 15:57 ` [PATCH v3 08/10] vu_common: Pass explicit frame length to vu_flush() Laurent Vivier
2026-04-16 15:57 ` [PATCH v3 09/10] tcp: Pass explicit data length to tcp_fill_headers() Laurent Vivier
2026-04-16 15:57 ` [PATCH v3 10/10] vhost-user: Centralise Ethernet frame padding in vu_collect() and vu_pad() Laurent Vivier
2026-05-11  2:01   ` David Gibson
2026-05-11  9:53 ` Jon Maloy [this message]

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=f1cbae02-8cd2-452e-a22a-1e55fd28b7cb@redhat.com \
    --to=jmaloy@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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.
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).