๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4246

Re: [PATCH v3 net-next 03/15] selftests: xsk: drop the single-interface loopback mode

#4246
From: netdev-bot+sashiko
Date: Sat, 17 Oct 2026 03:06
110 lines
9276 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

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] Old single-interface invocations are now misread instead of
  being rejected.

--

selftests: xsk: drop the single-interface loopback mode

This commit removes the xskxceiver mode where the TX and RX sockets were
bound to queue 0 of one interface with a shared UMEM. It also removes the
split UMEM addressing and the POLL_TXQ_FULL workaround that mode needed.
The -i IFACE option of test_xsk.sh is dropped as well.

> diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
> index 62db060298a4a..69fac65f073c5 100755
> --- a/tools/testing/selftests/bpf/test_xsk.sh
> +++ b/tools/testing/selftests/bpf/test_xsk.sh

[ ... ]

> @@ -88,14 +85,11 @@
>  
>  . xsk_prereqs.sh
>  
> -ETH=""
> -
> -while getopts "vi:dm:lt:h" flag
> +while getopts "vdm:lt:h" flag
>  do
>  	case "${flag}" in
>  		v) verbose=1;;
>  		d) debug=1;;
> -		i) ETH=${OPTARG};;
>  		m) MODE=${OPTARG};;
>  		l) list=1;;
>  		t) TEST=${OPTARG};;

[ ... ]

> diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
> index 7dad8556a722e..24109dd7264e2 100644
> --- a/tools/testing/selftests/bpf/xskxceiver.c
> +++ b/tools/testing/selftests/bpf/xskxceiver.c

[ ... ]

> @@ -388,10 +387,6 @@ int main(int argc, char **argv)
>  		ksft_exit_xfail();
>  	}
>  
> -	shared_netdev = (ifobj_tx->ifindex == ifobj_rx->ifindex);
> -	ifobj_tx->shared_umem = shared_netdev;
> -	ifobj_rx->shared_umem = shared_netdev;
> -
>  	if (!validate_interface(ifobj_tx) || !validate_interface(ifobj_rx))
>  		print_usage(argv);

[Severity: Medium]
Now that shared_netdev is gone, what rejects the old
"xskxceiver -i ethX -i ethX" invocation?

parse_command_line() still sets ifobj_tx and ifobj_rx from the first two
-i options. validate_interface() only rejects an empty name. As a result,
TX and RX can use the same ifindex and nothing reports it.

When that happens, each endpoint binds its own UMEM to queue 0 of the same
netdev, because xsk_configure() now does:

	bool shared = !!i;

The TX bind cannot succeed without XDP_SHARED_UMEM. xsk_configure()
retries SOCK_RECONF_CTR times, and then every test fails. Nothing tells
the user that the mode was removed.

xsk_attach_xdp_progs() has also lost its early return for a shared-netdev
TX side, so the TX attach replaces the RX program on the same ifindex.

Should main() exit with a usage error when
ifobj_tx->ifindex == ifobj_rx->ifindex?

test_xsk.sh has a related problem. 'i' is no longer in the getopts string,
and the case statement has no '?' arm. Running "test_xsk.sh -i ethX"
prints an illegal option warning and then runs the veth suite, which could
be mistaken for a hardware result.

Later patches in this series look like they resolve this:

- "selftests: xsk: run one test case per xskxceiver invocation" removes
  test_xsk.sh and xsk_prereqs.sh in favour of test_xsk.py.

- "selftests: xsk: run the RX and TX endpoints in separate processes"
  makes parse_command_line() take a single interface. It calls
  print_usage() when the role, peer host, peer port, test or mode is
  missing.

So the problem seems limited to this commit, for example while bisecting.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261014184539.774708-1-maciej.fijalkowski%40intel.com
Technical Details
Message-ID: <179220636510.434549.7705519903366245411@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-347652-linux-kernel-netdev=dewy.ru
References: <20261014184539.774708-4-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-347652-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v3 net-next 03/15] selftests: xsk: drop the
 single-interface loopback mode
Date: Sat, 17 Oct 2026 03:06:05 +0000
Organization: Usenet Network
Message-ID: <179220636510.434549.7705519903366245411@kernel.org>
References: <20261014184539.774708-4-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="2952855"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XqF4NMvfe8Ab7nm9NY0+njgrMXE= sha256:lt/kzWyMcQwi9aN6iLHOLEMUbj4nv4HK1FzQSmsDBGk=
	sha1:PTCJWCUam00HyYICWwQufBTdSQc= sha256:aF3hysVoh5zUr+9Has6R6fgO7usSPycgI4cwgDIbByQ=
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 E688E11067A; Sat, 17 Oct 2026 06:08:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.64
X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 Fxi_P5XUt2sH;
	Sat, 17 Oct 2026 06:08:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-347652-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 A8FD311066C; Sat, 17 Oct 2026 06:08:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 76EEE3D3D2; Sat, 17 Oct 2026 03:06:09 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 87E7B3B7757;
	Sat, 17 Oct 2026 03:06:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S5UAUUCW"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(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 5459B13B293;
	Sat, 17 Oct 2026 03:06:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792206367; cv=none; b=J6GHiIcjagKXuTs7YrbbsHsB3pPUpWHlJhQX2LCk4b1eOmBnbIlsSv+IzKrbXv/KyJFHbcpctdi9matgHlg9qJCxJcoPWxxpYx/T08+/bWRrCTA4rnaQMKOMs9iUJ6/q7r0fIey4jZ6Wz45K1RpvGvFuylkDGgphZa/4qbChXZ8=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792206367; c=relaxed/simple;
	bh=TxsrQoeReuVkkJcppcYZgfKFM9i+zHch/GwTbDaqao0=;
	h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 Content-Type:MIME-Version; b=BlzcTTtAiJ8T6MtaWjQDMHBqqycDY2UUqpHM3W1A53dpqiRdqqxth67jnPnba5yO28+sq+d5uUmtrSTnGQzeZLN+pjfuY0eZSP2YCiwdxGm5vtFxBAmZYGNiuA8Oh6K+YobXfP9b9cvmHLq6ulzI4fmZlM26vnsOaUm5yuiUlvg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S5UAUUCW; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 826E51F000C5;
	Sat, 17 Oct 2026 03:06:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792206366;
	bh=QiNpr66aF8Jt67mP0DHy47o/5RmozCu5BZxGXMVE/fM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=S5UAUUCWFv52Bsf5xD9FJeNkgo/GRdraPw89vUcgXL1BNbBlmTu9dnvLYYVWK28uy
	 sA2Q5ydPFAyR+A9AWngFKezoINX+Y491QcX5cA7/zH2t5Wp7Zy1lqWgt9h0fxwL5/1
	 3eJuR4FKb8etVmXz31LhW5PdOvnbScEq/DEsl3IdAc/HLSgEVrkIFgkEmZAZ7Oj/Qj
	 2cneDR8OKyFezDhbpLJh92WgF1qlTtMH/dOFUvDQfwIZ0pdq24ySekuFZ+KtZNs4+a
	 aDn8qYoTXOJJrjq9ltuAbwVJ54arOxEzt/1DkyuObqLEtjhTpHEfPZlRaID80SR0TH
	 ZDRWAWazGuwDQ==
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: <20261014184539.774708-4-maciej.fijalkowski@intel.com>
X-sashiko-severity: Medium
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>