From nobody Fri Sep 25 23:09:25 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 945424DBD67 for ; Mon, 7 Sep 2026 16:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788797698; cv=none; b=QFXevQxIXd2jnqb43+bl7jXvpK/1SC6AWCQ/O3rBnQo69+Br2mJpOnwSrbNEo4Hr1KL7pIf+zFeGmp2uY3bL3eE+h4C7ZYMw6WKQi2eZ5FNuOJfOnh8CHGV1ALR3gB1iWBpki0J5jlsErSjob2/bNwd4iUi20jJKKhhwpLn6dao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788797698; c=relaxed/simple; bh=i9Jn+nMK5yRKJILpxGhn4u+rjeyL7aCOIsewDJssZDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qA3nD+Pm0g+S6q1s6fMqRG+HGi+sKxfKqmnVb9xcl85uftlmUCpNlmHFtgpNZdBw7JAr2RFcOh0Xyj5NhiXRy0EuZRA1Negq8yVv5/GWYB8m+H4EqSDL8JjIOzdZFcny9rZfaBpo+KbrZ0LBXRnyITA4Z1uDFpE7cN3B1oHyrcg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gy8h3Q8H; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gy8h3Q8H" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 04ACB1A1A3E; Mon, 7 Sep 2026 16:14:55 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CD70A60383; Mon, 7 Sep 2026 16:14:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 56C6211C79FF1; Mon, 7 Sep 2026 18:14:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1788797689; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=28SvcWgrOztUICc4tgGJQGEoj/8YPhXVEIGuRH590fY=; b=gy8h3Q8H8baCsejxCAwmcrrrVlG2bpxVFCEFl1pRzcoz2uOFJ2ewLCVbItFVcOWIt4CjfK ZtBd8I2ZSDBzP0FqQVtef95Emjz78vY9TsTRcf9KNFGntXHDS98CPtbDTRWivqZPrjq+dF M31KuzsPfTfYoLK0JNzrOiC30ljbH+Am9Uk8015ulQ6A98DWuTBnCvR3Smq5k3FsFL7EtP /fd6t3QS3jbTdY1IC4yzDMabrL9lQxg5lHc5J4Peg1pVd+yqrxik70plLugw9wLipUgeHz SjageWEHpt/Ko0wKlWcGE5naXdRCimuhnNRigmQIhvMigpAxjP6inaGTr730Bg== From: "Maxime Chevallier (Netdev Foundation)" To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Simon Horman , Shuah Khan , matttbe@kernel.org, Stanislav Fomichev Cc: "Maxime Chevallier (Netdev Foundation)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-kselftest@vger.kernel.org Subject: [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Date: Mon, 7 Sep 2026 18:14:35 +0200 Message-ID: <20260907161438.755125-2-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260907161438.755125-1-maxime.chevallier@bootlin.com> References: <20260907161438.755125-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The ynl tool and libraries may be built standalone or through the drivers/net/hw selftest machinery. This may target a different arch, so we need to take the CROSS_COMPILE variable into account for LLVM and gcc. Let's include the tools/scripts/Makefile.include that deals with the CC/AR resolution. Fixup the ynltool CFLAGS handling to use +=3D, so that we don't override the ones set in Makefile.include. Makefile.include also sets the Q variable for verbose mode, so we can drop it from the ynltool Makefile. This will allow properly selection the verbosity of ynltool builds with the V=3D1 make flag. Reviewed-by: Matthieu Baerts (Netdev Foundation) Signed-off-by: Maxime Chevallier (Netdev Foundation) --- tools/net/ynl/Makefile | 1 + tools/net/ynl/generated/Makefile | 3 ++- tools/net/ynl/lib/Makefile | 3 ++- tools/net/ynl/tests/Makefile | 2 +- tools/net/ynl/ynltool/Makefile | 6 ++---- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile index 3cefe4ed96cb..838c465d65aa 100644 --- a/tools/net/ynl/Makefile +++ b/tools/net/ynl/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 =20 +include ../../scripts/Makefile.include include ../../scripts/Makefile.arch =20 INSTALL ?=3D install diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Mak= efile index ea4128f612d6..5a186349b5a8 100644 --- a/tools/net/ynl/generated/Makefile +++ b/tools/net/ynl/generated/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 =20 -CC=3Dgcc +include ../../../scripts/Makefile.include + CFLAGS +=3D -std=3Dgnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshad= ow \ -I../lib/ -idirafter $(UAPI_PATH) ifeq ("$(DEBUG)","1") diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile index 9b98c0599600..7b3eae89982f 100644 --- a/tools/net/ynl/lib/Makefile +++ b/tools/net/ynl/lib/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 =20 -CC=3Dgcc +include ../../../scripts/Makefile.include + CFLAGS +=3D -std=3Dgnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshad= ow ifeq ("$(DEBUG)","1") CFLAGS +=3D -g -fsanitize=3Daddress -fsanitize=3Dleak -static-libasan diff --git a/tools/net/ynl/tests/Makefile b/tools/net/ynl/tests/Makefile index 40827ca8e579..99ae7dcd6348 100644 --- a/tools/net/ynl/tests/Makefile +++ b/tools/net/ynl/tests/Makefile @@ -2,8 +2,8 @@ # Makefile for YNL tests =20 include ../Makefile.deps +include ../../../scripts/Makefile.include =20 -CC=3Dgcc CFLAGS +=3D -std=3Dgnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshad= ow \ -I../lib/ -I../generated/ -I../../../testing/selftests/ \ -idirafter $(UAPI_PATH) diff --git a/tools/net/ynl/ynltool/Makefile b/tools/net/ynl/ynltool/Makefile index 48b0f32050f0..b8c67cdb4fdf 100644 --- a/tools/net/ynl/ynltool/Makefile +++ b/tools/net/ynl/ynltool/Makefile @@ -1,12 +1,12 @@ # SPDX-License-Identifier: GPL-2.0-only =20 include ../Makefile.deps +include ../../../scripts/Makefile.include =20 INSTALL ?=3D install prefix ?=3D /usr =20 -CC :=3D gcc -CFLAGS :=3D -Wall -Wextra -Werror -O2 +CFLAGS +=3D -Wall -Wextra -Werror -O2 ifeq ("$(DEBUG)","1") CFLAGS +=3D -g -fsanitize=3Daddress -fsanitize=3Dleak -static-libasan endif @@ -27,8 +27,6 @@ include $(wildcard *.d) =20 all: $(YNLTOOL) =20 -Q =3D @ - $(YNLTOOL): ../libynl.a $(OBJS) $(Q)echo -e "\tLINK $@" $(Q)$(CC) $(CFLAGS) -o $@ $(OBJS) ../libynl.a -lm --=20 2.55.0 From nobody Fri Sep 25 23:09:25 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B3195013B5; Mon, 7 Sep 2026 16:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788797704; cv=none; b=JdQmxv0UGr20g2hzxO8xvUyXQPUuWi0+g19ThQOndbfp3HukfRdR+8MNjDCC2/cwrIIBXeJ6XUQLbvWkr64oE8jCOVMh92F/XcTdZsu6tUmJ1wuUbxjjPHG3TfuqK/0qSZLtYT5Cl+89FVFBRmdXWy+PvAJ1RuXsLlRrwTRUj4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788797704; c=relaxed/simple; bh=GXS7uy7ZQPlg5GAAD/bVVz/FgtCNKoR5H+ZSEQtiRAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ll/5Xg7gy83lTU3/QGVC0ruJlc5QnSgnjTDywUv8xZQAxw4slLkwMODpJcCS3bSG/kKjsnBG3yvP7ZRjxaJ3zfCz+Q8fwNJg5zR1j0E/ptkg/vMKO6foMS06E0sKM0/wBBK+vkKlyVh9ndGVEaoFlZyt1ADLqWIX6Wu87FfW02w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=TI03mc4c; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="TI03mc4c" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id BFDC41A1A3E; Mon, 7 Sep 2026 16:15:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8B1D560383; Mon, 7 Sep 2026 16:15:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 732ED11C79257; Mon, 7 Sep 2026 18:14:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1788797696; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=RrpUiysZLfwdvwiw0RYbueYYBMWHQpaCTOyhsapAyQ8=; b=TI03mc4c2oDqd2HqNbQsZ7+QElDhxqHZs3moa6s81RDIrCOBBtzy1AFPZVUid8C35nVyiH WNeuja3Cx5nTdEN6IDFnLGRbACQJ0qx2MiHjcuBtlBrvDmT61PAZsb/sfPt310WQ/eZuMf hfKXhGLT3h1Bhll+yL/s7S8Dh85h/ErsiqlmOmTmi+39GVZb0FF+lLnlc4mtuPpaQjOZxL K6MNzAaTLgSkftyuaRTKSYPXp7C8KpGwJ0QmMun2wQnKv4x9mHFUM0N4kH+GOqsszBETSH mLTXbvyNJL2x8+Rpfjctv9pm6XNjk3cawt0Vyze+jwWznBFAuIfL15nV3jNkrw== From: "Maxime Chevallier (Netdev Foundation)" To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Simon Horman , Shuah Khan , matttbe@kernel.org, Stanislav Fomichev Cc: "Maxime Chevallier (Netdev Foundation)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-kselftest@vger.kernel.org Subject: [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check Date: Mon, 7 Sep 2026 18:14:36 +0200 Message-ID: <20260907161438.755125-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260907161438.755125-1-maxime.chevallier@bootlin.com> References: <20260907161438.755125-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" To test for the presence of zerocopy support in the available liburing, a small check program is compiled. The CC value used for the io_uring library check defaults to the host compiler, which will incorrectly validate liburing based on the host's sysroot and not the target's. Normally the CC for cross-compile is set in lib.mk, but this also requires the test list to be set when we include it, and this check needs to run first. Note that this doesn't cover the LLVM cross-compiling case though, as with LLVM we may still detect based on the host liburing. Suggested-by: Matthieu Baerts (NGI0) Reviewed-by: Matthieu Baerts (Netdev Foundation) Signed-off-by: Maxime Chevallier (Netdev Foundation) --- tools/testing/selftests/drivers/net/hw/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testin= g/selftests/drivers/net/hw/Makefile index 6105be8e590f..f9458dc6c150 100644 --- a/tools/testing/selftests/drivers/net/hw/Makefile +++ b/tools/testing/selftests/drivers/net/hw/Makefile @@ -1,5 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ OR MIT =20 +# Set CC for the io_uring check +ifeq ($(LLVM)$(CC),cc) +CC :=3D $(CROSS_COMPILE)gcc +endif + # Check if io_uring supports zero-copy receive HAS_IOURING_ZCRX :=3D $(shell \ echo -e '#include \n' \ --=20 2.55.0