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 190801191A; Wed, 24 Sep 2025 09:53:05 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 2E2D8119B0; Wed, 24 Sep 2025 09:53:02 +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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail.cyberchaos.dev (mail.cyberchaos.dev [195.39.247.168]) by atuin.qyliss.net (Postfix) with ESMTPS id 38B2B119A9 for ; Wed, 24 Sep 2025 09:52:57 +0000 (UTC) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuka.dev; s=mail; t=1758707575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rOdoelBpNh8sJiLQcl7PspZYLBIBGAmXYV67aqinuxY=; b=XNI2c93jJ5B33HVlWpTi0o9TeqCQSje0chepV2T+Ps3McO4baab/JWIlhslYou6qpjV3+d xfhopqIfhPt5I6Y4FA+T+hm3nwIGl3Yf4v6GmV2aNw8DFP1pZyvUFjs/HqtNHq79UHRJ4a zk2BWaeindCnpI/fVYBwNQoEfao7JQU= Date: Wed, 24 Sep 2025 11:52:54 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v4 2/5] tools: add xdp-forwarder To: Alyssa Ross References: <20250923132012.28013-1-yureka@cyberchaos.dev> <20250923132012.28013-3-yureka@cyberchaos.dev> <87zfalkxlv.fsf@alyssa.is> Content-Language: en-US From: Yureka In-Reply-To: <87zfalkxlv.fsf@alyssa.is> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: MYMLZBOPJVR3RIAIMVO44YHRCMTVGZVM X-Message-ID-Hash: MYMLZBOPJVR3RIAIMVO44YHRCMTVGZVM X-MailFrom: yuka@yuka.dev X-Mailman-Rule-Hits: member-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address CC: 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: On 9/23/25 17:16, Alyssa Ross wrote: > 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! I found out that the clang-tidy failure is partially because of clang_21 being added to the nativeBuildInputs. But it is _not_ because of a version mismatch of clang_21 and clang-tools. Using the matching llvmPackages_21.clang-tools still yields the same error.