From nobody Tue May 19 16:46:36 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gKgYT2QHtz6fSBb for ; Tue, 19 May 2026 16:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gKgYT1Nslz3C3S for ; Tue, 19 May 2026 16:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779209197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RKMOfuffM33L3gXBcRk+wUglCF0AVJeS7o5fEDxYg7c=; b=nWR2xYb2DzxKSrDYbaEka8RvTxhPbT56QKTJ2ej/IPX39v9yAQWgP0PdYAztIc36/t2BKQ 9dm0O7B/6oXC/DoWvkBn1jWwckv+zW539AteorrLJbK62DfoHg4dl9LhA0Vxd4cbeYmQCt m2gG4vKj46w7/bIW/qagw2GZCTTjN5MbdxYCa507TnDu7BPgE1y5EHxjiElEzGDoE+cLgQ +JDS4IaLlcOm8GD7WpiyMfWf5xaL27LJ8/ySumJfFU2L2VBzEPE8nsZ9/1ZKWS0pJyJbjh 3KpcN8RRqFdmtjNwoIv55bE6HgapGLOfpYDdVlFUGGOUO1BhPF0tnZsU3sNXcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779209197; a=rsa-sha256; cv=none; b=s8cnuOBlETDkDVNpvEgLaSln+6e9QiLly3lPVD0GbCE0KeYKLDRroQ3b9eWcQM7W42yOSF VUGjMwMF4JI/tfW9LADHg3KlEDJR5+WoskdeGCo5+HH0un5yFg67t4ZYd9ZSiLeMYh8A9M Hw8VBGiHBZchONm8XtpkfTfqvNpjn8Yv0dv+KKZKDOwFMwUxWU0kEhIt3DWIbn7ZDTpk3s awpi6IeSBHyWU72wyMFPnJ0Wlbph0AUxBmLz91xBNLwVkbwnpXAXSP+2Zca1S82NlxtEFM kDnAXOX1axOCEYpzZbVSAQjAidT3fQR2Dri8/mk9DvG61JYU8PdHgCD/dF5XTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779209197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RKMOfuffM33L3gXBcRk+wUglCF0AVJeS7o5fEDxYg7c=; b=kRx5O4DyrOdmjy14ketC8xYZTSWOMiUSQxVq3y+0Q5sqS0egsHiRPR92ox2zflFCVocq4C QXathGoOb51TKUK0YY9TuQ4Wd+JbquQd0XeVywUrrTN6dQ0LIvwT8r759PvBOViWVuKkTs JfWbHij204OK4TjHlKu3TUbTD07VtFoV6sn15LtY6adlUcaVlCi+M9cnFllh3KwL4RE5sf /52Z/Elds+8jbWKJp1FVWHBE+w8FtaAnLB4di8qIJM3ttB8L1wy/cenb3ZGeCkmKRYBLWf e2w7062QIXqKBpSSsPihXKLFDgjN/YqFUm8skY/SFuF2USxm4RTm/4A8DQVIuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gKgYT0SB1z7ZC for ; Tue, 19 May 2026 16:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1cbea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 19 May 2026 16:46:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7d63a7584c2f - stable/14 - routing: Initialize V_rt_numfibs earlier during boot List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d63a7584c2f1372741b088fc031c3ab2d015d61 Auto-Submitted: auto-generated Date: Tue, 19 May 2026 16:46:36 +0000 Message-Id: <6a0c93ec.1cbea.2b623939@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d63a7584c2f1372741b088fc031c3ab2d015d61 commit 7d63a7584c2f1372741b088fc031c3ab2d015d61 Author: Mark Johnston AuthorDate: 2026-04-18 12:20:00 +0000 Commit: Mark Johnston CommitDate: 2026-05-19 16:46:28 +0000 routing: Initialize V_rt_numfibs earlier during boot V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel config option) or boot time (with the net.fibs tunable). vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the tunable and updating V_rt_numfibs accordingly, but that means that earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value for V_rt_numfibs before it gets corrected in vnet_rtables_init(). Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less likely to use the wrong value. Add a comment describing the weird, preexisting semantic of resetting rt_numfibs to 1 in VNET jails. PR: 294510 Reviewed by: glebius, zlei, pouria MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56473 (cherry picked from commit 2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6) --- sys/net/route/route_tables.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 925fb5dbcef9..94ca906bb8b0 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -83,7 +83,7 @@ VNET_DEFINE_STATIC(struct sx, rtables_lock); VNET_DEFINE_STATIC(struct rib_head **, rt_tables); #define V_rt_tables VNET(rt_tables) -VNET_DEFINE(uint32_t, _rt_numfibs) = RT_NUMFIBS; +VNET_DEFINE(uint32_t, _rt_numfibs) = 1; /* * Handler for net.my_fibnum. @@ -300,17 +300,25 @@ grow_rtables(uint32_t num_tables) } static void -vnet_rtables_init(const void *unused __unused) +rtnumfibs_init(const void *unused __unused) { int num_rtables_base; - if (IS_DEFAULT_VNET(curvnet)) { - num_rtables_base = RT_NUMFIBS; - TUNABLE_INT_FETCH("net.fibs", &num_rtables_base); - V_rt_numfibs = normalize_num_rtables(num_rtables_base); - } else - V_rt_numfibs = 1; + /* + * Set the number of FIBs based on compile-time and boot-time settings. + * For some reason, VNET jails do not inherit this parameter, so they + * must set net.fibs manually. + */ + num_rtables_base = RT_NUMFIBS; + TUNABLE_INT_FETCH("net.fibs", &num_rtables_base); + V_rt_numfibs = normalize_num_rtables(num_rtables_base); +} +SYSINIT(rtnumfibs_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, rtnumfibs_init, + NULL); +static void +vnet_rtables_init(const void *unused __unused) +{ vnet_rtzone_init(); #ifdef FIB_ALGO vnet_fib_init();