๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23842

Re: [PATCH net v3 2/2] wireguard: selftests: remove a peer under load

#23842
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 10:25
79 lines
11003 bytes
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
Technical Details
Message-ID: <179586151812.3135.2067343848576373135@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373092-linux-kernel-netdev=dewy.ru
References: <20261127102243.49405-3-apasichnik9@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373092-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 2/2] wireguard: selftests: remove a peer under load
Date: Sat, 28 Nov 2026 10:25:18 +0000
Organization: Usenet Network
Message-ID: <179586151812.3135.2067343848576373135@kernel.org>
References: <20261127102243.49405-3-apasichnik9@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="930395"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Wn4tIUVTod0IR4+K16S0AJ+v6+c= sha256:8/KGjJKxAYmRsQYu8bGMeLif3OW7jVJgeGn1GiEZRtM=
	sha1:ECGi0d9hd5btcZzM8p1J93rB0Bw= sha256:D89uVkAWNLlLN5I8/w6rcj9xjFUqJWcKhx+QUTppDFQ=
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 D0E70125F77; Sat, 28 Nov 2026 13:25:38 +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 bhv84NZU4asj;
	Sat, 28 Nov 2026 13:25:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-373092-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 7837B125F76; Sat, 28 Nov 2026 13:25:25 +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 1C50B244C4; Sat, 28 Nov 2026 10:25:22 +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=1795861520;
	b=MgRE7tF81unClbjvwdCll7FbqfuFVD/BE/vBi2Rjs/UfZB7c9a8WzFFbf0Fu5at1H05Q
	 LSXoAcZUih2nlRHyEVQRUfW8/UqS81/CVvz4ZfxWrKBdsH9gUZ43vaHX6V+xu+1yd0bzx
	 iVrblW+RtsDgDCiAhEuxSZQOWM0rLmLr8scsAgUB40OaOGjpo7aOEEyQp4hSkHIPDEzkG
	 ZfFkzPxztFiyjW3eryjT9GjGFVcBb+9V/SxUSq58pvHoLFXQa2Pa/Iw/XB6rKlzym6iWO
	 eufgYeXvNOuz61gs/0cPz102o7L1pjPZteseB+uyD0NJKgjaR6lmn7pwmJp5ftcKzDw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795861520;
	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=VY2l0xjOLwNl/vWxE6ifCQZY2eHn010i2nRNQ5w5xpI=;
	b=4oYvFzaJNgHNL07aEqES4CqkEYiecgJkdNkOY2ToKuSkSfH3yEybwfJC8xA+ZSpKtf9v
	 03iwbDwb2FODsH56TQGCoXTGSq7Vsg/UFu4O+OeWbuXDCWCdsjeZeuxCMTECEx5xiELrW
	 57duTcaoUqEWIMA/qUud38np90CU9Mgk7iOLi60tRVDCQ4/f7FclTFQlHwE7DHIm1PTnS
	 aP0sAzK5MP5Q0G5eo9Ajb+E+bMprL16Hg8krbfEUXLGQQES2/pwBYesTSSx4OnD7x33Ip
	 MjNCEkK6fCyycAWQJSgoW3JL+MZC65scepB2pH1HS7z1ufdg6MTJHB89et8xrd/dqIA==
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=h8rHK1yG;
	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 3D05D606A32A;
	Sat, 28 Nov 2026 10:25:20 +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=h8rHK1yG
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=1795861519;
	b=S9SaDjfTwVEqNEOtH0WZU+wSoyBWiK7GxwaQMm7auGZNDL8XyDap289YbipwUbuAyMk/
	 FTzI+8bora7bfHfQC2UBBYdGhF0WO/lWEwjwvLU9N1TrCYWbUpkbTE/ZNkiNyQG3m4L27
	 7aXfkgyG1nmyW2m0hKN5NIDrAEg3/LvCRIuSdf0yAAOoo/RDUaoYho1ASFjyDBf7FOCMj
	 jQjfnK6nYeD9+Y4KIHqxF6NSHKqDAUrATRVCXJrNkrjqsK5Ket4Ei79bsW+/Q6mD4t8WD
	 S7iSUn5HiJ7yniaA92qqKB2P0SHBNdRscUKLerSvVZNoh/XcQCxnWzn3BVam9QNggGw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795861519;
	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=VY2l0xjOLwNl/vWxE6ifCQZY2eHn010i2nRNQ5w5xpI=;
	b=VAB7ljtpZ+K8I8Lkiksi4Rr1xGbMevH/jdvqzqA+GZcsxPk6EK10beoZ1M8sB0abhu5C
	 N72HMHiXbeCH3gKrNahh/0oeB+vKYJTBQFJda9Ufx4oV3qqbnYsM3m1GHnRe8Hr9JMGbD
	 5O6PK2vqnY8QJ2Gw9J0fPQfL5h1PQxz4+kXEqHfLadAZsMvZZwGsABLIFQBdKJMidBIgK
	 IWAaEbp5yhyRWE6hfb9u3W5fkSrHpEIQH4iR/ZSVeSGDxxIqpiXk5dzN+sYMtbRDzJWiV
	 Z6eV/VN3jzZPgfGfV2zXn2eV69B+7eCPxRD8h8IbPrGdl2/tUnIu352XSIdNIIgjQMA==
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=h8rHK1yG;
	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 5F08B606A335;
	Sat, 28 Nov 2026 10:25:19 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CA5A1F00898;
	Sat, 28 Nov 2026 10:25:18 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795861519;
	bh=VY2l0xjOLwNl/vWxE6ifCQZY2eHn010i2nRNQ5w5xpI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=h8rHK1yG0nyHTDjDvM8yINTzVnZLAFuuFgcm7S75VrO4x9fnsPc/NLbOka+bBAoyj
	 jV/YegVw/b95b8UL8e4wZkP4gu3cUYK6aE3cJD2l3T7Z+IlPENDgRGpHoI3Kb+bizv
	 Z6b7b01iK706e60+j1eJeYyLtXwSPOHyTaQBK+QRX4NIh+YPbpJLoPCeYcibF13Eis
	 lvR4IHUaiCqWm57c+Fvi0L9GycM3w/ZxsyVbny9p/6zmrEydU53GZsGNdbQRSG0lUi
	 StttZ74+OePphODfCPS/tCXH4tz+utLXn9Xj45Ceh5gdQBKc9sQo2H+FuMohsi2FfJ
	 hWxwmO4igCAAw==
X-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
X-In-Reply-To: <20261127102243.49405-3-apasichnik9@gmail.com>
X-sashiko-severity: Low
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