From nobody Sun May 3 15:45:44 2026 X-Original-To: dev-commits-src-all@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 4g7pyd1vv1z6W36G for ; Sun, 03 May 2026 15:45:45 +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 4g7pyc6nfyz3Jg9 for ; Sun, 03 May 2026 15:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777823145; 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=jTanJrZ690SwiM/cMhh/j/x3yQKOif2lTstwn6V/ktM=; b=DiNUzTwxLG0VplZqWD3CGBl4YgOpaNLgA0+hIT025zvUG+2xL9jdcjOZ5xG/7AMMr32GHf YTdNWKnkLBgA6SzG2qg2y4ifiUdSUHwsjqWTcC1yTRgBUjtVVXJ4Lm+9JemHVaTLex42gp kVr6g6/EbgZ1v2oEomUm3OntXPk+tSi3l1iBWJ3pZJIQhdoB0pxp9MaANpACHBiZIJ0kUx 2oW1lFJwwjU7R2czj3aPaz0/snCttnJuGX8XD9bZnGTEZydBqTRkKAMZ+7Cw/YWiAMzjBB +UZmGAAG6AbzbaehHwhJql8VIG2O1DR5p5iue7QzjTM5RiBXGJfipw8htRwBSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777823145; a=rsa-sha256; cv=none; b=p25HQ20sAvttWyGpN/7u8Hwrwz/bH76y/X/Fk0v8jS2pLXl9Gm89Y0wHvAf5ri7EaxpI56 4aZQXInmPNj/RlSMGSUV/eTFAU80hzxsBl7AXz1ndMmSPGuhnjCSBp2+xRXpJa5HxcJ5Bq VDfnl9MOLyNfKgKO4eCbMt1EgMBrx+dVtMi2aVNrWz/frS2byYHYWbqw+ebUUlA7M82Dom buVYmbj6+NOzj3hlbZksgrU7LTLlw2jCIOvanm6uLd4ViF/AHoIc5K+HtPIO1kp3+ZKlMf q3Y7EI6I+AvorLeK0hcX1NMukrHFTkRKQ5VMN4IBw502vXmZLH138ssV/c/ZmA== 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=1777823145; 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=jTanJrZ690SwiM/cMhh/j/x3yQKOif2lTstwn6V/ktM=; b=yWqG3eNPE3RTg7EdUqs5XiAX/x2wDE/l/nqQAUVhW2gOHFQLKha3pBg03FXKN2WatZ7/Bq OWD8oUxZyh7iSzMcHy8A7xukqDpTM2HYHZ+mjzmNXuYJcg6x4jjvb/uB7Of6H8MX2J9Uf+ c2rGtxYMTgcxTzDlJy+Hd55M6EZuW5DIswtlEBlVqTFVCfiRDo2j2XgMged9kNAFK9t6Ii VFIXAL4usVhQIjMom9jbPYe3rb92vBljNUvvBxDh88jle8zWbOeRCK+3O33JqFXledtZVK PjxhG0vQiIhrA866o40FPcfLN1IJPG1lXPuwykgg+4aA/LxR7sdIQuXC+16mSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g7pyc5txDzftB for ; Sun, 03 May 2026 15:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e78a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 03 May 2026 15:45:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1071c883467f - stable/15 - routing: Initialize V_rt_numfibs earlier during boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/15 X-Git-Reftype: branch X-Git-Commit: 1071c883467fb5e15722ec3873125917afe0373d Auto-Submitted: auto-generated Date: Sun, 03 May 2026 15:45:44 +0000 Message-Id: <69f76da8.1e78a.5fb3342@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1071c883467fb5e15722ec3873125917afe0373d commit 1071c883467fb5e15722ec3873125917afe0373d Author: Mark Johnston AuthorDate: 2026-04-18 12:20:00 +0000 Commit: Mark Johnston CommitDate: 2026-05-03 14:40:10 +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 3b7bb1385d0e..6a55efa1d2fe 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. @@ -292,17 +292,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();