From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id B6EEC5A02E9 for ; Wed, 1 May 2024 02:10:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1714522228; bh=JMn5oypdeqqFM3YtP/b++F3hBWmzvf+UFw0KAciccVQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LLY6bjyjk4CEdkEty0ml9uFq9sLrH33vbw6yXv9NUZfkIdI+6i94V9nWdH9TloFGG L4tnxAnZbA8GuSeOm6qmj90hDqkomQvN195uwlrrLwgBpU+qHhZdtTzws1ceBResu9 MnsXz76aV+TC9DS6wTG74Hsix3oDXpY9siNaotp+REThdpqNVL3z6v2S7Q+30B+eEs 8giTYVrl+M6yM+DcgvHFRa/zpVTs/vTIbumQRa8InavYy4h0RFHtnYXwooVuJfgxom g1kTIYdcEE4535T7R1vWD0mvymA1O1NIHkdQ9K6rI69x8CVo3n7OySSChzq8orkamy S9xpc5W4j1ldA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VTcsJ2zyrz4x1R; Wed, 1 May 2024 10:10:28 +1000 (AEST) Date: Wed, 1 May 2024 10:06:33 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 5/7] tap, tcp: (Re-)abstract TAP specific header handling Message-ID: References: <20240429070933.1366881-1-david@gibson.dropbear.id.au> <20240429070933.1366881-6-david@gibson.dropbear.id.au> <20240430204718.520f3b5b@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2SFCn2zwcVeV5qsC" Content-Disposition: inline In-Reply-To: <20240430204718.520f3b5b@elisabeth> Message-ID-Hash: 5XL6GVSWJQOQOZDMXOJUDGIIZS5MLMAB X-Message-ID-Hash: 5XL6GVSWJQOQOZDMXOJUDGIIZS5MLMAB 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, Laurent Vivier 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: --2SFCn2zwcVeV5qsC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 30, 2024 at 08:47:18PM +0200, Stefano Brivio wrote: > On Mon, 29 Apr 2024 17:09:31 +1000 > David Gibson wrote: >=20 > > Recent changes to the TCP code (reworking of the buffer handling) have > > meant that it now (again) deals explicitly with the MODE_PASST specific > > vnet_len field, instead of using the (partial) abstractions provided by= the > > tap layer. > >=20 > > The abstractions we had don't work for the new TCP structure, so make s= ome > > new ones that do: tap_hdr_iov() which constructs an iovec suitable for > > containing (just) the TAP specific header and tap_hdr_update() which > > updates it as necessary per-packet. > >=20 > > Signed-off-by: David Gibson > > --- > > tap.h | 27 +++++++++++++++++++++++++++ > > tcp.c | 40 +++++++++++++++------------------------- > > 2 files changed, 42 insertions(+), 25 deletions(-) > >=20 > > diff --git a/tap.h b/tap.h > > index dbc23b31..75aa3f03 100644 > > --- a/tap.h > > +++ b/tap.h > > @@ -16,6 +16,33 @@ struct tap_hdr { > > uint32_t vnet_len; > > } __attribute__((packed)); > > =20 > > +/** > > + * tap_hdr_iov() - struct iovec for a tap header > > + * @c: Execution context > > + * @taph: Pointer to tap specific header buffer > > + * > > + * Returns: A struct iovec covering the correct portion of @taph to us= e as the > > + * TAP specific header in the current configuration. >=20 > Nit: s/TAP/tap/ (not an acronym). Fixed, thanks. --=20 David Gibson | 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 --2SFCn2zwcVeV5qsC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmYxh4gACgkQzQJF27ox 2GcxTg/+JHM1wDMBBGNg6hHP/pcfmwu+flZWioLsvRlzrj9R4HsUh+aT5osIiH9P ppddIau1MRC6lG3bZSgQyUjXTy7JrrcBVRYIl/HUWinofyUsvshZfpfxYhWYB1Xr 4tpkF48qpfAvbyf0dtKpG/0Hobqyjn+j8/KTCFugvDEzI09mn9xuWdOZojb6bKYo hogJLYSPUNLvXWloc5iN8sll1/dTYKz1W7ayGIVnyXTaZVr5yPW7IXMUVnuwhcjY eheQs+OxmOfQrlxV3hSohcc7PmSQsIwreqsIIVY/26Eic/HaqsBaYV95C+7frqC8 olY7JCrTugm6AiESOFGAvWwcXHwRhGlGVJnVaHpv1THOQ1HUlnNe8Ik+SBj9nTz2 BJPoh2MsR3IuqkisQtxkZZeW+vyuhfX6BkCLj+83WqxjVK6qP9PbOPMFOafbpz3t KcLPSDG1JjL7hIjb1qjFuZjMwhM0LO5gbGfaZNtVss5ph25dET9W/GxZfic8Ijyx VRLM35eumgOq8cvctIkKQXJk/65W38b5k6hDZ4XOEBeSZb2BDNMWNB5uaurAmTkU BvTuhMZvzHYoKxarHFpZY+WThejvuMkGz2CEXZfAQ4CxVhF5AVcDrHvJj8dbzSGH kQgDYQOivz69VAZZI0ArvB+KyoIgWqza+lISZ5+tXl9Isxpd0ag= =sLMQ -----END PGP SIGNATURE----- --2SFCn2zwcVeV5qsC--