🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25555

[PATCH net-next 0/2] ipv6: remove dst_ops gc handler

#25555
From: David Ahern
Date: Wed, 02 Dec 2026 01:55
69 lines
10133 bytes
IPv6 is the only address family that still uses dst_ops->gc to
limit dst entries. ip6_dst_gc() runs from dst_alloc() whenever
the entry count exceeds gc_thresh. It never fails an allocation
(max_size is already INT_MAX); it only forces a fib6_run_gc()
pass. That pass can free expired exceptions and expired routes
on the FIB6 gc list. It cannot free uncached dsts, which are
held by sockets and skbs.

Remove the handler and rely on the structural limits that
already bound the dst count, the same way IPv4 does.

How the dst count is bounded
----------------------------
Per-cpu routes are DST_NOCOUNT and are limited to one per cpu
per nexthop.

Cached exceptions (PMTU, redirect) live in a per-nexthop hash.
Each bucket is limited to a randomized depth and the oldest
entry is evicted on insert:

              IPv6                    IPv4
  buckets     1024 (shift 10)         2048 (shift 11)
  max depth   FIB6_MAX_DEPTH (5)      FNHE_RECLAIM_DEPTH (5)
              + random(0..4)          + random(0..4)

Time-based expiry:
  - IPv6: FIB6 gc timer every gc_interval (30s) while the gc
    list is non-empty. It also runs on route flush, ndisc
    device events and exception insert.
  - IPv4: fnhe_expires is checked on lookup and update, and
    fnhe_genid invalidates stale entries. There is no timer.

Uncached dsts (icmp6_dst_alloc(), FLOWI_FLAG_KNOWN_NH clones)
are counted but not capped, in both families. They are bounded
only by the users holding references. The old gc could not
reclaim them either.

Behavior changes
----------------
- dst_ops gc_thresh defaults to ~0, as in IPv4. Reading
  net.ipv6.route.gc_thresh now returns -1 instead of 1024.
- gc_thresh, gc_min_interval, gc_min_interval_ms, gc_timeout and
  gc_elasticity are kept so existing scripts still work. They
  have no effect, and a write logs a one-time warning.
  gc_interval is unchanged.
- Expired exceptions are no longer reclaimed early under
  allocation pressure. They stay until the gc timer runs, up to
  gc_interval plus the exception timeout. Memory is capped at
  roughly 1024 x 9 entries per nexthop, the same order as IPv4.

Patches
-------
1: remove ip6_dst_gc() and its per-netns state, and mark the
   gc sysctls deprecated
2: selftests: add a stress test for dst_entries

David Ahern (2):
  ipv6: remove dst_ops gc handler
  selftests: Add stress test for dst_entries

 include/net/netns/ipv6.h                 |   2 -
 net/ipv6/ip6_fib.c                       |   1 -
 net/ipv6/route.c                         |  74 ++++++----
 tools/testing/selftests/net/fib_tests.sh | 178 ++++++++++++++++++++++-
 4 files changed, 219 insertions(+), 36 deletions(-)

-- 
2.54.0 (Apple Git-157)
Technical Details
Message-ID: <20261202015529.7846-1-dsahern@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375479-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375479-linux-kernel-netdev=dewy.ru
From: dsahern@kernel.org (David Ahern)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 0/2] ipv6: remove dst_ops gc handler
Date: Tue,  1 Dec 2026 18:55:21 -0700
Organization: Usenet Network
Message-ID: <20261202015529.7846-1-dsahern@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1864096"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:P1FAz8WNS4pCEJDAaXZP5ObMbfg= sha256:UVAHo+VfSaPt/vvClzwrXverHid7ghp60t9sQnBH/mQ=
	sha1:zaZr/74/Fj6gfAmBK0tWqhtCbIY= sha256:yV1yx9zgtIRmJb0ARB0VPhZh5SN4igF0rSb8ymcPeNk=
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 E869D11751E; Wed,  2 Dec 2026 04:55:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 MxzmhxGfsbZO;
	Wed,  2 Dec 2026 04:55:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375479-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 CA369117508; Wed,  2 Dec 2026 04:55:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id DB72D2819C; Wed,  2 Dec 2026 01:55:33 +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=1796176533;
	b=twPsE7GbOAH0vgOM3VREa5spH40rTEknp8auHRvzrkDyDK9Yhw/PPY1rOBKciPq/7KM2
	 +6iogag+vJ1QSHNhI4g3RJwdVNf80SoA/TGEkHowIBaaoGFF3JkwhaKilZyMzmov+OJOs
	 3l9NHUO6WEiSWBrUnKXyRMlUBebWfP3wbv3EYTngZrieCHtboUcBiQxR4yjCSGqnE3WWU
	 jV0mHQOz3/eZwOnOZPUT6pcnVyGV/TH3Pvj91CUQo31lGBVwjjTMTOOZb2XSW+3QZMG77
	 rRjtC8amKyXO29lAJk4dypeANwKVWEpzSyxw3/a0qXYOqq0e7ysq8wYEfuwgmOmzYWA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796176533;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=U3jPdUSTRnjaTKUPw7FJCnQmzM12sEm3YNDHMP/puJc=;
	b=MUnhUWylv1kW3K2UpLbuwlCuT/R5cRejr9BnLQkz7p5PLz9f2xMj6SZFJb074NBSFqgB
	 u8CEeab8qNK3F70SrF2dft2gIpdkaSaAfWD3PA7G7RwS8Q/KwP0+Ep7EFydsj1YOpQ0JL
	 6t/K3XEH7hOFRCU0VIPAZpQrrHFoBZ7HTHQC5UtuLXQahjhP3+3P2E4m9sJRyLFJCAsK2
	 QON2TxkWGTC6x2yzUYyqKoRfsq+MMriK52tFLtp3PE/dCiHduR2sdrAelgmV3XTzPpWRl
	 ySO2k3wfM9w9H8Rtky0BPmd6oWh2hoy+af7m4hOF8FuG0LW2ysNbimQE9Md6s7CHhDQ==
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=YbVVGe7f;
	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 B32CA606A32E;
	Wed,  2 Dec 2026 01:55:33 +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=YbVVGe7f
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=1796176532;
	b=z9SnjSziPFT0vxLoUe3SufPazm4eSKjhDUQmF1FondNVamcfJt+YdiF8uQcpZmwfBY1u
	 7tNvZJnM7X5BLIdD9mrTsfxP3AxR21/YjWuxLtiNMqHrltebdn9NmCiLW0tmXrTT8yQQs
	 bwfGkbvKtt0F4N7Qn/cbhPmD12K5r/8ZNMONxSE1iPDkKplaXEMvWdVt+9c7rXscajzYw
	 6GLHJ9YD9wsIuKnIcLOlPg+xfL445OTsBJ0u7i1p+VrrJO52aUjBQrcwEXdf0XbTYLS0Y
	 c2jnk31IncAWC+AJuu3WifjZc6JauQhURuOw2tPfXsDbID/hpOu2pTj8nOrJwJoJ2Gw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796176532;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Transfer-Encoding;
	bh=U3jPdUSTRnjaTKUPw7FJCnQmzM12sEm3YNDHMP/puJc=;
	b=YOU32QO4O4SkHYKVS8Gl+VpxlB+S14l2543W1pZ2yYoeC1+CI8K+rwO/cO7zFybnII9I
	 Sy81DSXD5971jQBmk56NiIXeBES/qUAAHMy5O5KNgho4Gkgh9RT4Hy/scAb7OWHRhLKX2
	 JKpMuBcuxciMmWpS+HtlU8KEqfqvS1sgz+njmOHpqvJ7QV29+vtK6dOexKsCoDgivbgOE
	 wu6LJsNgZuQr3WnQlsfWN4sRnGIgQ/3YxeRmZa9io5MCGfYa8RYPrSJuf5FaCRSouLqEN
	 thhsiXTg0G9cY+SRyi6gIvSMKhULuSpGzJbwVtdEuhNxtwRwFVfegp3FodYkLuDKJWw==
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=YbVVGe7f;
	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 D18F5606A31A
	for <netdev@vger.kernel.org>; Wed,  2 Dec 2026 01:55:32 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 078B41F000C1;
	Wed,  2 Dec 2026 01:55:31 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796176532;
	bh=U3jPdUSTRnjaTKUPw7FJCnQmzM12sEm3YNDHMP/puJc=;
	h=From:To:Cc:Subject:Date;
	b=YbVVGe7fhJqzk2Qpl4xz8Oh7WvUNaiY3HaqxKbOXpm6Pdzb6mv6jjKdYa1CWZ522E
	 Q7Cf7QW9kA3Er8Q01hX02l2uq50E28vvqqC8/G0f+gM3s0hGGP8XU2kK/HqyaaDG8f
	 ZODKb/hEAS8MNeNqA2BYqmBd0LVC+/1QyGqCU10QZofYwI2rBwpQeyJ3u2XpbD0etB
	 c7POwhwiMcTXCMZpoFk6LnzMTiA2kgTq51F8GRgCv/YMQJk/KYNS1BurP0ps5wxPiQ
	 sfGLS6Lvv1EsGwg+1f2Z8oF/dyTSW8eWv8vYraYC1seHJpSz5/igT5MkZw37EQrmMZ
	 EU/B/QdCkb+ow==
X-Cc: dsahern@kernel.org,
	idosch@nvidia.com,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	willemb@google.com,
	horms@kernel.org
X-Mailer: git-send-email 2.54.0
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