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=ha52+L7g; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id A2B2C5A0627 for ; Fri, 20 Dec 2024 09:58:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1734685098; bh=4WCs7CKnk+shFmfoCxkYDJmqJTMDWk/I+6zXwxDzSHc=; h=From:To:Cc:Subject:Date:From; b=ha52+L7gBuNj49UxuZdJ7WHBgEviWMNfUAeDpRbve6tLJRHL4Zj7bgIzBjPyZcRNj RnW7CUP+TcXwl/v6blGgZ2e7A/ZWoNt5agZwMuyOe9oGYvf2dVh/1MnGFtPPKQaqso E3fI4Xlle9BNXUr3v7CSjkpzWcpxq+bA6lHO2OOOXpKvHNVNXoQaMxUJdROz4Ca1Bj BiCoY0JIS97yVUY0kRGSWCVIJsnuWZPD/v1tgnVhAHodwW4AlCabX3mcbjfD0h+cwN Tl3mrC8Wxo48bUnAQ4NyK1eUAseNeU2xALBrH8tFi++ngI76W6j/eQVmsjES15oVYF uL20spi/B25ag== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YF1Xp0Pqzz4x6P; Fri, 20 Dec 2024 19:58:18 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 00/12] Cleanups to packet pool handling and sizing Date: Fri, 20 Dec 2024 19:35:23 +1100 Message-ID: <20241220083535.1372523-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: UXXLUFXV2D6ZGZQQBNRDAQD33QKMQ2S5 X-Message-ID-Hash: UXXLUFXV2D6ZGZQQBNRDAQD33QKMQ2S5 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: David Gibson 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: 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. 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. David Gibson (12): test focus hack: stop on fail, but not perf fail make passt dumpable 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 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(-) -- 2.47.1