Article View: linux.kernel.netdev
Article #2937Re: [PATCH v1 net-next 2/4] selftests: netfilter: Set gc_thresh[123] for gw netns in nft_nat_zones.sh.
From: netdev-bot+sashiko
Date: Tue, 13 Oct 2026 20:00
Date: Tue, 13 Oct 2026 20:00
91 lines
9036 bytes
9036 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] In tools/testing/selftests/net/netfilter/nft_nat_zones.sh, the
patch deletes the init_net writes ofโฆ
--
selftests: netfilter: Set gc_thresh[123] for gw netns in nft_nat_zones.sh.
Commit cda2962b6e2b ("neighbour: Namespacify neigh_tables.") made the
net.ipv[46].neigh.default.gc_thresh[123] sysctls per-netns. This patch
removes the init_net writes and their save/restore in cleanup(), and sets
the thresholds inside the gw netns instead.
> diff --git a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
> index 9f200f80253a7..d935c967dd13b 100755
> --- a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
> +++ b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
[ ... ]
> @@ -59,18 +40,19 @@ fi
>
> setup_ns gw srv
>
> -trap cleanup EXIT
> +trap cleanup_all_ns EXIT
>
> ip link add veth0 netns "$gw" type veth peer name eth0 netns "$srv"
> ip -net "$gw" link set veth0 up
> ip -net "$srv" link set eth0 up
>
> -sysctl -q net.ipv6.neigh.default.gc_thresh1=512 2>/dev/null
> -sysctl -q net.ipv6.neigh.default.gc_thresh2=1024 2>/dev/null
> -sysctl -q net.ipv6.neigh.default.gc_thresh3=4096 2>/dev/null
> -sysctl -q net.ipv4.neigh.default.gc_thresh1=512 2>/dev/null
> -sysctl -q net.ipv4.neigh.default.gc_thresh2=1024 2>/dev/null
> -sysctl -q net.ipv4.neigh.default.gc_thresh3=4096 2>/dev/null
> +ip netns exec "$gw" sysctl -q \
> + net.ipv6.neigh.default.gc_thresh1=512 \
> + net.ipv6.neigh.default.gc_thresh2=1024 \
> + net.ipv6.neigh.default.gc_thresh3=4096 \
> + net.ipv4.neigh.default.gc_thresh1=512 \
> + net.ipv4.neigh.default.gc_thresh2=1024 \
> + net.ipv4.neigh.default.gc_thresh3=4096 2>/dev/null
[Severity: Low]
Are the thresholds still raised on kernels that don't have commit
cda2962b6e2b ("neighbour: Namespacify neigh_tables.")?
Before that commit, arp_init() and ndisc_init() registered the sysctls
with neigh_sysctl_register(NULL, &arp_tbl.parms, ...) and
neigh_sysctl_register(NULL, &nd_tbl.parms, ...). So neigh/default only
existed in init_net.
On those kernels the ip netns exec "$gw" sysctl call fails, and
2>/dev/null hides the error.
The init_net write is removed along with the save/restore in cleanup().
That write used to raise gc_thresh3 to 4096 for the single shared table.
Without it, the table stays at the default 128/512/1024.
Documentation/dev-tools/kselftest.rst says mainline kselftests may be
run on older stable kernels. The comment at the top of the script says:
# Don't increase too much, 2000 clients should work
# just fine but script can then take several minutes with
# KASAN/debug builds.
maxclients=100
With maxclients raised to 2000, the shared table would need more than
2000 IPv4 entries. That is above gc_thresh3=1024, so neigh_alloc() would
report "neighbor table overflow".
Could that make the ping counter or socat checks fail on those kernels?
The default maxclients=100 doesn't trigger this.
Would it work to fall back to the init_net write, with the save/restore,
when the per-netns write fails? Another option is to do both writes.
>
> for i in $(seq 1 "$maxclients");do
> setup_ns "cl$i"
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261012194530.3751034-1-kuniyu%40google.com
Technical Details
Message-ID:
<179192161050.434549.10197928132047024081@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345840-linux-kernel-netdev=dewy.ruReferences:
<20261012194530.3751034-3-kuniyu@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345840-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v1 net-next 2/4] selftests: netfilter: Set gc_thresh[123] for gw netns in nft_nat_zones.sh. Date: Tue, 13 Oct 2026 20:00:10 +0000 Organization: Usenet Network Message-ID: <179192161050.434549.10197928132047024081@kernel.org> References: <20261012194530.3751034-3-kuniyu@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2159878"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:R5Ki8TqC4NeVFIDv6wuhM7W+kdI= sha256:D3mZ15DSerBYa62fswJ3Fx5MMr0Wut+YugYwgihw+IA= sha1:O6m220GaicxtLAIO4dYKQKvvllY= sha256:KzMJZkzG6H/8xHctrViXZFxy9AyJGlpYFeAX2FwDH3A= 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 9AE8B10FF2C; Wed, 14 Oct 2026 00:46:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-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 28kuKx53l3F1; Wed, 14 Oct 2026 00:45:57 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-345840-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 40A6C10FF31; Wed, 14 Oct 2026 00:45:46 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 79B6581CC7; Tue, 13 Oct 2026 20:00:13 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 435DD5452BC; Tue, 13 Oct 2026 20:00:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DJH7hiOa" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0200254528C for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 20:00:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791921613; cv=none; b=KKT3YBzd/gOizZgqXZQtwdmFlA/c0zQAv4cQOgbziHheaWBqx8Jp+0T+TRSFMomVpZ4pWMLYC9BcvEC5M1tO87QceK6OiaC5dMbelVvAcxwVZzIFKCNQ3llpaUqkqSTMRwWuXf34QiqLk4ITx1c1+ayzJXTRtMzW6QyfzWcB2Hw= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791921613; c=relaxed/simple; bh=b45tsu+eioKXjGWESLNf0TWAtg+PwfGspwvZ/bxJWxc=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OWTwS9408sDIkJddhD0pqA7qnmqWPICT4Vmaer49go+bHNdDHYzTvvQQiF7+5Gxnpo2teevcbYpN0LXlgugdVJnCWA8Mmr+xfLwdGZcemVCU8Wj3T804d3h3A1eJLOxeLVP5T1Gy7y1VUVqeRPgg0gelADVnoWc7kYbGGw/p8w4= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DJH7hiOa; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE8831F000FF; Tue, 13 Oct 2026 20:00:10 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791921611; bh=II7YZB1fMbxeuKfkzDZZ3r+IByv1oRdAaVPiFHHTxAU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=DJH7hiOaodkUZIJkupc7sFCbEOU33bpWCoYa7F0gAlMUmdgNINeZUIUXxA6RX88YH 0AFskFxumQZfELlNNbjBW3/zdYpRkOmaz8jxAmjRGhCVkXyE/nORjOnsJfmhSQjFRh cl0vAoEsm16Rwz0kF0SrRk/2zv5mgKlH0lO+OBUFEeMaitu1XaFi7vkrR75x8RUcZB CUmuIVQ8nDLeRS3F2oP02uZ6hJMcN4ZQF5HFfXgDxCX+4Dxt8HVz2hu/iMD3su+x9B te9xq5a1a3Ntp8AYffZ7hWdN7NgCXiyhwvtdZzQjjipUP8+c0byBDeiLUWuh4+516Q HBy7yi0JzALhw== X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, idosch@nvidia.com, horms@kernel.org, kuni1840@gmail.com, netdev@vger.kernel.org X-In-Reply-To: <20261012194530.3751034-3-kuniyu@google.com> X-sashiko-severity: Low X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>