All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: dsahern@kernel.org
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
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	[thread overview]
Message-ID: <179649846142.3148.18354584472003624041@kernel.org> (raw)
In-Reply-To: <20261201174021.7211-13-dsahern@kernel.org>

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

  reply	other threads:[~2026-12-05 19:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 17:40 [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 01/13] ipv6: allocate the exception entry before removing the one it replaces David Ahern
2026-12-02 16:02   ` Ido Schimmel
2026-12-01 17:40 ` [PATCH net-next v3 02/13] ipv6: keep a superseded pcpu dst working until its holders notice David Ahern
2026-12-02 16:19   ` Ido Schimmel
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 03/13] ipv6: don't insert a PMTU exception whose MTU could not be stored David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 04/13] ipv6: invalidate the failing dst in ip6_link_failure() David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 05/13] ipv6: tell route dumps about exception inserts with a table sequence David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 06/13] ipv6: validate dsts against the netns route generation David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 07/13] ipv6: make rt_genid_bump_ipv6() a plain counter increment David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 08/13] nexthop: factor out nh_has_f6i() David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 09/13] nexthop: bump the IPv6 route generation on group changes David Ahern
2026-12-05 19:20   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 10/13] ipv6: stamp dsts with the generation sampled before the FIB lookup David Ahern
2026-12-05 19:21   ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 11/13] selftests: net: pmtu: check that a deleted cached exception stays deleted David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 12/13] selftests: net: fib_tests: Add stale pcpu test David Ahern
2026-12-05 19:21   ` netdev-bot+sashiko [this message]
2026-12-01 17:40 ` [PATCH net-next v3 13/13] selftests: net: ipvs: check a PMTU learned after the DR route was cached David Ahern
2026-12-05 19:21   ` netdev-bot+sashiko
2026-12-01 17:43 ` [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation netdev-bot+sinfo
2026-12-02  9:45 ` Ralf Lici
2026-12-03 15:34 ` Ido Schimmel
2026-12-03 16:55   ` Ralf Lici
2026-12-03 17:16     ` Ido Schimmel

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=179649846142.3148.18354584472003624041@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=dahern@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=ja@ssi.bg \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=noreply@anthropic.com \
    --cc=pabeni@redhat.com \
    --cc=ralf@mandelbit.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.