Article View: linux.kernel.netdev
Article #5661Re: [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net
From: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 19:30
Date: Tue, 20 Oct 2026 19:30
180 lines
13971 bytes
13971 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 0 (1)
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] This patch moves get_hw_ring_size() out of
tools/testing/selftests/bpf/network_helpers.c and appends it to…
- [Medium] The new $(XSK_BPF_OBJ) rule in
tools/testing/selftests/net/lib/Makefile compiles xsk_xdp_progs.bpf.c…
Pre-existing issues:
- [Low] At this commit, test_exit() in
tools/testing/selftests/net/xsk_prereqs.sh ends with an unconditional…
--
selftests: xsk: move the AF_XDP test suite to selftests/net
This commit moves xskxceiver, the AF_XDP library, the test definitions
and the XDP program from selftests/bpf to selftests/net/lib/xsk. It also
moves test_xsk.sh and xsk_prereqs.sh to selftests/net, and net/lib now
builds xskxceiver and its skeleton when a working bpftool is available.
The ethtool ring helper get_hw_ring_size() moves from network_helpers.c
into xsk.c.
> diff --git a/tools/testing/selftests/net/lib/Makefile b/tools/testing/selftests/net/lib/Makefile
> index ff83603397d06..c26088da04892 100644
> --- a/tools/testing/selftests/net/lib/Makefile
> +++ b/tools/testing/selftests/net/lib/Makefile
[ ... ]
> @@ -23,3 +33,28 @@ TEST_INCLUDES := $(wildcard py/*.py sh/*.sh)
> include ../../lib.mk
>
> include ../bpf.mk
> +
> +# 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_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 $@
[Severity: Medium]
Could this produce a BPF object with the wrong byte order when
cross-compiling for a big-endian target?
Plain --target=bpf uses the build host's byte order. xskxceiver itself
is built with $(CC), and lib.mk sets that to $(CROSS_COMPILE)gcc. So a
build for s390x on an x86_64 host would put a little-endian object into
the skeleton of a big-endian xskxceiver.
On the target, xsk_xdp_progs__open_and_load() would then fail in
bpf_object_load():
tools/lib/bpf/libbpf.c:bpf_object_load() {
...
} else if (!is_native_endianness(obj)) {
pr_warn("object '%s': loading non-native endianness is unsupported\n", obj->name);
return libbpf_err(-LIBBPF_ERRNO__ENDIAN);
}
...
}
The bpf selftests Makefile, which built this program before the move,
picks the target based on $(CC):
BPF_TARGET_ENDIAN:=$(if $(IS_LITTLE_ENDIAN),--target=bpfel,--target=bpfeb)
The existing rule in net/bpf.mk also uses plain --target=bpf. Should
the new rule pick bpfel or bpfeb the same way the bpf selftests do?
> +
> +$(OUTPUT)/xskxceiver: $(XSK_SOURCES) $(XSK_HEADERS) $(XSK_SKEL) $(BPFOBJ)
[ ... ]
> diff --git a/tools/testing/selftests/bpf/xsk.c b/tools/testing/selftests/net/lib/xsk/xsk.c
> similarity index 97%
> rename from tools/testing/selftests/bpf/xsk.c
> rename to tools/testing/selftests/net/lib/xsk/xsk.c
> index 25d568abf0f20..660540efc46e0 100644
> --- a/tools/testing/selftests/bpf/xsk.c
> +++ b/tools/testing/selftests/net/lib/xsk/xsk.c
[ ... ]
> @@ -779,3 +778,27 @@ void xsk_socket__delete(struct xsk_socket *xsk)
> close(xsk->fd);
> free(xsk);
> }
> +
> +int get_hw_ring_size(char *ifname, struct ethtool_ringparam *ring_param)
[Severity: Medium]
Can this function move into xsk.c without its license being addressed?
get_hw_ring_size() comes from tools/testing/selftests/bpf/network_helpers.c,
which carries:
// SPDX-License-Identifier: GPL-2.0-only
xsk.c carries:
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
The function was contributed as GPL-2.0-only in commit 90a695c3d31e1c
(Tushar Vyavahare). After this move, the xsk.c file tag offers it under
LGPL-2.1 or BSD-2-Clause. Neither the SPDX header nor the function gets
a license note.
The commit message only says:
"Move the ethtool ring helper from network_helpers into xsk.c"
It does not mention a relicense or carry an ack from the original
author. Could the relicense be acked explicitly, or could the helper
live in a GPL-2.0 file such as test_xsk.c instead?
> +{
> + struct ifreq ifr = {0};
> + int sockfd, err;
[ ... ]
> diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/net/test_xsk.sh
> similarity index 98%
> rename from tools/testing/selftests/bpf/test_xsk.sh
> rename to tools/testing/selftests/net/test_xsk.sh
> index 69fac65f073c5..fbf4551d596a4 100755
> --- a/tools/testing/selftests/bpf/test_xsk.sh
> +++ b/tools/testing/selftests/net/test_xsk.sh
> @@ -97,6 +97,11 @@ do
> esac
> done
>
> +if [ ! -x "./${XSKOBJ}" ]; then
> + echo "xskxceiver was not built; skipping"
> + exit $ksft_skip
> +fi
> +
[Severity: Low]
This isn't a bug introduced by this patch, but the new check exits with
$ksft_skip, while the other skip paths go through test_exit() in
xsk_prereqs.sh, and that always exits 1:
tools/testing/selftests/net/xsk_prereqs.sh:test_exit() {
if [ $1 -ne 0 ]; then
test_status $1 $(basename $0)
fi
exit 1
}
validate_veth_support() and validate_ip_utility() both call
"test_exit $ksft_skip". So when veth support or the ip utility is
missing, the result is a failure rather than a skip.
Later in the series, "selftests: xsk: run one test case per xskxceiver
invocation" replaces test_xsk.sh and xsk_prereqs.sh with test_xsk.py,
which skips with exit code 4. By the end of the series this is gone.
Should test_exit() pass its argument to exit for the commits in
between?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016174338.787135-1-maciej.fijalkowski%40intel.com
Technical Details
Message-ID:
<179252462291.3135.9171929520806354921@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349502-linux-kernel-netdev=dewy.ruReferences:
<20261016174338.787135-7-maciej.fijalkowski@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349502-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Date: Tue, 20 Oct 2026 19:30:22 +0000 Organization: Usenet Network Message-ID: <179252462291.3135.9171929520806354921@kernel.org> References: <20261016174338.787135-7-maciej.fijalkowski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3936658"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:UQIZlR5Lc41YfmxRtC7xN2MWpFQ= sha256:ZkbGF0RzU6sHBdZ0GhVbS2VCDPu3cPyBMyALncD4xN4= sha1:krUn+7imJ3sJOO+4NyBdaYALg/w= sha256:8hPug/j7V1fZ+0OpzrNZN/TV7JzdmdcCgUP1WhbdtqI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 717DA110E02; Tue, 20 Oct 2026 22:32:37 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wTWeVyQJoh_x; Tue, 20 Oct 2026 22:32:33 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349502-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 269D6110E00; Tue, 20 Oct 2026 22:32:25 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 67B522E2E8; Tue, 20 Oct 2026 19:30:30 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792524625; b=ET6lYrXt38cVJ1n87RiAflHh5xxlExRKFEqN90O6IieLspRg7GNdrOeGTJ36e1OSZAlU NoxW2oDbS9Nr8v5Hq2mnICFqQm733j+998/2Z9vJzJAh53g1f1NUsaZQS9hXnFDq3KbHd JWQLx5kOku3hATjh0jctxN90K+1oR3KFL97iB5od6OPuToYxtWVE4pBAK3YJW5VmxLv7V PEBbXJaHMHqwNrrQmRhzPBmoDuBm0wX+fzLprSO9KWs+SfKdCD48bGNfWrsSNArRXujyk jcdlpctyNq3gUn6Qzroko/S9j6Vi2Rb5eBzowozA/Nnhsnc4XcwU5WTaHEdjQV5U+7A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792524625; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=2LYIs8aFRzc8aCCkLtrsuAXgCJ+0neQAn2pAIkJK0dU=; b=igcQZlbv3xxoRIhFn/JeRl2VaNfURnFZsy7kOnwZYT6iH0ulSvldQCrMDrggfxtbNOcG ThH6U1T8YR1fz1Sg1bkHaUL/LjTwMTRY2yASIAlZzjBJoB/WUecNmQFo+JXdz+kdzkZ3T qd9fIQxXUe5kbG0NpoIrYESzful0BVzcew1/QKU9EFm16bYhLtvCPd6MvX3myFybPzSL9 tu44d/mIvLoP6garZbqKvDjBzAwp+gkDGzN87IyRBN7N+vGTRxUhgpV1EHANLuOWrEsNs avE1CFrPBCZ6/UrvzVDYeBPaoNu49QJKr7xXOHluAytiEICNjZlK6Pwf7ezPTILF3aQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NNeIl6Lq; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6108D60A2613; Tue, 20 Oct 2026 19:30:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NNeIl6Lq X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792524624; b=biuiF1V/LJ4y0S/Tlz7PKIK+2YCylHjFvcxmgPWqVeSJ3ngh7dvZZP3O9gk1A5piciQK C68xwNii6PFiWNdEBWKURgEZuiwo7il1QsMbUtvebHgIawkK8reapsVQ8xO7J4uF/W+U6 6yEG8kM7DLXa+dp42ztIo/7BztuZevXEO/cWZpE8uiDwEd3S8eGUJRhzaB/+y+llqjKxe SqLHPggy9llCv6DmJu7eS51XICbT5m9ITxAIgCnyoHtu44wpOhKWaaXjci/xjCfswOp54 BBacdXixbMIvVApslrs6g/M739xjNqBMGiVA6MVYgxzFjLqOFK2PoygzJVg8zBwqIMA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792524624; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=2LYIs8aFRzc8aCCkLtrsuAXgCJ+0neQAn2pAIkJK0dU=; b=hZczzsAYVJn9jiPOOu1VrtnnEd4Shyu5QYbsfuZ7niw0lFJCcUwwqEJso3dbiMdlVoQ9 lbIWpW4Ehwtvf0f8MwYUp+0yQOOOpRnlLBINHe2jynTb94IRUWGaEzKRsLDHyFFYge8nD TR1PS15Da2f98jqLua0dfAZy9xtRYofaLy1SPywIOyEXdlg54D7wLlN5TQO4zlRykQzyU SenE+bzOgYwOcQf2FyOWX1dVKIXUrl/0PDH5atvhfVv/ysvCgWn/NvE6wSHF3+ifUGgHk GR9doQopHcMtoACjSv3PVMtjYzA5VtK7oqYx3fThIVeiAH41qoRVjzzJMLYniX63AQg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NNeIl6Lq; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D40F606A31F; Tue, 20 Oct 2026 19:30:24 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 615B21F000CD; Tue, 20 Oct 2026 19:30:23 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792524624; bh=2LYIs8aFRzc8aCCkLtrsuAXgCJ+0neQAn2pAIkJK0dU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NNeIl6LqqtnHLej8cyJoytG/dYprnqoVr1tlqK1G2aNgHV2Kou2ZR6NSGgHCAXW4S 1tApnrKp1BWpky612yIDouXWES8eflVF761LpVRB++MxwLDjK1sk4nmWDy+dh4KlPl aKADT/lmCPMiQUjPDq6P18/x7WMc54cMeLNEnl9RRSi1EV1asyzn97tPGvCqiJYkxa tjg+woGAy2FeXRtbP/pcy1l+/5h6VkWk1Zg2OUFZ+mJnd2lGRynX6G5IB39SvHaRBR AbFMn8+Ydk+VRDGACAAAn5dABpQLkPrw67AsMo/uVOpCT/dPwuFfm3ZS/dWHNC+HsM ToHhpNrKh10Wg== X-Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, magnus.karlsson@intel.com, stfomichev@gmail.com, kuba@kernel.org, pabeni@redhat.com, tushar.vyavahare@intel.com, kerneljasonxing@gmail.com, bjorn@kernel.org X-In-Reply-To: <20261016174338.787135-7-maciej.fijalkowski@intel.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list