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=202502 header.b=ECPnY1+Z; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 229AB5A0008 for ; Wed, 12 Mar 2025 04:07:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1741748820; bh=bLcq+BGI483NXMgwSYWgcfYYfnw1EGpQEGqmTfxUyL8=; h=From:To:Cc:Subject:Date:From; b=ECPnY1+Zpzl7fCkS8Zng1CZzvf+nkYydcZ5G8++FVE6/oQE3wgOZM/lXoCcjDt51B 76jPM6qFPHp7sPYhESN9rimJVOZ0l9ZunYrrgJd/leIJM0qzjBk9hAzySgXWFNY692 OOVZdlHJvRCaMTjPzsiZ207s+289oDqlY+Q1d0QLyrUwQLk3TJB9eSQcjwF/rUheOK Z5aQSbelEvWsB9uTqzU6qGw+ILeV6A4DmK13LV4yhROuURjqyuZkhprOwygEfOI6sU Pr+CVCeZhga80QQHDICu2Bei8puiVbdofPbJFj6XASWUgWIp0a0x5KGmelFipzkOrV oBTWV/dIvb5hg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ZCFsc4q0Bz4x89; Wed, 12 Mar 2025 14:07:00 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 0/9] Improve handling of MTU limits Date: Wed, 12 Mar 2025 13:18:30 +1100 Message-ID: <20250312021839.2405877-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: UF5URVPFLA7CVJZ3HELC56RIAMVKAPKQ X-Message-ID-Hash: UF5URVPFLA7CVJZ3HELC56RIAMVKAPKQ 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: After considerable lead up, this corrects the handling of the --mtu option so that it will respect limits imposed by the backend tap layers, correctly accounting for L2 headers. This incorporates the earlier mode setting patches, on which the rest depend. There's been no change in those patches, there just included here for self-containedness. v2: * More static_assert() validation of frame limits in 6/9 * Cosmetic fixups in 6/9 David Gibson (9): conf: Use the same optstring for passt and pasta modes conf: Move mode detection into helper function conf: Detect vhost-user mode earlier packet: Give explicit name to maximum packet size packet: Remove redundant TAP_BUF_BYTES define tap: Use explicit defines for maximum length of L2 frame Simplify sizing of pkt_buf pcap: Correctly set snaplen based on tap backend type conf: Limit maximum MTU based on backend frame size conf.c | 98 +++++++++++++++++++++++++++++++++++++++++--------------- conf.h | 1 + packet.c | 4 +-- packet.h | 3 ++ passt.c | 16 ++------- passt.h | 7 ++-- pcap.c | 46 +++++++++++++------------- tap.c | 44 ++++++++++++++++++++++--- tap.h | 26 +++++++++++++++ util.h | 3 -- 10 files changed, 173 insertions(+), 75 deletions(-) -- 2.48.1