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 06A635A0271 for ; Sat, 9 Mar 2024 05:15:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1709957752; bh=uql2UATdadXFPZznfDaat8WRGvba8stn7+tMoFSmRIc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pdtuK3cvk1/iRKk5JaOV1W0GGYbakm/XKTiZg2E5NM936VZtFBshI0ubDHdkT/GLq 0azyiRBuXbP457csR+TFll5K3pAAVCzfUjd2vyA32Y0C3z1axGp84xO011C3J3l4kU moRU3+WZzPhEKCtclF0OO3M49O9v4i3in7Dm1VPeiUlEFs8Y2zaYZLsledNeIKem5E hJspq4d4pjCSUq6IV/aSVUu5o9iiG+6rB32Qqm7NmeyXUGXYBd1hqOVPR5qnyxHw0o UUCQ405QyP5m7/hDQC1OS5A9TGKvvkpQNbg34wl0/okJjZt27IgfJ97JXTBQowClma Si2rymcfavNiQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Ts8pw5GBLz4wyg; Sat, 9 Mar 2024 15:15:52 +1100 (AEDT) Date: Sat, 9 Mar 2024 15:15:47 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH 0/4] Some improvements to the tap send path Message-ID: References: <20240308065325.2181322-1-david@gibson.dropbear.id.au> <348a52c9-7c07-4150-b594-4743c7775be6@redhat.com> <360d4311-7d81-426e-8f63-9cb2930f7163@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3dEEYJKnV9baV7w/" Content-Disposition: inline In-Reply-To: <360d4311-7d81-426e-8f63-9cb2930f7163@redhat.com> Message-ID-Hash: RWA4VXRDUDVKRLFAIYETFHNYXLLUC7EM X-Message-ID-Hash: RWA4VXRDUDVKRLFAIYETFHNYXLLUC7EM 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: Stefano Brivio , 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: --3dEEYJKnV9baV7w/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 08, 2024 at 05:49:15PM +0100, Laurent Vivier wrote: > On 3/8/24 13:42, David Gibson wrote: > ... > > >=20 > > > The payload can be TCP + data or TCP + flags: > > >=20 > > > struct tcp_l2_flags_t { > > > struct tcphdr th; > > > char opts[OPT_MSS_LEN + OPT_WS_LEN + 1]; > > > }; > > >=20 > > > struct tcp_l2_payload_t { > > > struct tcphdr th; /* 20 bytes */ > > > uint8_t data[MSS]; /* 65516 bytes */ > > > #ifdef __AVX2__ > > > } __attribute__ ((packed, aligned(32))); > > > #else > > > } __attribute__ ((packed, aligned(__alignof__(unsigned int)))); > > > #endif > >=20 > > Not sure if we'd be better off with this approach, or having both IP > > and L4 headers together, and the L4 payload in another. The latter > > would mean duplicating the TCP or UDP headers between the IPv4 and > > IPv6 cases, but it allows the data buffers - which will be used > > directly on the socket side. > >=20 >=20 > The main idea behind using iovec is to separate tcphdr and iphdr structur= es, > allowing for direct access to the pointers of tcphdr and iphdr without > concerns about pointer alignment. Moreover, having tcphdr and TCP payload= in > the same vector can make sense when computing the TCP checksum, as the > checksum includes tcphdr and the payload. Ah, yes. That makes sense. --=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 --3dEEYJKnV9baV7w/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmXr4kwACgkQzQJF27ox 2Gc6Gg//c1NU7FCZw5vPZ7qEoODP4FTapMuFLeIDb2YS16X2duDUAug2kERvnCf2 J2mXk9orbjJ7BKBs68puR+9MWr0BXVTrzeFxKjj/p71PcxnokRafe5zeJYmkepVx 978ZqRv3jNVHrN9SodJIi1uQ567I9C0bljaz14yXaxRHhHx52O3QYWQlvbO5n32F OrYGSlMKi7+1EFRIg4V97CSoijWXmo507nLVcxxdI5v6D0KTjT3eUZti/oXpU81z 20As7/9qLa5oAeC35Bv71J9y6bWQcFRuTUjbu7i6oJ97zd15cIhyV2HyhW7H5etD +6vmLOeB0/DdHRI9ZejOFXj9II59Bs3axSNZzI4mBo5g8qsoahpCxvoThDmwmFVv qwRDihBt1e2PIR/7G17sK+nzWaga61V/oWkyhK4pv+kAWp6blDf00Cs2kpghvG/l 5xVUXnmtqZ0YkehinLrr+CQGMQAjarC7sSi1TdM6HlMjt64kZqmOe77oIlgm2qva UxQ3KjK1xuNC3Huxwtsm7+jT+wtD7LOXMWQiBlajAPqReMWmuMbB9Q3s7qvPMQRt f3ed1tJbyUTCgfUA/KevcyXe/0vf9YcfynF6cO11CzKjVZrBifr1qrnd1yOoYRNe H7rmzVbgefmfsydsYEaklvVzVHisELPz+Zyawd8h+sZyGIdY5eE= =3jgI -----END PGP SIGNATURE----- --3dEEYJKnV9baV7w/--