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=202410 header.b=B7QScjh3; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 07FB85A004E for ; Tue, 29 Oct 2024 05:02:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730174506; bh=iNDqkbnnwDx5Z+UgVq4GZ0nUMfujQJtAFmP8sUibUAA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B7QScjh3e1NlMqASm8olPcQt+aY6K3/1b7lveK+GuOjo76P/YP1dA/LKzzX7p4xb1 jVjySH1dXLFVHRthM+xguUhBlKXLUj7Zxz0rgEEFJcb2apBdGt+267A2SN6hQi8JVK JLUi9461Zu/1DjqzlcrBsEdDyFYWWcvlo2VtsXBQgxWgQmyDuDyztl9khZ+9ggQgPz jGkkLmaEtFCt4AWmBZ8IqiPaOt2caKjPRYs5F3LMYmKhUXCP+7LFqGvDQQFq5geuCl QlI/aJ1hSJshzYfEu/h7Eb2oe5NJ0Gpif4LYjowpiN4OoqKpZrpFL2n+yAiQSxirh3 nxkFW9cqddBsQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XcxQf75Twz4wbR; Tue, 29 Oct 2024 15:01:46 +1100 (AEDT) Date: Tue, 29 Oct 2024 14:02:25 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/7] tcp: Pass TCP header and payload separately to tcp_update_check_tcp[46]() Message-ID: References: <20241028094050.1609090-1-david@gibson.dropbear.id.au> <20241028094050.1609090-2-david@gibson.dropbear.id.au> <20241028194254.71df8d2f@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4GtHh/MYthIOJxC2" Content-Disposition: inline In-Reply-To: <20241028194254.71df8d2f@elisabeth> Message-ID-Hash: 6GJP5FJLCIHANZMG72IRISWTWJMQURTT X-Message-ID-Hash: 6GJP5FJLCIHANZMG72IRISWTWJMQURTT 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: Laurent Vivier , 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: --4GtHh/MYthIOJxC2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 28, 2024 at 07:42:54PM +0100, Stefano Brivio wrote: > On Mon, 28 Oct 2024 20:40:44 +1100 > David Gibson wrote: >=20 > > Currently these expects both the TCP header and payload in a single IOV, > > and goes to some trouble to locate the checksum field within it. In the > > current caller we've already know where the TCP header is, so we might = as > > well just pass it in. This will need to work a bit differently for > > vhost-user, but that code already needs to locate the TCP header for ot= her > > reasons, so again we can just pass it in. >=20 > We couldn't do this, and also what you're now doing in 5/7, because > with vhost-user the TCP header is not aligned, so we can't pass it > around as a pointer, see: >=20 > > https://archives.passt.top/passt-dev/ZeUpxEY-sn64NLE5@zatzit/ >=20 > and following. That one is about IP headers, but the same applies to > TCP and UDP headers. Hrm. I'm aware it theoretically need not be aligned, but I thought it was in practice.. and that we were already relying on that. In fact, I'm pretty sure the second part is true, although more subtly than here. v8 of the vhost-user patches calls tcp_fill_headers[46]() with the bp parameter set to the offset of the TCP header. If creating a tcphdr * there is a problem, then creating a tcp_payload_t * can't be any better. > Of course the current solution is not elegant and it would be nice to > find another way to deal with it, but we couldn't come up with anything > better back then. >=20 > The rest of the series looks good to me, but I'm afraid that without > this one and 5/7 the other changes will be a bit more complicated to > implement (if at all possible). Definitely. I have so ideas for approaches more robust to misalignment, but they're substantially more complicated. I was hoping we could avoid it at least for now. --=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 --4GtHh/MYthIOJxC2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmcgUDUACgkQzQJF27ox 2GfbxhAApoj0+rnTSl9X8SZEUSJcCMUdmgyTY0pUVnJKCZCUVhkH0uaTUa+Og2Uw cXmbv2MvsjvRdIywolNkL8jvb8zEnmNsgACHYC3B0dkEeEkr1rMbTXn5DHUY4LWk OFxBFp1ojk4WLYCbtloV2THFES9XCSrotIUUNnR9+EdYq0eKLfDwmX5SFfSn6Fj2 rHUorzND/bloagdTyXWWPZsJEm81uPlqngUExlHm7la6tS9ePFtGvxZljrJUNj4L 7LVu4eWBUgJ++xRIUAxo3RfFoWyfFcM64V6ZQRWFpzqV3Kj56BGsdpflx3qG0rK1 bAXb0GeOkTj8husYWNJcBsEsHvqsqSIeY2Y/lG81s6sieroKbR6qiVY/+EknBEzm 5Dwhp/b7YmbX6Z4O6+UIRrzjShzdY5P0W1BDkRpCM6xOcweFSBU6gFW97Fyn6j56 nAbZoEnQdemIeNbha9E7k0nxXZ9SkZroqkXRXv6LBWYxsEf+pIL2/prn6V3Pzqzm DHl+Xk+CDB1NhPZC6mDUKjdM+vvLXLsMU+VktXekhhJEeLaRLND+4taWytYk32zG Nvx+kbTIb2EZs9p9zNAldtwlL9oRZjn8kJODtOMiUi6hxzTsYcxmDPt6fEBEPy4G f6c42vmKDH4O6ek9dtggfX9SNsghfZoIGkyt9cIduCPFQETfgBk= =oo3q -----END PGP SIGNATURE----- --4GtHh/MYthIOJxC2--