* [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests
@ 2026-09-07 16:14 Maxime Chevallier (Netdev Foundation)
2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation)
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Maxime Chevallier (Netdev Foundation) @ 2026-09-07 16:14 UTC (permalink / raw)
To: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Donald Hunter, Simon Horman, Shuah Khan, matttbe,
Stanislav Fomichev
Cc: Maxime Chevallier (Netdev Foundation),
netdev, linux-kernel, thomas.petazzoni, linux-kselftest
Hi,
This is the third version for the ynl and drivers/net/hw
cross-compilation enablement series.
Changes come from Sashiko reviews, that detected some Makefile inclusion
ordering issues, a stray 'Q = @' in the ynl makefiles to have proper
verbosity support, and some commit log rewording.
Changes in V3:
- Add Matthieu's review tags
- Drop 'Q = @' line in patch 1, it's now handled properly through
Makefile.include
- Include Makefile.include before Makefile.arch
- Reword the commit logs to explain the limitations
Changes in V2:
V2: https://lore.kernel.org/r/20260903155524.2241065-1-maxime.chevallier@bootlin.com
- Update the topic for patch 1
- Update the CC construction for patch 2
V1: https://lore.kernel.org/r/20260901164200.1124343-1-maxime.chevallier@bootlin.com
Maxime Chevallier (Netdev Foundation) (2):
tools: ynl: Allow cross-compiling ynl and associated tools
selftests: drv-net: Use cross-compilation environment for the io_uring
check
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 ++----
tools/testing/selftests/drivers/net/hw/Makefile | 5 +++++
6 files changed, 13 insertions(+), 7 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools 2026-09-07 16:14 [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests Maxime Chevallier (Netdev Foundation) @ 2026-09-07 16:14 ` Maxime Chevallier (Netdev Foundation) 2026-09-08 16:17 ` netdev-bot+sashiko 2026-09-09 1:11 ` Bobby Eshleman 2026-09-07 16:14 ` [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check Maxime Chevallier (Netdev Foundation) ` (2 subsequent siblings) 3 siblings, 2 replies; 8+ messages in thread From: Maxime Chevallier (Netdev Foundation) @ 2026-09-07 16:14 UTC (permalink / raw) To: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Donald Hunter, Simon Horman, Shuah Khan, matttbe, Stanislav Fomichev Cc: Maxime Chevallier (Netdev Foundation), netdev, linux-kernel, thomas.petazzoni, linux-kselftest 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 +=, 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=1 make flag. Reviewed-by: Matthieu Baerts (Netdev Foundation) <matttbe@kernel.org> Signed-off-by: Maxime Chevallier (Netdev Foundation) <maxime.chevallier@bootlin.com> --- 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 +include ../../scripts/Makefile.include include ../../scripts/Makefile.arch INSTALL ?= install diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile 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 -CC=gcc +include ../../../scripts/Makefile.include + CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ -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 -CC=gcc +include ../../../scripts/Makefile.include + CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow ifeq ("$(DEBUG)","1") CFLAGS += -g -fsanitize=address -fsanitize=leak -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 include ../Makefile.deps +include ../../../scripts/Makefile.include -CC=gcc CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ -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 include ../Makefile.deps +include ../../../scripts/Makefile.include INSTALL ?= install prefix ?= /usr -CC := gcc -CFLAGS := -Wall -Wextra -Werror -O2 +CFLAGS += -Wall -Wextra -Werror -O2 ifeq ("$(DEBUG)","1") CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan endif @@ -27,8 +27,6 @@ include $(wildcard *.d) all: $(YNLTOOL) -Q = @ - $(YNLTOOL): ../libynl.a $(OBJS) $(Q)echo -e "\tLINK $@" $(Q)$(CC) $(CFLAGS) -o $@ $(OBJS) ../libynl.a -lm -- 2.55.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools 2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation) @ 2026-09-08 16:17 ` netdev-bot+sashiko 2026-09-09 1:11 ` Bobby Eshleman 1 sibling, 0 replies; 8+ messages in thread From: netdev-bot+sashiko @ 2026-09-08 16:17 UTC (permalink / raw) To: maxime.chevallier Cc: andrew+netdev, davem, edumazet, kuba, pabeni, donald.hunter, horms, shuah, matttbe, sdf, netdev, linux-kernel, thomas.petazzoni, linux-kselftest Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: Critical: 0 · High: 0 · Medium: 2 · Low: 0 - [Medium] tools/net/ynl/ynltool/Makefile now inherits the tools/ `O=` -> `OUTPUT` contract from tools/scripts/Makefile.include but only half-… - [Medium] Removing the `CC=gcc` pin while letting Makefile.include select clang makes the GCC-only `-static-libasan` flag reach clang,… -- tools: ynl: Allow cross-compiling ynl and associated tools The four ynl Makefiles now include tools/scripts/Makefile.include so that CC and AR honour CROSS_COMPILE and LLVM, the ynltool CFLAGS assignment is switched from := to += and the local Q definition is dropped in favour of the one from Makefile.include. No Link: tags in the commit header. Two questions below, one about O= handling in ynltool and one about -static-libasan now that CC is no longer pinned to gcc. > diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile > index 3cefe4ed96cb9..838c465d65aa8 100644 > --- a/tools/net/ynl/Makefile > +++ b/tools/net/ynl/Makefile > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0 > > +include ../../scripts/Makefile.include > include ../../scripts/Makefile.arch > > INSTALL ?= install > diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile > index ea4128f612d6c..5a186349b5a86 100644 > --- a/tools/net/ynl/generated/Makefile > +++ b/tools/net/ynl/generated/Makefile > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0 > > -CC=gcc > +include ../../../scripts/Makefile.include > + > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ > -I../lib/ -idirafter $(UAPI_PATH) > ifeq ("$(DEBUG)","1") > diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile > index 9b98c05996000..7b3eae89982f8 100644 > --- a/tools/net/ynl/lib/Makefile > +++ b/tools/net/ynl/lib/Makefile > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0 > > -CC=gcc > +include ../../../scripts/Makefile.include > + > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow > ifeq ("$(DEBUG)","1") > CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan > diff --git a/tools/net/ynl/tests/Makefile b/tools/net/ynl/tests/Makefile > index 40827ca8e579d..99ae7dcd63484 100644 > --- a/tools/net/ynl/tests/Makefile > +++ b/tools/net/ynl/tests/Makefile > @@ -2,8 +2,8 @@ > # Makefile for YNL tests > > include ../Makefile.deps > +include ../../../scripts/Makefile.include > > -CC=gcc [Severity: Medium] With the CC=gcc pin removed here, does a "make LLVM=1 -C tools/net/ynl" build still complete? Makefile.include picks clang for LLVM builds: ifneq ($(LLVM),) ... $(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX)) and tests/Makefile turns the sanitizer flags on unless NDEBUG=1: ifneq ("$(NDEBUG)","1") CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan endif clang's driver does not accept -static-libasan. Other selftests Makefiles guard exactly this flag, for example tools/testing/selftests/filesystems/openat2/Makefile: # gcc requires -static-libasan in order to ensure that Address Sanitizer's # library is the first one loaded. However, clang already statically links the # Address Sanitizer if -fsanitize is specified. Therefore, simply omit # -static-libasan for clang builds. ifeq ($(LLVM),) CFLAGS += -static-libasan endif tests is listed in SUBDIRS of tools/net/ynl/Makefile and the default goal is "all: $(SUBDIRS) libynl.a", so this is hit by a plain build with LLVM=1 (with or without CROSS_COMPILE, which is the configuration named in the commit message). The same unguarded flag sits on the DEBUG=1 paths of lib/Makefile, generated/Makefile and ynltool/Makefile. Should all four get the ifeq ($(LLVM),) guard as part of this change? > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ > -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 48b0f32050f0e..b8c67cdb4fdf0 100644 > --- a/tools/net/ynl/ynltool/Makefile > +++ b/tools/net/ynl/ynltool/Makefile > @@ -1,12 +1,12 @@ > # SPDX-License-Identifier: GPL-2.0-only > > include ../Makefile.deps > +include ../../../scripts/Makefile.include [Severity: Medium] Does pulling Makefile.include in here break "make O=<dir>" for ynltool? Makefile.include translates a command line O= into OUTPUT: ifneq ($(O),) ifeq ($(origin O), command line) $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd) OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/) ynltool/Makefile already names its targets with that prefix: OBJS := $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) YNLTOOL := $(OUTPUT)ynltool but the only object rule carries no $(OUTPUT) and does not create the directory: %.o: %.c ../libynl.a $(Q)echo -e "\tCC $@" $(Q)$(COMPILE.c) -MMD -c -o $@ $< For a target such as /tmp/out/ynl.o and a target pattern containing no slash, make strips the directory, matches the stem, and re-prepends the directory to the derived prerequisite, so it looks for /tmp/out/ynl.c. There is no vpath and nothing creates /tmp/out, so does "make -C tools/net/ynl/ynltool O=/tmp/out" stop with "No rule to make target '/tmp/out/<name>.o', needed by '/tmp/out/ynltool'"? Command line variables propagate through MAKEFLAGS, and the top level recipe runs the sub-makes with $(SUBDIRS): @if [ -f "$@/Makefile" ] ; then \ $(MAKE) -C $@ ; \ fi so "make -C tools/net/ynl O=/tmp/out" reaches the same path through the default goal. Other tools/ Makefiles that honour this interface spell the rule as $(OUTPUT)%.o: %.c - would that plus an mkdir be the fix here? The install rule interpolates the prefixed name too: install: $(YNLTOOL) $(INSTALL) -m 0755 $(YNLTOOL) $(DESTDIR)$(bindir)/$(YNLTOOL) With OUTPUT set, does the destination become $(DESTDIR)/usr/bin//tmp/out/ynltool rather than $(DESTDIR)/usr/bin/ynltool? Related: lib/Makefile, generated/Makefile and tests/Makefile now include Makefile.include but ignore OUTPUT entirely, so an O= build would keep writing their objects into the source tree while only ynltool tries to honour it. Was leaving the four sub-makefiles inconsistent about O= intentional, or should O= be rejected until they all handle it? > > INSTALL ?= install > prefix ?= /usr > > -CC := gcc > -CFLAGS := -Wall -Wextra -Werror -O2 > +CFLAGS += -Wall -Wextra -Werror -O2 > ifeq ("$(DEBUG)","1") > CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan > endif [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260907161438.755125-1-maxime.chevallier%40bootlin.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools 2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation) 2026-09-08 16:17 ` netdev-bot+sashiko @ 2026-09-09 1:11 ` Bobby Eshleman 1 sibling, 0 replies; 8+ messages in thread From: Bobby Eshleman @ 2026-09-09 1:11 UTC (permalink / raw) To: Maxime Chevallier (Netdev Foundation) Cc: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Donald Hunter, Simon Horman, Shuah Khan, matttbe, Stanislav Fomichev, netdev, linux-kernel, thomas.petazzoni, linux-kselftest On Mon, Sep 07, 2026 at 06:14:35PM +0200, Maxime Chevallier (Netdev Foundation) wrote: > 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 +=, 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=1 make flag. > > Reviewed-by: Matthieu Baerts (Netdev Foundation) <matttbe@kernel.org> > Signed-off-by: Maxime Chevallier (Netdev Foundation) <maxime.chevallier@bootlin.com> Hey Maxime, It seems that this patch may break some invocations of make: # make -C tools/net/ynl/ynltool O=/tmp/o1 make: Entering directory '/data/users/bobbyeshleman/linux-worktrees/review/tools/net/ynl/ynltool' make: *** No rule to make target '/tmp/o1/json_writer.o', needed by '/tmp/o1/ynltool'. Stop. make: Leaving directory '/data/users/bobbyeshleman/linux-worktrees/review/tools/net/ynl/ynltool' Best, Bobby > --- > 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 > > +include ../../scripts/Makefile.include > include ../../scripts/Makefile.arch > > INSTALL ?= install > diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile > 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 > > -CC=gcc > +include ../../../scripts/Makefile.include > + > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ > -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 > > -CC=gcc > +include ../../../scripts/Makefile.include > + > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow > ifeq ("$(DEBUG)","1") > CFLAGS += -g -fsanitize=address -fsanitize=leak -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 > > include ../Makefile.deps > +include ../../../scripts/Makefile.include > > -CC=gcc > CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ > -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 > > include ../Makefile.deps > +include ../../../scripts/Makefile.include > > INSTALL ?= install > prefix ?= /usr > > -CC := gcc > -CFLAGS := -Wall -Wextra -Werror -O2 > +CFLAGS += -Wall -Wextra -Werror -O2 > ifeq ("$(DEBUG)","1") > CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan > endif > @@ -27,8 +27,6 @@ include $(wildcard *.d) > > all: $(YNLTOOL) > > -Q = @ > - > $(YNLTOOL): ../libynl.a $(OBJS) > $(Q)echo -e "\tLINK $@" > $(Q)$(CC) $(CFLAGS) -o $@ $(OBJS) ../libynl.a -lm > -- > 2.55.0 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check 2026-09-07 16:14 [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests Maxime Chevallier (Netdev Foundation) 2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation) @ 2026-09-07 16:14 ` Maxime Chevallier (Netdev Foundation) 2026-09-08 16:17 ` netdev-bot+sashiko 2026-09-09 0:30 ` [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests patchwork-bot+netdevbpf 2026-09-09 0:30 ` Jakub Kicinski 3 siblings, 1 reply; 8+ messages in thread From: Maxime Chevallier (Netdev Foundation) @ 2026-09-07 16:14 UTC (permalink / raw) To: Andrew Lunn, davem, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Donald Hunter, Simon Horman, Shuah Khan, matttbe, Stanislav Fomichev Cc: Maxime Chevallier (Netdev Foundation), netdev, linux-kernel, thomas.petazzoni, linux-kselftest 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) <matttbe@kernel.org> Reviewed-by: Matthieu Baerts (Netdev Foundation) <matttbe@kernel.org> Signed-off-by: Maxime Chevallier (Netdev Foundation) <maxime.chevallier@bootlin.com> --- 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/testing/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 +# Set CC for the io_uring check +ifeq ($(LLVM)$(CC),cc) +CC := $(CROSS_COMPILE)gcc +endif + # Check if io_uring supports zero-copy receive HAS_IOURING_ZCRX := $(shell \ echo -e '#include <liburing.h>\n' \ -- 2.55.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check 2026-09-07 16:14 ` [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check Maxime Chevallier (Netdev Foundation) @ 2026-09-08 16:17 ` netdev-bot+sashiko 0 siblings, 0 replies; 8+ messages in thread From: netdev-bot+sashiko @ 2026-09-08 16:17 UTC (permalink / raw) To: maxime.chevallier Cc: andrew+netdev, davem, edumazet, kuba, pabeni, donald.hunter, horms, shuah, matttbe, sdf, netdev, linux-kernel, thomas.petazzoni, linux-kselftest Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: Critical: 0 · High: 0 · Medium: 1 · Low: 1 - [Medium] Incomplete fix: the new guard `ifeq ($(LLVM)$(CC),cc)` in tools/testing/selftests/drivers/net/hw/Makefile only overrides CC when… - [Low] Missing `Fixes:` tag. -- selftests: drv-net: Use cross-compilation environment for the io_uring check This sets CC to $(CROSS_COMPILE)gcc in the drivers/net/hw selftests Makefile before the liburing feature probe runs, so that the probe uses the target toolchain instead of the host compiler. The override is applied only when make's CC is still the built-in default and LLVM is unset. No Link: tag present in the commit header. > diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile > index 6105be8e590f7..f9458dc6c1508 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 > > +# Set CC for the io_uring check > +ifeq ($(LLVM)$(CC),cc) > +CC := $(CROSS_COMPILE)gcc > +endif [Severity: Medium] Does this condition cover the case where CC comes from the environment rather than from make's built-in default? With something like: export CC=gcc-13 make -C tools/testing/selftests/drivers/net/hw CROSS_COMPILE=aarch64-linux-gnu- $(LLVM)$(CC) expands to gcc-13, so the override is skipped and the probe below runs the host gcc-13. Later, lib.mk does: tools/testing/selftests/lib.mk: ifneq ($(LLVM),) CC := $(CLANG) $(CLANG_FLAGS) -fintegrated-as else CC := $(CROSS_COMPILE)gcc endif # LLVM Since that is a := assignment in a makefile, it overrides the environment-origin CC, so the compiler that actually links iou-zcrx is not the one that was probed. Would an origin test such as: ifeq ($(origin CC),default) or mirroring lib.mk's own ifneq ($(LLVM),) ... else CC := $(CROSS_COMPILE)gcc structure (as tools/testing/selftests/arm64/mte/Makefile does) make both sides agree, and also close the LLVM case noted in the commit message? [Severity: Low] Should this carry a Fixes: tag? git blame on the baseline attributes the whole probe block, including the $(CC) -luring invocation and the COND_GEN_FILES += iou-zcrx gate, to: f81171fecd0c ("selftests: hw-net: auto-disable building the iouring C code") Before that commit there was no CC-dependent probe in this Makefile. Adding the tag would let backporters pick this up into trees that already carry f81171fecd0c. > > # Check if io_uring supports zero-copy receive > HAS_IOURING_ZCRX := $(shell \ > echo -e '#include <liburing.h>\n' \ [Severity: Medium] Related to the CC question above: the probe invokes only $(CC) -luring and passes none of CFLAGS/CPPFLAGS/LDFLAGS/USERCFLAGS/USERLDFLAGS, while the generic C rule in lib.mk does pass them when linking $(OUTPUT)/iou-zcrx. Can a target liburing that is only reachable through user-supplied -I/-L/sysroot flags stay invisible to this probe? The two failure modes both come from the probe answering for a different toolchain than the build: ifeq ($(HAS_IOURING_ZCRX),y) $(OUTPUT)/iou-zcrx: LDLIBS += -luring endif Host-only liburing gives y and the cross link of iou-zcrx then fails on -luring, taking the whole drivers/net/hw build with it. Target-only liburing gives an empty value and the test is dropped with the warning "excluding iouring tests, liburing not installed or too old". [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260907161438.755125-1-maxime.chevallier%40bootlin.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests 2026-09-07 16:14 [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests Maxime Chevallier (Netdev Foundation) 2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation) 2026-09-07 16:14 ` [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check Maxime Chevallier (Netdev Foundation) @ 2026-09-09 0:30 ` patchwork-bot+netdevbpf 2026-09-09 0:30 ` Jakub Kicinski 3 siblings, 0 replies; 8+ messages in thread From: patchwork-bot+netdevbpf @ 2026-09-09 0:30 UTC (permalink / raw) To: Maxime Chevallier Cc: andrew+netdev, davem, edumazet, kuba, pabeni, donald.hunter, horms, shuah, matttbe, sdf, netdev, linux-kernel, thomas.petazzoni, linux-kselftest Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Mon, 7 Sep 2026 18:14:34 +0200 you wrote: > Hi, > > This is the third version for the ynl and drivers/net/hw > cross-compilation enablement series. > > Changes come from Sashiko reviews, that detected some Makefile inclusion > ordering issues, a stray 'Q = @' in the ynl makefiles to have proper > verbosity support, and some commit log rewording. > > [...] Here is the summary with links: - [net-next,v3,1/2] tools: ynl: Allow cross-compiling ynl and associated tools https://git.kernel.org/netdev/net-next/c/917f713b4ec4 - [net-next,v3,2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check https://git.kernel.org/netdev/net-next/c/0c5588740e22 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests 2026-09-07 16:14 [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests Maxime Chevallier (Netdev Foundation) ` (2 preceding siblings ...) 2026-09-09 0:30 ` [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests patchwork-bot+netdevbpf @ 2026-09-09 0:30 ` Jakub Kicinski 3 siblings, 0 replies; 8+ messages in thread From: Jakub Kicinski @ 2026-09-09 0:30 UTC (permalink / raw) To: Maxime Chevallier (Netdev Foundation) Cc: Andrew Lunn, davem, Eric Dumazet, Paolo Abeni, Donald Hunter, Simon Horman, Shuah Khan, matttbe, Stanislav Fomichev, netdev, linux-kernel, thomas.petazzoni, linux-kselftest On Mon, 7 Sep 2026 18:14:34 +0200 Maxime Chevallier (Netdev Foundation) wrote: > Changes come from Sashiko reviews, that detected some Makefile inclusion > ordering issues, a stray 'Q = @' in the ynl makefiles to have proper > verbosity support, and some commit log rewording. Looks good enough, if it works for you. If we see a lot of follow ups and variance in the env people want to support we'll have to add some kind of a build test env on QEMU. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-09 1:12 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-07 16:14 [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests Maxime Chevallier (Netdev Foundation) 2026-09-07 16:14 ` [PATCH net-next v3 1/2] tools: ynl: Allow cross-compiling ynl and associated tools Maxime Chevallier (Netdev Foundation) 2026-09-08 16:17 ` netdev-bot+sashiko 2026-09-09 1:11 ` Bobby Eshleman 2026-09-07 16:14 ` [PATCH net-next v3 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check Maxime Chevallier (Netdev Foundation) 2026-09-08 16:17 ` netdev-bot+sashiko 2026-09-09 0:30 ` [PATCH net-next v3 0/2] selftests: drv-net: Allow cross-compiling the hardware tests patchwork-bot+netdevbpf 2026-09-09 0:30 ` Jakub Kicinski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®