From: Kuniyuki Iwashima <kuniyu@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
netdev@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>
Subject: [PATCH v1 net-next 2/4] selftests: netfilter: Set gc_thresh[123] for gw netns in nft_nat_zones.sh.
Date: Mon, 12 Oct 2026 19:44:57 +0000 [thread overview]
Message-ID: <20261012194530.3751034-3-kuniyu@google.com> (raw)
In-Reply-To: <20261012194530.3751034-1-kuniyu@google.com>
Since commit cda2962b6e2b ("neighbour: Namespacify neigh_tables."),
net.ipv[46].neigh.default.gc_thresh[123] are per-netns attributes.
Let's update nft_nat_zones.sh.
Note that the number of neighbour entries does not even reach the
default gc_thresh1 (128) with the default maxclients=100, and the
raised thresholds are only needed for gw netns when maxclients is
manually increased (e.g., 2000 as mentioned in the comment).
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>
Cc: Phil Sutter <phil@nwl.cc>
---
.../selftests/net/netfilter/nft_nat_zones.sh | 34 +++++--------------
1 file changed, 8 insertions(+), 26 deletions(-)
diff --git a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
index 9f200f80253a..d935c967dd13 100755
--- a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
+++ b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
@@ -31,25 +31,6 @@ ret=0
# NAT Gateway is supposed to do port reallocation for each of the
# connections.
-v4gc1=$(sysctl -n net.ipv4.neigh.default.gc_thresh1 2>/dev/null)
-v4gc2=$(sysctl -n net.ipv4.neigh.default.gc_thresh2 2>/dev/null)
-v4gc3=$(sysctl -n net.ipv4.neigh.default.gc_thresh3 2>/dev/null)
-v6gc1=$(sysctl -n net.ipv6.neigh.default.gc_thresh1 2>/dev/null)
-v6gc2=$(sysctl -n net.ipv6.neigh.default.gc_thresh2 2>/dev/null)
-v6gc3=$(sysctl -n net.ipv6.neigh.default.gc_thresh3 2>/dev/null)
-
-cleanup()
-{
- cleanup_all_ns
-
- sysctl -q net.ipv4.neigh.default.gc_thresh1="$v4gc1" 2>/dev/null
- sysctl -q net.ipv4.neigh.default.gc_thresh2="$v4gc2" 2>/dev/null
- sysctl -q net.ipv4.neigh.default.gc_thresh3="$v4gc3" 2>/dev/null
- sysctl -q net.ipv6.neigh.default.gc_thresh1="$v6gc1" 2>/dev/null
- sysctl -q net.ipv6.neigh.default.gc_thresh2="$v6gc2" 2>/dev/null
- sysctl -q net.ipv6.neigh.default.gc_thresh3="$v6gc3" 2>/dev/null
-}
-
checktool "nft --version" echo "run test without nft tool"
checktool "conntrack -V" "run test without conntrack tool"
@@ -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
for i in $(seq 1 "$maxclients");do
setup_ns "cl$i"
--
2.56.0.385.gd3acb90ef8-goog
next prev parent reply other threads:[~2026-10-12 19:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 19:44 [PATCH v1 net-next 0/4] neighbour: Misc follow-ups on per-netns neigh_table series Kuniyuki Iwashima
2026-10-12 19:44 ` [PATCH v1 net-next 1/4] Documentation: networking: switchdev: Replace arp_tbl with arp_table(net) Kuniyuki Iwashima
2026-10-12 19:44 ` Kuniyuki Iwashima [this message]
2026-10-12 19:44 ` [PATCH v1 net-next 3/4] neighbour: Schedule neigh_managed_work only when needed Kuniyuki Iwashima
2026-10-12 19:44 ` [PATCH v1 net-next 4/4] neighbour: Floor INTERVAL_PROBE_TIME_MS at 1000 Kuniyuki Iwashima
2026-10-13 7:16 ` Ido Schimmel
2026-10-13 7:27 ` Kuniyuki Iwashima
2026-10-13 7:00 ` [PATCH v1 net-next 0/4] neighbour: Misc follow-ups on per-netns neigh_table series Ido Schimmel
2026-10-13 7:23 ` Kuniyuki Iwashima
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=20261012194530.3751034-3-kuniyu@google.com \
--to=kuniyu@google.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
/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