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=202412 header.b=FqbQGEnS; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 48EEE5A0272 for ; Fri, 20 Dec 2024 10:00:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1734685216; bh=+JpV2FBgSrGvts6rvWTlFLQ8hI6FtEPTZ1jlPcb3Qk4=; h=Date:From:To:Subject:References:In-Reply-To:From; b=FqbQGEnS12foxCdTkWgGzMgi/WKvzrq96ypU9ABXU7PU6/XXJEiXya//5w9lk6SeT PhcUZ+zmTl7rEmKg4sbz4lifQK4oynsbaKQpGcxHKMSAFrp6CN/rGD32uIuYvPK/AZ qKGb/wCeKVBBuJinJTpwPWIxcT1CvtTVFl6on6wc6LOh/+jR34OtkZf+qWdTY0UluL FsOa3gtSw2juTsfHvTM0AealrM7424t7UpJFS+N9tFzJ82wq29C9GvlZX6LV0ahuJ6 VVtJ/9UhK97kj4VMsy1h+pRWLhp1vmxEusEZoIpF690ssVXCXSsUYpRGbNLtgv4us5 g3UcAI1PTXu/A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YF1b45g72z4x3d; Fri, 20 Dec 2024 20:00:16 +1100 (AEDT) Date: Fri, 20 Dec 2024 20:00:13 +1100 From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: Re: [PATCH v2 00/12] Cleanups to packet pool handling and sizing Message-ID: References: <20241220083535.1372523-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NfQagw5gsWZTd4I7" Content-Disposition: inline In-Reply-To: <20241220083535.1372523-1-david@gibson.dropbear.id.au> Message-ID-Hash: HHONI7F6UMF6UNFFB4Y6P4POQZ4DCLDO X-Message-ID-Hash: HHONI7F6UMF6UNFFB4Y6P4POQZ4DCLDO 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 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: --NfQagw5gsWZTd4I7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2024 at 07:35:23PM +1100, David Gibson wrote: > This... is not any of the things I said I would be working on. I can > only say that a herd of very hairy yaks led me astray. Looking at bug > 66 I spotted some problems with our handling of MTUs / maximum frame > sizes. Looking at that I found some weirdness and some real, if > minor, bugs in the sizing and handling of the packet pools. >=20 > Changes in v2: > * Stefano convinced me that packet_check_range() is still worthwhile. > * So don't remove it... but in looking at it I spotted various > flaws in the checks, so address those in a number of new patches. >=20 > David Gibson (12): > test focus > hack: stop on fail, but not perf fail > make passt dumpable Argh, oops. Of course, 1..3 are test/debug patches that should not be included in the series. > packet: Use flexible array member in struct pool > packet: Don't pass start and offset separately too > packet_check_range() > packet: Don't hard code maximum packet size to UINT16_MAX > packet: Remove unhelpful packet_get_try() macro > util: Add abort_with_msg() and ASSERT_WITH_MSG() helpers > packet: Distinguish severities of different packet_{add,git}_do() > errors > packet: Move packet length checks into packet_check_range() > tap: Don't size pool_tap[46] for the maximum number of packets > packet: More cautious checks to avoid pointer arithmetic UB >=20 > dhcpv6.c | 2 +- > ip.c | 2 +- > isolation.c | 2 +- > packet.c | 106 ++++++++++++++++++++++---------------------------- > packet.h | 19 ++++++--- > passt.h | 2 - > tap.c | 18 +++++++-- > tap.h | 3 +- > test/lib/term | 1 + > test/lib/test | 4 +- > test/run | 38 +++++++++--------- > util.c | 19 +++++++++ > util.h | 25 +++++------- > vu_common.c | 34 ++++++++++------ > 14 files changed, 153 insertions(+), 122 deletions(-) >=20 --=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 --NfQagw5gsWZTd4I7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmdlMgkACgkQzQJF27ox 2GcvlQ/9HvCo2c++bD+IxabO9aV7Ze/VcZ7rP1UQxN+0++88SOecpW1HHb0aauFB 9K3yrMhMpkDZs6Qgl0xNFUhg6/LvXvPKHiTVlbQZCUeucp5LJCRQF9UvmcT/+MZj b2Bb2eNokQEhA6LytO7ebmfDpZSbgUvG3U8yqVc//TfNVyBAGduCJQ0/YLp+vzVk ieHQhNBetjtSa1ilXk1qqorh/usqS5O4QEKzyWWnn7O2EdshqlLDXWxohj2V9/4D dM956PXDLVGnFG2sRFKDFUFtD93ugw9MkNQ9W5/78KdwWVrsItDugPY+sPsSLK01 r1osYMEwyxRClfEBcLXLqE+1zJaVrhhlqL1cQw80y8uDfagB0ds06izPEr+wDUIN XIoc490F1dDKcYsTtmOIBbUxhytNL+/RbgQa/mQPRDD9Q8FsTeKYF8hoyID6ByHs vQgXcV8Fe9U1f+yH4EN5za9LxDLy0M2LSFYUgYGegOpExEbPmAfGl1qBT+0n5CKT a8KBWMwcNJR6S2Z0Mdxt/JXH8ycvV698qwMXHqSJaEkb/MeIuoghSeIwGOzBaVLC 33PaCgdgATBBP2t1nvUA4kqxEY/XRd1wICbPOXzzL1a2NAbltlEBxcHlRs1T73uE YLTmY9f25guf1IE6oklW+zntwImDVYt6nnZvObU4fu+sxdi43Zc= =irmR -----END PGP SIGNATURE----- --NfQagw5gsWZTd4I7--