From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=Otv828Lh; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D8AB15A0262 for ; Wed, 20 May 2026 03:18:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1779239878; bh=604M2r6nYaefvSIEuYoePbCe8oKgjJtty3kbMLGXtUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Otv828LhqLwv6HQv6K77o70yEPAzSW+7qumw8Dj36G+7959FEu0AmBqNwukjwYdPf 2nHoW2Kvo6Xbfoa8PHs0vIIqaP35GDWK8Y1+114JiABmEFRh275IG6QukjgvYinEq4 yJrbGt1PgRX6TNNZpLff+WTzJOIAQ9gtR18DwbfZumer8ZeZEtKDn1qIgYcpuND2Hv oOVPSBbfWOM4/57QlRUWOZfoFY0zeqEC8Bwy9fIWTWAk5QNeuhd+l7Vzfl0AjKXiGS Qtd/ALC2MNCKywQAM603eNnxStU6syUbOvtKJlP5EzdptqQgrjPQGu4dyDVQcFT0IF wrbse/mdkrfDw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gKtvV5hSvz58mv; Wed, 20 May 2026 11:17:58 +1000 (AEST) Date: Wed, 20 May 2026 11:17:41 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v9 3/3] udp: Pass iov_tail to udp_update_hdr4()/udp_update_hdr6() Message-ID: References: <20260518122625.2290034-1-lvivier@redhat.com> <20260518122625.2290034-4-lvivier@redhat.com> <933734ef-5d4c-40dd-9fee-bb8f182f0921@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yCgxKj4DsNi9qOgZ" Content-Disposition: inline In-Reply-To: Message-ID-Hash: 7Q6ZACO5H6HR4IO2ZEN37KUVPXGT6FW7 X-Message-ID-Hash: 7Q6ZACO5H6HR4IO2ZEN37KUVPXGT6FW7 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --yCgxKj4DsNi9qOgZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 buf= fer > > > > and explicit data length. This lets vhost-user pass scatter-gather > > > > virtqueue buffers directly without an intermediate copy. > > > >=20 > > > > 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 interf= ace. > > > >=20 > > > > Signed-off-by: Laurent Vivier > > >=20 > > > Alas, this still has a potentially aliased memcpy(), see below. > >=20 > > 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...) >=20 > 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. --=20 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 --yCgxKj4DsNi9qOgZ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmoNC7QACgkQzQJF27ox 2GfJXg//eFww5uc6y5VBvae3vIBExz1wtoeA6kwuHf4gKbP7zYkE3pCKRGtgML0f euJ13PwAjpv6oLGaZA0JHPtaDC0Lma+D1mEKSA0DYY293ml2t9II2PKkP++At0iK k1Mcm2T+ksl0IEBi9T4TvCWv6IXjYWKXV3E3BbljF82SznGeQ6hIv9Ja51Qzss2B 89UGm1Wew0C4omkkWoJn4W+PTBQSAJiqRnEVjYDpmGdBYIkYvHVMfV5+4Cic0o18 dsM0bcIfAZZqbvgKzdmVcwYzP/gnrkVBihBULoKygceWX5nMZMfyTru9LcsI6kVD xspK27Bf/LRIgTDby6kObJDziyhQbWaX8/TIyGjpZFocekGTLn6ksmvU97VttGD+ cVB1KryH3qH//QElz5joyj/7sJLUTvuEX8V/zcJuu9Vt+bg9wSYFtDdPXW91ROe7 LwuDFlWrtAOuyGHOVqLpwhgpK8bBrYHZpYV1wb2ZkGX3sGPymNRJ+jv81VcXL9qo HWtogaCc+mXF8raQ/7VapxHwYAzTsx4Nv8Jy1ANdLrIbkXUzlsUiiKqCzL5VLyQO xUd6lsfvocL1D7HB5w38GB4Sk6YuP4UEmFjDZdJ6MBHQ45b2kIGGoJ/vWe8oQH9y 9z10uNcvWlGyD+2tiqevQiaxYv3kOKJW6muAPHBJdHw6WtQlN/Q= =T7cZ -----END PGP SIGNATURE----- --yCgxKj4DsNi9qOgZ--