From: Jakub Kicinski <kuba@kernel.org>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
magnus.karlsson@intel.com, stfomichev@gmail.com,
pabeni@redhat.com, tushar.vyavahare@intel.com,
kerneljasonxing@gmail.com, bjorn@kernel.org
Subject: Re: [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net
Date: Wed, 21 Oct 2026 14:55:10 -0700 [thread overview]
Message-ID: <20261021145510.6ab6b982@kernel.org> (raw)
In-Reply-To: <20261016174338.787135-7-maciej.fijalkowski@intel.com>
On Fri, 16 Oct 2026 19:43:29 +0200 Maciej Fijalkowski wrote:
> Move the xskxceiver engine, the AF_XDP userspace library, the test
> definitions and the XDP program to net/lib/xsk, and test_xsk.sh with
> its prerequisites script to selftests/net. A later patch drives the
> same engine against real NICs from drivers/net/hw, and net/lib is where
> both suites take shared helpers from.
>
> net/lib builds xskxceiver with its XDP program and skeleton, using the
> bpftool in PATH, and skips it with a warning when bpftool is missing or
> does not run; test_xsk.sh then skips too. xskxceiver links -lpthread,
> which glibc older than 2.34 needs for the threads of test_xsk.c.
>
> Like the rest of net/lib, xskxceiver builds against the installed uapi
> headers, so include linux/kernel.h for min_t() directly rather than via
> the tools copy of linux/netlink.h. tools/include goes ahead of CFLAGS,
> so that O= builds take linux/kernel.h and linux/types.h from it rather
> than from a source tree usr/include.
To be clear the expectation is that user runs
make headers
first, so installed != system headers. There's no requirement
that selftests build without running make headers first.
> Move the ethtool ring helper from network_helpers into xsk.c and
> point the kselftest.h include of test_xsk.h at the net/lib include
> path. The XDP program moves unchanged; its Ethernet header bound check
> compares pointers of distinct types, so net/lib builds it with
> -Wno-compare-distinct-pointer-types, as the bpf selftests do.
> xdp_hw_metadata and the xdp_metadata test keep using xsk.c and xsk.h
> from their new location. Update the AF_XDP entry in MAINTAINERS.
>
> +# AF_XDP test engine used by net/test_xsk.sh.
> +XSK_DIR := xsk
> +XSK_BPF_OBJ := $(OUTPUT)/xsk_xdp_progs.bpf.o
> +XSK_SKEL := $(OUTPUT)/xsk_xdp_progs.skel.h
> +XSK_SOURCES := $(addprefix $(XSK_DIR)/,xskxceiver.c xsk.c test_xsk.c) \
> + $(top_srcdir)/tools/lib/find_bit.c
> +XSK_HEADERS := $(wildcard $(XSK_DIR)/*.h)
> +
> +PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
> +XSK_LDLIBS := $(shell $(PKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) -lz
> +XSK_LDLIBS += -lpthread
> +
> +$(XSK_BPF_OBJ): $(XSK_DIR)/xsk_xdp_progs.bpf.c $(XSK_DIR)/xsk_xdp_common.h $(BPFOBJ)
> + $(call msg,BPF_PROG,,$@)
> + $(Q)$(CLANG) -O2 -g --target=bpf $(CCINCLUDE) $(CLANG_SYS_INCLUDES) \
> + -Wno-compare-distinct-pointer-types -c $< -o $@
> +
> +$(OUTPUT)/xskxceiver: $(XSK_SOURCES) $(XSK_HEADERS) $(XSK_SKEL) $(BPFOBJ)
> + $(call msg,CC,,$@)
> + $(Q)$(CC) -I$(top_srcdir)/tools/include $(CFLAGS) -I$(OUTPUT) \
> + -I$(SCRATCH_DIR)/include \
> + $(XSK_SOURCES) $(BPFOBJ) $(LDLIBS) $(XSK_LDLIBS) -o $@
Why do we need all these extra rules to build the xsk stuff?
bpf.mk should build all %.bpf.c into objects
You seem to do similar thing for skel.
We shouldn't need 20 lines of Makefile for each test.
We are not using any bleeding edge toolchain features here
> +EXTRA_CLEAN += $(XSK_BPF_OBJ) $(XSK_SKEL)
This should also somehow be covered by wildcards not obj by obj.
next prev parent reply other threads:[~2026-10-21 21:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 17:43 [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 01/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-10-17 17:44 ` sashiko-bot
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 03/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-17 17:44 ` sashiko-bot
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 04/15] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 05/15] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-21 21:55 ` Jakub Kicinski [this message]
2026-10-16 17:43 ` [PATCH v4 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 08/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-17 17:44 ` sashiko-bot
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-21 22:01 ` Jakub Kicinski
2026-10-22 15:44 ` Maciej Fijalkowski
2026-10-23 1:24 ` Jakub Kicinski
2026-10-16 17:43 ` [PATCH v4 net-next 10/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 11/15] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs Maciej Fijalkowski
2026-10-17 17:44 ` sashiko-bot
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-21 11:30 ` Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 12/15] selftests: xsk: prepare xskxceiver for endpoints on two hosts Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 13/15] selftests: xsk: list the hardware test cases Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 15/15] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski
2026-10-18 19:20 ` [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Björn Töpel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261021145510.6ab6b982@kernel.org \
--to=kuba@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=kerneljasonxing@gmail.com \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stfomichev@gmail.com \
--cc=tushar.vyavahare@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.