From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 83688CB83; Tue, 23 Sep 2025 15:17:02 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 724DDCA6C; Tue, 23 Sep 2025 15:16:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) by atuin.qyliss.net (Postfix) with ESMTPS id 3B095CA6B for ; Tue, 23 Sep 2025 15:16:57 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 76DBD1400067; Tue, 23 Sep 2025 11:16:56 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 23 Sep 2025 11:16:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1758640616; x=1758727016; bh=xAtQlrfY90 9smvKy0EjqNjTWMC5S+UxmBVO8/XDnIkc=; b=pu4YnGVImk3NPKBvLlU1jMRjZ7 hidE61NzjC7NS7QIOeTz/zQEmNeYVvs6DkqBLSc6sygrtYMkkg5gwnk0lZfz7FCZ eHH+fyMlEpdH3bpCZwyCOXR58iw6HNTgsKbsqOZCcjuHVcaHDjTgLBJbTnOc7HjG UEx+kn5C7iz/oMy6kdJIqtkdYcuUSTdDT1t8CfFXIDx1WZjY7CXohrPfdw0LTcz5 GfJMWA9wOgqXW2d+lq6Bo04gN0ZuttdLcCEX6UTSmRVynpWSxCJfbef9ue2hS6Ch NfONOSV3wgRFmrW0ccd7Tmj7NW6Kj2W+JhL/nwFf0D/GZtvl7X5X0gBWSIOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758640616; x=1758727016; bh=xAtQlrfY909smvKy0EjqNjTWMC5S+UxmBVO 8/XDnIkc=; b=hPCZPnU/XVy5BYn1CMMXBmxhpdMFPivskLHSkJzY6n0iRDJAuTH WpVKfq4zAsaQFWAfYjOstv9gfrq419S6zVWmW20KMGIvgCWBIaUgMHAMMC5FFVjv WS5Hilzpdw7fLBV4rAQgFDUoH7ouZaVOFQr0jn8oqnQhkLEMyIteRFm57QTD0GpQ 74mQNXTHZvpHRPezApXIA1zixQAQtmDx3cSqqpAOqgCxEF/fabLLvWx4RJyW7Gvb saN+/k1+YpHk5zGTMnJCdEKCMwB8SAF1wOJWob1trFZDwXRcL1PG4iBprA0HK7OZ G0Dym/2CPTLOelrgQHJK0l5JMmQogiF9Zyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeiuddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeih uhhrvghkrgestgihsggvrhgthhgrohhsrdguvghvpdhrtghpthhtohepuggvmhhiohgsvg hnohhurhesghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhu mhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Sep 2025 11:16:56 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id F3C1524C7885; Tue, 23 Sep 2025 17:16:44 +0200 (CEST) From: Alyssa Ross To: Yureka Lilian Subject: Re: [PATCH v4 2/5] tools: add xdp-forwarder In-Reply-To: <20250923132012.28013-3-yureka@cyberchaos.dev> References: <20250923132012.28013-1-yureka@cyberchaos.dev> <20250923132012.28013-3-yureka@cyberchaos.dev> Date: Tue, 23 Sep 2025 17:16:44 +0200 Message-ID: <87zfalkxlv.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: KU7ZWHS5I6LRCTJW53KQX3NLVIWITPWK X-Message-ID-Hash: KU7ZWHS5I6LRCTJW53KQX3NLVIWITPWK X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Demi Marie Obenour , devel@spectrum-os.org X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Yureka Lilian writes: > The xdp-forwarder's purpose is implementing the functionality needed > within the net-vm (a VM running the Linux drivers for any physical > interfaces on the spectrum system). > > In the future, the net-vm will load the included XDP programs on the > passed-through physical interfaces as well as the downstream virtio > interface going into the router (recognized by its special MAC address). > > The net-vm needs to multiplex between the physical interfaces, as there > might be several interfaces in the same IOMMU-group. > > For this, the XDP program loaded on the physical interfaces > (`prog_physical.o`) applies a VLAN tag corresponding to the interface id > and redirects the packets to the router interface (identified by the > `router_iface` bpf map). In the other direction the XDP program loaded on > the router interface (`prog_router.o`) removes one layer of VLAN tagging > and redirects the packets to the interface read from the VLAN tag. > > The helper program `set_router_iface` is used to update the `router_iface` > bpf map to point to the interface passed as argument to the program. > > Co-authored-by: Demi Marie Obenour > Signed-off-by: Yureka Lilian > --- > pkgs/default.nix | 4 + > release/checks/pkg-tests.nix | 1 + > tools/default.nix | 15 +- > tools/meson.build | 4 + > tools/meson_options.txt | 3 + > tools/xdp-forwarder/include/parsing_helpers.h | 274 ++++++++++++++++++ > tools/xdp-forwarder/include/rewrite_helpers.h | 146 ++++++++++ > tools/xdp-forwarder/meson.build | 48 +++ > tools/xdp-forwarder/prog_physical.c | 39 +++ > tools/xdp-forwarder/prog_router.c | 43 +++ > tools/xdp-forwarder/set_router_iface.c | 30 ++ > 11 files changed, 604 insertions(+), 3 deletions(-) > create mode 100644 tools/xdp-forwarder/include/parsing_helpers.h > create mode 100644 tools/xdp-forwarder/include/rewrite_helpers.h > create mode 100644 tools/xdp-forwarder/meson.build > create mode 100644 tools/xdp-forwarder/prog_physical.c > create mode 100644 tools/xdp-forwarder/prog_router.c > create mode 100644 tools/xdp-forwarder/set_router_iface.c release/checks/pkg-tests.nix fails with this patch applied, because clang-tidy can't find headers. I'm happy to look into why that is, but if you feel like having a look or already know what's happening, please let me know! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaNK53AAKCRBbRZGEIw/w ovY9AP9i92cLYyyZDzwQdpiLc4F+uFJDJoStgnKnlDb67BxXxgEAwt9qKBuL43QK A0h7fupHaTbZNZPG5idDvLKayjkeEwc= =Kv16 -----END PGP SIGNATURE----- --=-=-=--