From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v9 3/3] udp: Pass iov_tail to udp_update_hdr4()/udp_update_hdr6()
Date: Wed, 20 May 2026 11:17:41 +1000 [thread overview]
Message-ID: <ag0LtauexXrIKd43@zatzit> (raw)
In-Reply-To: <ag0JZuRSCWqRdB1l@zatzit>
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
On Wed, May 20, 2026 at 11:07:50AM +1000, David Gibson wrote:
> On Tue, May 19, 2026 at 10:03:39AM +0200, Laurent Vivier wrote:
> > On 5/19/26 07:08, David Gibson wrote:
> > > On Mon, May 18, 2026 at 02:26:25PM +0200, Laurent Vivier wrote:
> > > > Change udp_update_hdr4() and udp_update_hdr6() to take an iov_tail
> > > > pointing at the UDP frame instead of a contiguous udp_payload_t buffer
> > > > and explicit data length. This lets vhost-user pass scatter-gather
> > > > virtqueue buffers directly without an intermediate copy.
> > > >
> > > > The UDP header is built into a local struct udphdr and written back with
> > > > IOV_PUSH_HEADER(). On the tap side, udp_tap_prepare() wraps the
> > > > existing udp_payload_t in a two-element iov to match the new interface.
> > > >
> > > > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > >
> > > Alas, this still has a potentially aliased memcpy(), see below.
> >
> > Did you see I updated patch 2 to avoid the memcpy() if the header is
> > already in place?
> > (I think I should have removed your R-b...)
>
> I saw the note in the changelog, but I didn't spot the place in the
> code specifically - I think I skipped patch 2 because of the R-b and
> assumed the change was in patch 3. Unfortunately the one in this
> patch is still there.
Duh, sorry, I misunderstood how you were fixing the problem. I see
you changed PUSH_HEADER to be safe in this circumstance, which does
also fix the case in patch 3. Will have that in mind when I review
v10.
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-05-20 1:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 12:26 [PATCH v9 0/3] vhost-user,udp: Handle multiple iovec entries per virtqueue element Laurent Vivier
2026-05-18 12:26 ` [PATCH v9 1/3] udp_vu: Allow virtqueue elements with multiple iovec entries Laurent Vivier
2026-05-18 12:26 ` [PATCH v9 2/3] iov: Introduce IOV_PUSH_HEADER() macro Laurent Vivier
2026-05-18 12:26 ` [PATCH v9 3/3] udp: Pass iov_tail to udp_update_hdr4()/udp_update_hdr6() Laurent Vivier
2026-05-19 5:08 ` David Gibson
2026-05-19 8:03 ` Laurent Vivier
2026-05-20 1:07 ` David Gibson
2026-05-20 1:17 ` David Gibson [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=ag0LtauexXrIKd43@zatzit \
--to=david@gibson.dropbear.id.au \
--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).