Article View: linux.kernel.netdev
Article #27484Re: [PATCH net-next v3 12/13] selftests: net: fib_tests: Add stale pcpu test
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:21
Date: Sat, 05 Dec 2026 19:21
97 lines
11267 bytes
11267 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 tools/testing/selftests/net/fib_tests.sh,
ipv6_nh_pcpu_stale_test() skips only when `$(nproc)` is below 2 (line…
--
selftests: net: fib_tests: Add stale pcpu test
This adds an ipv6_nh_pcpu_stale test to fib_tests.sh. The test creates a
pcpu dst on CPU 0 for a route that uses a nexthop object, re-adds the
route, and then checks route lookups on CPUs 0 and 1. It covers the
regression fixed by commit 8f34e53b60b3 ("ipv6: Use global sernum for dst
validation with nexthop objects").
> diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
> index d7ac3c727f704..dc2ac5d7f29b7 100755
> --- a/tools/testing/selftests/net/fib_tests.sh
> +++ b/tools/testing/selftests/net/fib_tests.sh
[ ... ]
> @@ -3228,6 +3228,56 @@ ipv6_mpath_oif_vrf_test()
> cleanup
> }
>
> +ipv6_nh_pcpu_stale_test()
> +{
[ ... ]
> + if [ $(nproc) -lt 2 ]; then
> + echo "SKIP: pcpu test requires multiple cpus"
> + return $ksft_skip
> + fi
> +
> + setup
[ ... ]
> + # create a pcpu dst entry on cpu 0
> + taskset -a -c 0 $IP -6 route get 2001:db8:11::1 &> /dev/null
> +
> + # re-add the route entry
> + $IP -6 route del 2001:db8:11::1
> + $IP -6 route add 2001:db8:11::1/128 nhid 100
> +
> + # cached dst on cpu 0 must have been invalidated
> + for cpu in 0 1; do
> + taskset -a -c $cpu $IP -6 route get 2001:db8:11::1 &> /dev/null
> + log_test $? 0 "Route get on cpu $cpu after route re-add"
> + done
[Severity: Medium]
Can ipv6_nh_pcpu_stale_test() report a FAIL when the kernel is working
correctly?
The skip check only looks at nproc. nproc counts the CPUs in the caller's
affinity mask, and GNU nproc also honours OMP_NUM_THREADS and
OMP_THREAD_LIMIT. A count of 2 or more does not mean that CPU 0 and CPU 1
exist, are online, or are allowed.
Some examples: a cpuset-limited container or CI runner with cpus 2-5, a
system where CPU 1 has been hot-unplugged, or a run started under
taskset -c 2,3.
In those cases sched_setaffinity() ends up with an empty mask and returns
EINVAL, so taskset exits non-zero without running ip. Because stderr goes
to /dev/null, log_test only sees the non-zero exit code. It then logs
"Route get on cpu N after route re-add" as a failure.
The test can also miss the regression it is meant to catch, because the
result of the priming lookup is never checked:
taskset -a -c 0 $IP -6 route get 2001:db8:11::1 &> /dev/null
If pinning to CPU 0 fails, no pcpu dst is created on CPU 0. That means the
stale dst condition is never set up. The later CPU 0 check then fails in
taskset too, which hides the real cause.
Could the test pick two CPUs from the allowed set instead, for example by
parsing taskset -pc $$ or cpuset.cpus.effective? Another option is to skip
when CPUs 0 and 1 are not both usable. Checking the result of the priming
lookup would also help.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201174021.7211-1-dsahern%40kernel.org
Technical Details
Message-ID:
<179649846142.3148.18354584472003624041@kernel.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378108-linux-kernel-netdev=dewy.ruReferences:
<20261201174021.7211-13-dsahern@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378108-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 12/13] selftests: net: fib_tests: Add stale pcpu test Date: Sat, 05 Dec 2026 19:21:01 +0000 Organization: Usenet Network Message-ID: <179649846142.3148.18354584472003624041@kernel.org> References: <20261201174021.7211-13-dsahern@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3103594"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bJwDh7lUXKB6+/YBlUgX6+V2L4k= sha256:0ovZl1WN88FZOvPTjw+TrA21pbKN2ZjcAFnrAjLQv/k= sha1:ROFNCVMMrQuDO8fSqzzi3QnKBc0= sha256:k0qwawy2xOUsj4scdMu2BCtOuc8fzDuMM8SruBTDSdw= 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 B6A0C117E98; Sat, 5 Dec 2026 22:21:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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 A1P2aXOEuCCW; Sat, 5 Dec 2026 22:21:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378108-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 9C092117E9A; Sat, 5 Dec 2026 22:21:22 +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 E525432675; Sat, 5 Dec 2026 19:21:03 +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=1796498463; b=WeO5ppP2zbg035GgYfflVi3iWVBcpi5nUVRM3gyBIqCSH4RiqLkFEg+cU54afYallr9d EoOW/0oOHtWKYINg1lzWL5LSBbTRDwmXJWifCSsDySmcgsJsz3aWn3bPmvK6QrbtteI8u qFrQ1L1w3ZXkHQnPsKui/5PjmhSAsfXvjJXMhRBFnTqb5ckjgALhhlElSmqvOcxJ+A+U5 hUWZQx8zWbqTkrpKdp6SYm7TGHR31fFRjCKvDpdQrvJWjjTCGzlkLMS7EDT8BfpZqlWn5 ySJ87Wf6xhQuFIS2TFtRz7WkMN2y8CpBNRyDv9MKPd54b/EO28FcDJCfbL2sA/jmUGg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796498463; 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=n4cXTl36mIkHE7R8Qk28w+Nyh1e5F/yOIrJC5OOdJ9g=; b=P7u1FKGwUiJ3g+LHiEmECrPzTHhz07OrH0lIWGkEtpD9fUhjblv5ArXmBXyjNEK0FM3V WGW3gi1YCwp29dZJxQ1l6VXS75zHNIahvoMR9nsYa+bz751K2RWkAa2CkCyk4EORowhM4 a+X6XjPGzlu0gY/wfQnsJH40YLUtvL00ciKXa2tIiv7dqMADI1xOHHeQjLFdWGg90VsLd ZeqX7Beu1HjSlnjWsVxtuaABHmiTqlc8EG1e/gi6l2oMgWoxhtg9WWgQepqigPAW7oo+s KgTwMmSyjhnSeQZvrb5ygV3wxgnx+7Oci4q4mYq8IZ+2QBZkut5qbWBmkwao1fmWNOQ== 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=ipCzwOg1; 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 BC79F606A332; Sat, 5 Dec 2026 19:21:03 +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=ipCzwOg1 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=1796498462; b=a7Tny+Q2gQauBEqgpt8QnxnV9oebf/bdxAEBmuwrTerSFsk3Buchd08K195RxEdVa/2D aatFd37S9T+wDG1+hU56kb7mY0Jf720SrUlbxu39wijQd8vYBvLXHWhYqCJB29tGAE7D2 F8Tx65vBkrM9N2wOUBt+DEBhZuKBUiuVGMMskedUVO9z4/3T9PrA3cVmOMGBPAQdDckU1 9VDtGGYquF7kEtlczoUBbVH8TjV6Phk7ps3dZFjL+QUbK/K15ilimMhu2hMJpjWVtm6j1 pR0hkk+gs7YEX0JJ8ijkNxzfDnyZfCViBe2qeLoxfNI8kgf3mQVxQeewkWkZ1D2rG8A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796498462; 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=n4cXTl36mIkHE7R8Qk28w+Nyh1e5F/yOIrJC5OOdJ9g=; b=qH6K7sthUl5IJL4h75tFmTbfPBnlKcIVpa+4mVSKaOpW2NouJXHFeuJI1j1HPVSD/ec8 1ytz8fSV0mjae1H94rYnIgUvceiq6MJcESXC8dr95wj5jj6nKsnodbwoRDwMFJ0VDyTKz Z5Gc5ijDRUYPWjobHw2xaMrTF4aiUqPZJgzIeyCglrKY9tqF7x11AA18hhQmv1EeZO6/9 mj44cjX2JzoIPpIxPgA4u4E3+G1qMCx52xdsOkw3Po7SHxUr11+AjiQjLJuddSqhpmzKF pB3YyKxHq5c8NiRV5J4I6M1isFNd7rvicg2HXHZyAwBRyv0u9+x9wsMrCJQfTh/wJJA== 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=ipCzwOg1; 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 DA8CB606A33C for <netdev@vger.kernel.org>; Sat, 5 Dec 2026 19:21:02 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E133B1F00A07; Sat, 5 Dec 2026 19:21:01 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796498462; bh=n4cXTl36mIkHE7R8Qk28w+Nyh1e5F/yOIrJC5OOdJ9g=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ipCzwOg1dq2Tvs64wCfpjK59+0I4z8jAKVJ6nCepIetC486c5Xk8RlO1KMNCPnIow Nk/+jgWZ8PAdpiFx8CPy3qto1COm4FMGtzbdlTBZx3PWf9LdNfZ7rW/4wOfqYKu+XC MhExDRgRS+/2hGXJ3KuQxxKecHyiLwF+jS3KKhKamleoMoZcCTIWlPW1UvHrkDoQRK KrKTkMlI6FSCOVJz+txDViQloRk23UM3FcAVypwg70cxuJvaQJTIxYmeIyGuBjN0Ua ugFUekpzl9dvtWp8mGIqLRVmiMABeiibBsA+xhaD4YyqiIPVsISHwHjeK29yUqO3ps NACuCwKr1jMQQ== X-Cc: netdev@vger.kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ralf@mandelbit.com, ja@ssi.bg, dahern@nvidia.com, noreply@anthropic.com X-In-Reply-To: <20261201174021.7211-13-dsahern@kernel.org> 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