* [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps from test_progs objects @ 2026-07-18 13:44 Tushar Vyavahare 2026-07-27 22:34 ` Andrii Nakryiko 0 siblings, 1 reply; 3+ messages in thread From: Tushar Vyavahare @ 2026-07-18 13:44 UTC (permalink / raw) To: netdev, magnus.karlsson, maciej.fijalkowski, stfomichev, kernelxing, davem, kuba, pabeni, ast, daniel, tirthendu.sarkar, tushar.vyavahare Cc: bpf Build xskxceiver, xdp_hw_metadata, and xdp_features from explicit source lists instead of reusing helper objects produced by test_progs rules. Reusing shared objects such as network_helpers.o and xsk.o can pull in test_progs-only dependency chains and trigger unrelated libarena builds when invoking a single target. Keep these standalone binaries self-contained so each target builds only its own required sources and BPF skeleton dependencies. Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com> --- tools/testing/selftests/bpf/Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index b642ee489ea6..a6f0ed10ccb4 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -934,17 +934,27 @@ $(OUTPUT)/test_verifier: test_verifier.c verifier/tests.h $(BPFOBJ) | $(OUTPUT) $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ -# Include find_bit.c to compile xskxceiver. -EXTRA_SRC := $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c prog_tests/test_xsk.h -$(OUTPUT)/xskxceiver: $(EXTRA_SRC) xskxceiver.c xskxceiver.h $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | $(OUTPUT) +# Keep xskxceiver independent from test_progs object dependencies. +XSKXCEIVER_SRC := xskxceiver.c xsk.c network_helpers.c \ + $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c +$(OUTPUT)/xskxceiver: $(XSKXCEIVER_SRC) xskxceiver.h xsk.h network_helpers.h \ + prog_tests/test_xsk.h test_progs.h bpf_util.h \ + $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | $(OUTPUT) $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ -$(OUTPUT)/xdp_hw_metadata: xdp_hw_metadata.c $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o $(OUTPUT)/xdp_hw_metadata.skel.h | $(OUTPUT) +XDP_HW_METADATA_SRC := xdp_hw_metadata.c xsk.c network_helpers.c \ + $(TOOLSDIR)/lib/find_bit.c +$(OUTPUT)/xdp_hw_metadata: $(XDP_HW_METADATA_SRC) xdp_metadata.h \ + xsk.h network_helpers.h test_progs.h bpf_util.h \ + $(OUTPUT)/xdp_hw_metadata.skel.h $(BPFOBJ) | $(OUTPUT) $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ -$(OUTPUT)/xdp_features: xdp_features.c $(OUTPUT)/network_helpers.o $(OUTPUT)/xdp_features.skel.h | $(OUTPUT) +XDP_FEATURES_SRC := xdp_features.c network_helpers.c +$(OUTPUT)/xdp_features: $(XDP_FEATURES_SRC) xdp_features.h network_helpers.h \ + test_progs.h bpf_util.h $(OUTPUT)/xdp_features.skel.h \ + $(BPFOBJ) | $(OUTPUT) $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ -- 2.43.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps from test_progs objects 2026-07-18 13:44 [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps from test_progs objects Tushar Vyavahare @ 2026-07-27 22:34 ` Andrii Nakryiko 2026-07-28 5:59 ` Vyavahare, Tushar 0 siblings, 1 reply; 3+ messages in thread From: Andrii Nakryiko @ 2026-07-27 22:34 UTC (permalink / raw) To: Tushar Vyavahare Cc: netdev, magnus.karlsson, maciej.fijalkowski, stfomichev, kernelxing, davem, kuba, pabeni, ast, daniel, tirthendu.sarkar, bpf On Sat, Jul 18, 2026 at 6:46 AM Tushar Vyavahare <tushar.vyavahare@intel.com> wrote: > > Build xskxceiver, xdp_hw_metadata, and xdp_features from explicit source > lists instead of reusing helper objects produced by test_progs rules. > > Reusing shared objects such as network_helpers.o and xsk.o can pull in > test_progs-only dependency chains and trigger unrelated libarena builds > when invoking a single target. > > Keep these standalone binaries self-contained so each target builds only > its own required sources and BPF skeleton dependencies. > > Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com> > --- > tools/testing/selftests/bpf/Makefile | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile > index b642ee489ea6..a6f0ed10ccb4 100644 > --- a/tools/testing/selftests/bpf/Makefile > +++ b/tools/testing/selftests/bpf/Makefile > @@ -934,17 +934,27 @@ $(OUTPUT)/test_verifier: test_verifier.c verifier/tests.h $(BPFOBJ) | $(OUTPUT) > $(call msg,BINARY,,$@) > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > -# Include find_bit.c to compile xskxceiver. > -EXTRA_SRC := $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c prog_tests/test_xsk.h > -$(OUTPUT)/xskxceiver: $(EXTRA_SRC) xskxceiver.c xskxceiver.h $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | $(OUTPUT) > +# Keep xskxceiver independent from test_progs object dependencies. > +XSKXCEIVER_SRC := xskxceiver.c xsk.c network_helpers.c \ > + $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c > +$(OUTPUT)/xskxceiver: $(XSKXCEIVER_SRC) xskxceiver.h xsk.h network_helpers.h \ > + prog_tests/test_xsk.h test_progs.h bpf_util.h \ > + $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | $(OUTPUT) > $(call msg,BINARY,,$@) > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > -$(OUTPUT)/xdp_hw_metadata: xdp_hw_metadata.c $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o $(OUTPUT)/xdp_hw_metadata.skel.h | $(OUTPUT) > +XDP_HW_METADATA_SRC := xdp_hw_metadata.c xsk.c network_helpers.c \ > + $(TOOLSDIR)/lib/find_bit.c > +$(OUTPUT)/xdp_hw_metadata: $(XDP_HW_METADATA_SRC) xdp_metadata.h \ > + xsk.h network_helpers.h test_progs.h bpf_util.h \ > + $(OUTPUT)/xdp_hw_metadata.skel.h $(BPFOBJ) | $(OUTPUT) > $(call msg,BINARY,,$@) > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > -$(OUTPUT)/xdp_features: xdp_features.c $(OUTPUT)/network_helpers.o $(OUTPUT)/xdp_features.skel.h | $(OUTPUT) > +XDP_FEATURES_SRC := xdp_features.c network_helpers.c I'm missing the point of these xxx_SRC variables, given you then go and list .h files explicitly... Just have an inline list of all the dependencies, maybe? pw-bot: cr > +$(OUTPUT)/xdp_features: $(XDP_FEATURES_SRC) xdp_features.h network_helpers.h \ > + test_progs.h bpf_util.h $(OUTPUT)/xdp_features.skel.h \ > + $(BPFOBJ) | $(OUTPUT) > $(call msg,BINARY,,$@) > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > -- > 2.43.0 > > ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps from test_progs objects 2026-07-27 22:34 ` Andrii Nakryiko @ 2026-07-28 5:59 ` Vyavahare, Tushar 0 siblings, 0 replies; 3+ messages in thread From: Vyavahare, Tushar @ 2026-07-28 5:59 UTC (permalink / raw) To: Andrii Nakryiko Cc: netdev@vger.kernel.org, Karlsson, Magnus, Fijalkowski, Maciej, stfomichev@gmail.com, kernelxing@tencent.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, Sarkar, Tirthendu, bpf@vger.kernel.org > -----Original Message----- > From: Andrii Nakryiko <andrii.nakryiko@gmail.com> > Sent: Tuesday, July 28, 2026 4:05 AM > To: Vyavahare, Tushar <tushar.vyavahare@intel.com> > Cc: netdev@vger.kernel.org; Karlsson, Magnus > <magnus.karlsson@intel.com>; Fijalkowski, Maciej > <maciej.fijalkowski@intel.com>; stfomichev@gmail.com; > kernelxing@tencent.com; davem@davemloft.net; kuba@kernel.org; > pabeni@redhat.com; ast@kernel.org; daniel@iogearbox.net; Sarkar, > Tirthendu <tirthendu.sarkar@intel.com>; bpf@vger.kernel.org > Subject: Re: [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps > from test_progs objects > > On Sat, Jul 18, 2026 at 6:46 AM Tushar Vyavahare > <tushar.vyavahare@intel.com> wrote: > > > > Build xskxceiver, xdp_hw_metadata, and xdp_features from explicit > > source lists instead of reusing helper objects produced by test_progs rules. > > > > Reusing shared objects such as network_helpers.o and xsk.o can pull in > > test_progs-only dependency chains and trigger unrelated libarena > > builds when invoking a single target. > > > > Keep these standalone binaries self-contained so each target builds > > only its own required sources and BPF skeleton dependencies. > > > > Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com> > > --- > > tools/testing/selftests/bpf/Makefile | 20 +++++++++++++++----- > > 1 file changed, 15 insertions(+), 5 deletions(-) > > > > diff --git a/tools/testing/selftests/bpf/Makefile > > b/tools/testing/selftests/bpf/Makefile > > index b642ee489ea6..a6f0ed10ccb4 100644 > > --- a/tools/testing/selftests/bpf/Makefile > > +++ b/tools/testing/selftests/bpf/Makefile > > @@ -934,17 +934,27 @@ $(OUTPUT)/test_verifier: test_verifier.c > verifier/tests.h $(BPFOBJ) | $(OUTPUT) > > $(call msg,BINARY,,$@) > > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > > > -# Include find_bit.c to compile xskxceiver. > > -EXTRA_SRC := $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c > > prog_tests/test_xsk.h > > -$(OUTPUT)/xskxceiver: $(EXTRA_SRC) xskxceiver.c xskxceiver.h > > $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o > > $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | $(OUTPUT) > > +# Keep xskxceiver independent from test_progs object dependencies. > > +XSKXCEIVER_SRC := xskxceiver.c xsk.c network_helpers.c \ > > + $(TOOLSDIR)/lib/find_bit.c prog_tests/test_xsk.c > > +$(OUTPUT)/xskxceiver: $(XSKXCEIVER_SRC) xskxceiver.h xsk.h > network_helpers.h \ > > + prog_tests/test_xsk.h test_progs.h bpf_util.h \ > > + $(OUTPUT)/xsk_xdp_progs.skel.h $(BPFOBJ) | > > +$(OUTPUT) > > $(call msg,BINARY,,$@) > > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > > > -$(OUTPUT)/xdp_hw_metadata: xdp_hw_metadata.c > > $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o > > $(OUTPUT)/xdp_hw_metadata.skel.h | $(OUTPUT) > > +XDP_HW_METADATA_SRC := xdp_hw_metadata.c xsk.c network_helpers.c > \ > > + $(TOOLSDIR)/lib/find_bit.c > > +$(OUTPUT)/xdp_hw_metadata: $(XDP_HW_METADATA_SRC) > xdp_metadata.h \ > > + xsk.h network_helpers.h test_progs.h bpf_util.h \ > > + $(OUTPUT)/xdp_hw_metadata.skel.h $(BPFOBJ) > > +| $(OUTPUT) > > $(call msg,BINARY,,$@) > > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > > > -$(OUTPUT)/xdp_features: xdp_features.c $(OUTPUT)/network_helpers.o > > $(OUTPUT)/xdp_features.skel.h | $(OUTPUT) > > +XDP_FEATURES_SRC := xdp_features.c network_helpers.c > > I'm missing the point of these xxx_SRC variables, given you then go and list .h > files explicitly... Just have an inline list of all the dependencies, maybe? > > pw-bot: cr > Good point, thanks. The *_SRC variables were only grouping .c files, but since they are single-use and the remaining dependencies still need to be listed explicitly, they don’t improve readability much. I’ve inline the dependencies directly in the rules in v2. > > > +$(OUTPUT)/xdp_features: $(XDP_FEATURES_SRC) xdp_features.h > network_helpers.h \ > > + test_progs.h bpf_util.h $(OUTPUT)/xdp_features.skel.h \ > > + $(BPFOBJ) | $(OUTPUT) > > $(call msg,BINARY,,$@) > > $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@ > > > > -- > > 2.43.0 > > > > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-28 5:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-18 13:44 [PATCH net-next] selftests/xsk: decouple xskxceiver and xdp apps from test_progs objects Tushar Vyavahare 2026-07-27 22:34 ` Andrii Nakryiko 2026-07-28 5:59 ` Vyavahare, Tushar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox