๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21247

Re: [PATCH v5 net-next 07/13] selftests: xsk: run the RX and TX endpoints in separate processes

#21247
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 18:46
112 lines
11663 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] In this commit, a skip decision is not passed between the two
  endpoint processes, so they can report different verdicts for one case.

--

selftests: xsk: run the RX and TX endpoints in separate processes

This splits xskxceiver so that each process runs one endpoint, RX or TX,
on one interface. A shadow ifobject stands in for the other side. The
pthreads and the barrier are replaced by a TCP control channel that
carries READY, PROGRESS and ABORT messages between the two processes.

> diff --git a/tools/testing/selftests/net/lib/xsk/test_xsk.c b/tools/testing/selftests/net/lib/xsk/test_xsk.c
> index e0f413ee17ab7..fdf449822f026 100644
> --- a/tools/testing/selftests/net/lib/xsk/test_xsk.c
> +++ b/tools/testing/selftests/net/lib/xsk/test_xsk.c

[ ... ]

> @@ -1622,36 +1663,57 @@ static int testapp_validate_rx_endpoint(struct test_spec *test,
>  	return err;
>  }
>  
> -void *worker_testapp_validate_tx(void *arg)
> +static int sync_endpoints(struct test_spec *test)
> +{
> +	int err = xsk_peer_ready(ctrl_peer);
> +
> +	if (err)
> +		ksft_print_msg("Endpoint synchronization failed at step %u: %d (%s)\n",
> +			       test->current_step, err, strerror(-err));
> +	return err;
> +}

[Severity: Medium]
Can a legitimate skip on one endpoint be reported as a fail on the other
one?

The control protocol in xsk_peer.c has only these message types:

enum xsk_peer_msg_type {
	XSK_PEER_READY = 1,
	XSK_PEER_PROGRESS,
	XSK_PEER_ABORT,
};

So a peer that skipped looks the same as a peer that went away.

For example, main() in xskxceiver.c skips an unsupported mode after
setup_peer() has already connected:

	if (setup_peer(local_ifobj, shadow_ifobj, &peer))
		goto out;

	if (!mode_supported(opt_mode, caps)) {
		...
		ret = TEST_SKIP;
		goto out;
	}

At the out: label, xsk_peer_close() closes the socket without telling the
peer. The multi-buffer TEST_SKIP in __testapp_validate_traffic() does the
same thing.

The other endpoint is blocked in xsk_peer_ready() and reads EOF. That
gives this chain:

xsk_peer_ready()->peer_recv_one()->io_full() returns -EPIPE
sync_endpoints() prints "Endpoint synchronization failed"
__testapp_validate_traffic() returns TEST_FAILURE

setup_peer() copies local->caps into the shadow. Each endpoint therefore
makes its capability-based skip decisions from its own NIC, and the two
can disagree when the NICs differ.

ADJUST_TAIL splits in a similar way. testapp_validate_rx_endpoint() clears
test->adjust_tail_support only in the RX process:

	if (!supported) {
		test->adjust_tail_support = false;
		return TEST_PASS;
	}

As a result, testapp_adjust_tail() returns TEST_SKIP on RX. The TX copy
stays true, and TX reports PASS.

No in-tree launcher runs xskxceiver at this commit. Later in the series,
"selftests: xsk: prepare xskxceiver for endpoints on two hosts" adds
XSK_PEER_SKIP and xsk_peer_skip(), and sync_endpoints() then returns
TEST_SKIP when the peer skipped. After that, "selftests: drv-net: run the
AF_XDP tests over veth or a NIC" adds xsk.py, which reports the RX SKIP /
TX PASS combination as a skip.

Would it make sense to send the skip notification to the peer in this
patch, so the verdicts also match at this point in the series?

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119164636.1071385-1-maciej.fijalkowski%40intel.com
Technical Details
Message-ID: <179545959702.3135.5397532567873926560@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369698-linux-kernel-netdev=dewy.ru
References: <20261119164636.1071385-8-maciej.fijalkowski@intel.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369698-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v5 net-next 07/13] selftests: xsk: run the RX and TX
 endpoints in separate processes
Date: Mon, 23 Nov 2026 18:46:37 +0000
Organization: Usenet Network
Message-ID: <179545959702.3135.5397532567873926560@kernel.org>
References: <20261119164636.1071385-8-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="3957714"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XS3GFho3DIWIlzjKyR9M92naHRU= sha256:1VYLODhIBd3w0vGkVgbEC1p9znNcxF+SfKpV4WVSCc8=
	sha1:WYzgIKEoUFkIScQABP3xH96gAL8= sha256:+Zyr9tWlWu4vXDrTMkEQtJwsqyZUyZ7n7tUTu6PHDD0=
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 56D82125DC9; Mon, 23 Nov 2026 21:46:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 4tIDjieI6Frg;
	Mon, 23 Nov 2026 21:46:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-369698-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 9F02C125DC0; Mon, 23 Nov 2026 21:46:42 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 62CA1277D5; Mon, 23 Nov 2026 18:46:39 +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=1795459599;
	b=4XgyvfUGzEDRVBRxLT84ojPieQfsCd8FaHcZhlnxRQZ/qXCj7XVMjFVH5ryZk/0wVOIB
	 GPrMaTixrMJTXGdZj371Pas7I6OFrbRMvKgr/bO0f3mCtgNwFHEh0pMj/p1h8dAb2JWpV
	 h+Y8RXeN9PaFgzRVwKFHKHfRCpV8eP2IVPCjGYB3rABzvOIBLzXAIjSBwYsHZv1SEShkb
	 mbmNbs59U1WDS17Ir6VK+qZBGc/FHKUajbhIBTiS+tZ2BM73ZhxbEJjdEUeTmQBAy3KI4
	 uB0cYBnKSDOnLtJ8DBEJWngO544d9sa01fwDtJfc8PKLjhJ6ZK9ZS7bdXpf9ZLnn0hg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795459599;
	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=xHubuJhP6KN/RVRcVDqZuPXWy39mMWU82a7oBpJ/8K8=;
	b=3Lkby1pasOk/+MuXfK+UVrocX6D8BLMy8U9V4CObplG4BZZXM/4C+O9IRfhaEQBc3KL/
	 VCdr4gZDMfWsvjWIJa6nyuU3hHsXfQozP6G5QXVnktIjQEuVXtVZwqDNfvu5UcNxt+1Cb
	 Rrpz5S6IjFLZU9du6sv2hoKCb0abSSO8bGdl4pNWBzSvXy5sdnTwjLaJw3AT2tMfO/8Hp
	 iROOl/2K3ffDNZYy0j9JZ1TryoGbd3C66MxE5gHVZmj5d/v+bgr84aiQRMgJIm7cPd69c
	 mEjUsRA4k/UbSdvNmXDgxM5WfNb+Dey1q8Wvuc7qc92ZNWOevwNRwd4jDy/L0AX8D8Q==
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=OP63MUPu;
	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 01AFE606A321;
	Mon, 23 Nov 2026 18:46:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OP63MUPu
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=1795459598;
	b=hg/KbJcKIvIiErDO1xEwRC+A9xDfv2jyPzbpbPqOs/WcihlUc8J8z/c5y0UTbOHvuqip
	 hNPwyKUYAeuDbqmmdz349PK4LosIgo65Nj51evH4TRrgy7x2jJdif9986UrMFQGJ5K7j3
	 B1wnkITD4jcW95VIiZCYAx9xYiXdJUVyu4RqnmwqGXrB2naPRAQhr42MDcPQMkl+rmsxc
	 z3z4MuCH9wKHG3L5YSQQXA00AuxvLsy/P8tKI+t9UjkMxdt48JIkpKyq2eFgRsUIfXBsc
	 lLrqLVhKm/g8rF5mUquhJJ/71wGF7vs+uA1Oa5G2ojJzlvo/aWeOgB5L83z7ps5V/wg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795459598;
	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=xHubuJhP6KN/RVRcVDqZuPXWy39mMWU82a7oBpJ/8K8=;
	b=OYyeU2tZZ/F09EJ8LL9O1zb+kgJDu1efPLJ+rrrAJnjY7+NioNKCcrK49c7DWpqllfcz
	 wB70HSMnPb1miuMd9KlBKSfAReuuB7yQ0VCRgD6GqucTawCBo0C2iNV/Jr60OQX8OdiYz
	 ed3J/I52GOHNF4HL+3GhSvt+hWPBoNiFoHX/IQ+GtR2vYqnSJ2cWwrrufPSEQw0MrHZca
	 3cptX3+V10Zsc+NiD3N5OnP4GpMjD2UEirkmbddRqoFM9KtvgDJOZImgfV0JRFDjYh5M5
	 If46foPPuDBQE/N9GYekgzfBPIHuuojyQZFyMiN0wELFCgl6616TKrEBkrxTTsmSTJg==
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=OP63MUPu;
	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 227CA606A31A
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 18:46:38 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B9DA1F000C0;
	Mon, 23 Nov 2026 18:46:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795459597;
	bh=xHubuJhP6KN/RVRcVDqZuPXWy39mMWU82a7oBpJ/8K8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=OP63MUPuNp6yBBl6wDZPI+27zRBg3vZm6iiqDm7ci4vH384xh8m/aZWQxSY6CdiCj
	 nwfsNXUGoWEDbE8YKPMAr0XosJop/gh3Yas397z3hQAdRVo4DsTZ7fthbpA+VNr/+Q
	 Ic8fivzaGjuCsnjBD6q5IsxR1PZ/j8XqsnLw1xB05m40kIxJzimTRcSpncYD9O6drT
	 4StsdnHpQ8jwr2bqEcxknRoAg7CzgSnJLZkJEnB9cDjgBFIScp+v6kHfD9ebBnOSrt
	 DxgulB2v+2Vd9cDgR0O6HYztSXDfLmkZ5/i1Mp2EWPhClDopxXquVG1DJybwppCLea
	 tp8iJvC+SSB/w==
X-Cc: netdev@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: <20261119164636.1071385-8-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