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 BBD28CCE0; Tue, 23 Sep 2025 15:32:11 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id C25AECD60; Tue, 23 Sep 2025 15:32:08 +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 fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) by atuin.qyliss.net (Postfix) with ESMTPS id CF65ECD5F for ; Tue, 23 Sep 2025 15:32:07 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 1A1DEEC00B1; Tue, 23 Sep 2025 11:32:07 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 23 Sep 2025 11:32:07 -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=1758641527; x=1758727927; bh=sg+dQ8gQD2 Aeb0wfy4gKwODpQ1cMeWYpZiI7zaorAM4=; b=ZoUr/9JzoqxFEhQo4wHv4ciOvR 9NWl3/ArvkS96NXO5GuUe8cjo2+hiyWW6zYf7zg1YbkHQIo7FtAiP/w1w2KldzgT vcwn2yp1XnBzxZwF5Sx4MU9AMOJhlcL/BNjzGVzjbOdQY4mrIBBDFoREeUEvJ1Sh yjDdJ/hKJG0Njc2dV4Ldz4Yd45r6FWlILqOwI9VmiiVEPad8DPN1bGZGJ5LyPlTY bc48Gc4TmErt61aSILuP/BqviBobzwrHRZzxHQdm0CxhIyrrlBP9qPw4KrArX5Rd Su3aJcq3p+0OQxkkpsqDxk63R3wNk9VgiPVz2mp5XhD5w80FkTVJXfZ/EtdQ== 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= 1758641527; x=1758727927; bh=sg+dQ8gQD2Aeb0wfy4gKwODpQ1cMeWYpZiI 7zaorAM4=; b=dRotBuen8hRDpbQRIQ2jnRkzoiCu+0/SLnSuRp4kSS/bkyZBEHM RyghZXzsXg44tqpV/jI2BVZeuA3NGJTpifsqwR/24HEWglDCa9RAI9/Tv5XbbME5 +hlLhCdtW0iYyA0u5fnSvYo5RoIxHLJFQA9HyWJAuu7yaR0NOOrDh6Fgj/pVGskr nk8Gdr1/a0ZumcV6U8eQJ75o9RUT/suFTI5VhcDBzJwosZ++a1mm8R1wzOBJs8Tg sL3pA2ftzKk6Lp0ULJpKpQVAMul0iPcIrFt5J//Ddoj5uAy+1+AlMS2V3bWvU+e/ 5fSVvOKcZ7BG5F9ndNe8kIjvUl6WNiyOGCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeiuddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephffvvefujghffffkgggtsehgtderredttd ejnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeen ucggtffrrghtthgvrhhnpedtheehhfekieevffekkeduvdejffdtiefgkeeuudehtdeite duheeiueejjeefgeenucffohhmrghinhepmhgvshhonhgsuhhilhgurdgtohhmnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihsh hsrgdrihhspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphht thhopeguvghvvghlsehsphgvtghtrhhumhdqohhsrdhorhhgpdhrtghpthhtohephihukh grseihuhhkrgdruggvvh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Sep 2025 11:32:06 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 84F9224C7C0C; Tue, 23 Sep 2025 17:31:55 +0200 (CEST) From: Alyssa Ross To: Yureka Subject: Re: [PATCH v4 2/5] tools: add xdp-forwarder In-Reply-To: <3b730bf9-15f7-43c9-8ea7-4ebd20e9d3e5@yuka.dev> References: <20250923132012.28013-1-yureka@cyberchaos.dev> <20250923132012.28013-3-yureka@cyberchaos.dev> <87plbhurp5.fsf@alyssa.is> <3b730bf9-15f7-43c9-8ea7-4ebd20e9d3e5@yuka.dev> Date: Tue, 23 Sep 2025 17:31:44 +0200 Message-ID: <87qzvxkwwv.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: VACNN7PELEEGTUYUVCHHBPPOC752EAFC X-Message-ID-Hash: VACNN7PELEEGTUYUVCHHBPPOC752EAFC 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: 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; charset=utf-8 Content-Transfer-Encoding: quoted-printable Yureka writes: > On 9/23/25 17:14, Alyssa Ross wrote: >> Yureka Lilian writes: >>> @@ -88,12 +94,15 @@ stdenv.mkDerivation (finalAttrs: { >>> mesonFlags =3D [ >>> (lib.mesonBool "app" appSupport) >>> (lib.mesonBool "host" hostSupport) >>> + (lib.mesonBool "driver" driverSupport) >>> "-Dhostfsrootdir=3D/run/virtiofs/virtiofs0" >>> "-Dtests=3Dfalse" >>> "-Dunwind=3Dfalse" >>> "-Dwerror=3Dtrue" >>> ]; >>>=20=20=20 >>> + hardeningDisable =3D lib.optionals driverSupport [ "zerocallusedregs= " ]; >>> + >> Could we instead do this in bpf_o_cmd, so it's not disabled for >> userspace programs? > This environment variable works on the stdenv level, so it is difficult=20 > to mix it in from the meson recipe. Any way to do this would add NixOS=20 > specifics to the meson recipe and doesn't feel quite right. The environment variable in stdenv just adds =2Dfzero-call-used-regs=3Dused-gpr to the compiler flags, before the ones given on the command line, so I was thinking we could just add =2Dfzero-call-used-regs=3Dskip (the default) to bpf_o_cmd, to explicitly say we don't want it for these compiler invocations. It'll override the option given by the compiler wrapper, and won't do anything Nix-specific =E2=80=94 it would be the right thing for other distros that change compiler defaults as well, which I think is not that uncommon. >>> diff --git a/tools/xdp-forwarder/meson.build b/tools/xdp-forwarder/meso= n.build >>> new file mode 100644 >>> index 0000000..e6d91ca >>> --- /dev/null >>> +++ b/tools/xdp-forwarder/meson.build >>> @@ -0,0 +1,48 @@ >>> +# SPDX-License-Identifier: EUPL-1.2+ >>> +# SPDX-FileCopyrightText: 2025 Yureka Lilian >>> +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour >>> + >>> +libbpf =3D dependency('libbpf', version : '1.6.2') >>> + >>> +executable('set-router-iface', 'set_router_iface.c', >>> + dependencies : libbpf, >>> + install : true) >>> + >>> +clang =3D find_program('clang') >> Should be native: true I think. > I can't find a parameter 'native' for find_program() in the meson docs.=20 > Can you explain why this option is needed? Is it to prevent passing two=20 > --target args when cross-compiling? It's to prevent it trying to execute clang for the system you're building for. You'd use find_program(=E2=80=A6, native: false) (the defaul= t) if you wanted to embed the path to that program in your binary, for example. Documentation is here: https://mesonbuild.com/Reference-manual_functions.html#find_program_native --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaNK9YQAKCRBbRZGEIw/w ooSbAP4mngIMyH8nosM08JMD+OmavpsKEfHF4StH5USmeuGduQEA9vFRLE0zRq3h w0QpdgNvf8fet41xPxI56tpjlSV4wgo= =zvl7 -----END PGP SIGNATURE----- --=-=-=--