Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: apasichnik9@gmail.com
Cc: Jason@zx2c4.com, wireguard@lists.zx2c4.com,
	netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 2/2] wireguard: selftests: remove a peer under load
Date: Sat, 28 Nov 2026 10:25:18 +0000	[thread overview]
Message-ID: <179586151812.3135.2067343848576373135@kernel.org> (raw)
In-Reply-To: <20261127102243.49405-3-apasichnik9@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] With the in-tree default VM configuration, the new loop in
  tools/testing/selftests/wireguard/netns.sh (lines 210-222) will…

--

wireguard: selftests: remove a peer under load

This adds a loop to netns.sh that removes a peer ten times while a UDP
flood is running, and re-adds it after each removal. The goal is to catch
packets left on the per-peer receive queue that keep the peer alive. It
also raises CONFIG_LOG_BUF_SHIFT to 21 in the qemu kernel.config so the
created/destroyed object check sees the whole log.

> diff --git a/tools/testing/selftests/wireguard/netns.sh b/tools/testing/selftests/wireguard/netns.sh
> index a8f550aecb35d..8303802c02f27 100755
> --- a/tools/testing/selftests/wireguard/netns.sh
> +++ b/tools/testing/selftests/wireguard/netns.sh
> @@ -207,6 +207,20 @@ n0 iptables -F INPUT
>  ip1 link set wg0 mtu $orig_mtu
>  ip2 link set wg0 mtu $orig_mtu
>  
> +# Remove a peer while a UDP flood keeps its receive queue busy, then re-add it;
> +# packets left on the per-peer queues would keep it from being destroyed,
> +# which the created/destroyed check at the end catches.
> +for ((i = 0; i < 10; ++i)); do

[Severity: Low]
Will this loop catch a regression of the rx_queue purge in the default
selftest configuration?

The qemu Makefile defaults to a 4-CPU guest:

tools/testing/selftests/wireguard/qemu/Makefile:
    NR_CPUS ?= 4
    ...
        -smp $(NR_CPUS) \
    ...
    printf 'CONFIG_NR_CPUS=$(NR_CPUS)\n...

The commit message says that with four CPUs "the leak is hit much less
often, so NR_CPUS=1 is the configuration that checks for it". The leak
needs rx_queue to still hold more than one NAPI budget of packets at
napi_disable(). With several CPUs, the decrypt workers and NAPI usually
drain the queue first.

Nothing in the tree records this. No Makefile target runs netns.sh with
NR_CPUS=1. The comment above also says the leak is something "which the
created/destroyed check at the end catches", with no mention of the
single-CPU requirement.

As a result, a plain "make -C tools/testing/selftests/wireguard/qemu" run,
including in CI, would usually pass on a kernel where
peer_remove_after_dead() no longer calls peer_purge_rx_queue().

Could the comment or the qemu Makefile mention NR_CPUS=1? Alternatively,
could a single-CPU run be added so the check is exercised by default?

> +	n1 iperf3 -s -1 -B 192.168.241.1 &
> +	pids=( $! ); waitiperf $netns1 $!
> +	n2 iperf3 -Z -t 2 -b 0 -u -l 64 -P 4 -c 192.168.241.1 >/dev/null 2>&1 &
> +	pids+=( $! ); sleep 1
> +	n1 wg set wg0 peer "$pub2" remove
> +	kill "${pids[@]}" 2>/dev/null || true; wait "${pids[@]}" || true
> +	n1 wg set wg0 peer "$pub2" preshared-key <(echo "$psk") allowed-ips 192.168.241.2/32,fd00::2/128 endpoint 127.0.0.1:2
> +	n1 ping -c 1 -W 1 192.168.241.2
> +done
> +

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127102243.49405-1-apasichnik9%40gmail.com

      reply	other threads:[~2026-11-28 10:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 10:22 [PATCH net v3 0/2] wireguard: free receive queue packets on peer removal, and test it Andrii Pasichnyk
2026-11-27 10:22 ` [PATCH net v3 1/2] wireguard: peer: free packets left on the receive queue on removal Andrii Pasichnyk
2026-11-28 10:25   ` netdev-bot+sashiko
2026-11-27 10:22 ` [PATCH net v3 2/2] wireguard: selftests: remove a peer under load Andrii Pasichnyk
2026-11-28 10:25   ` netdev-bot+sashiko [this message]

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=179586151812.3135.2067343848576373135@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=apasichnik9@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=wireguard@lists.zx2c4.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox