From nobody Mon Mar 30 16:15:38 2026 X-Original-To: dev-commits-src-main@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 4fkxDp3RNGz6WyDH for ; Mon, 30 Mar 2026 16:15:38 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fkxDp1Dwtz49pF for ; Mon, 30 Mar 2026 16:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774887338; 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=y6TDNf5vqQlkepVufqm5P4WB44/h8XH7bSMrOblId/8=; b=U4MUuCsCw8ODseHVl3iICSclsLon9Qfrs3MA30yqsHx5v3FUAlpT1keGcTvhJNkmgQK+6R w4yBrqGtVwSDfYhEnrrAwVoKnyq+pYXqM1ifMhwxz6FO0NLHRrCCU1e5UTacsHD9hs5Nam RUOnAjKEO2fiw480/8Km23OXflf4n+WKSi0KK2mvQpLH5q60e9nfC7QUiiSrR8pXeNgRNc LhFZbjuv1KNVT0Cl0KsQGxrKZn6vxDgZdpG3OnN4MNu1ZhUFEARk8RIxvKjZRl2xbZ2XK8 dCrHFZX3TXNztPyvBcf55ZcO5X/G7WVJ4/e96mgx5epM1XPjHypZwfy8pwvvwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774887338; a=rsa-sha256; cv=none; b=BQgdJED3kCpVz6TiSpCYvW3qrm8H0WmS4d0vVE6otWHebFhw7podwr7l+KQL+32yazVWqH Tbc4QudBJsICTv6X1CCHppBYvY7PqU5YJLBDIwQNPhNEVlTOUDlj7XfU0f1/SamEI7ZHGG Qtm9l21UjDVPG7bZq9hoBLN1IVo2FQDYuwVkbgyQvsFyLfxBz1bFbBgjWRoVLj25VNDZe/ RQOoL3rIcRzvXz5NZILinXeyolMUv0GfelgU/TN1cIYjXX++z1JVuZz/9NKHLJoFVZKB2J ughiD/Apo1YZoN61hEhjJ2QlYpAtmDWmBJkmJ1SMPHD+E/J1B40U3scCnvJa/g== 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=1774887338; 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=y6TDNf5vqQlkepVufqm5P4WB44/h8XH7bSMrOblId/8=; b=rSlXEv0PpZnDNgyuvLwKXFzYsNK1XyMc6DDNvNg1l+W2qkY+VW4GjPdKPMtLTMCKFMp8dI XstWmjIX+ScIrkl+EYtFXPnWEK1/g3aGE2cENvXaH5IggdS+2DwHWUzq1BWtFfuFvb+kd6 PF6+ZDWZ7RTK/yFtm96PpV6D7uMn6lNdvlrLc2CI2qTpLGSY9h/aJXiM7E3vnLhFQke1Ti H50HFM2QpfC3MjhpUS3zR7mWYzygmuGReX9VeweB8O1/P02B6CN7SDJB5T89NLnWl/xQmy xX7mkiOOCWEUV514vP4yoGXXbH/2x36mKUCl8HEa3Wpk0vuhzo2pntKPmEHWPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fkxDp06vYzqkZ for ; Mon, 30 Mar 2026 16:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c02d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 30 Mar 2026 16:15:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 81dbacbb7d71 - main - net/route: Add an eventhandler for rt_numfibs changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 81dbacbb7d71a53eef99ce73f7e589a165c3e1d6 Auto-Submitted: auto-generated Date: Mon, 30 Mar 2026 16:15:38 +0000 Message-Id: <69caa1aa.3c02d.318c3993@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81dbacbb7d71a53eef99ce73f7e589a165c3e1d6 commit 81dbacbb7d71a53eef99ce73f7e589a165c3e1d6 Author: Mark Johnston AuthorDate: 2026-03-30 13:30:19 +0000 Commit: Mark Johnston CommitDate: 2026-03-30 16:08:20 +0000 net/route: Add an eventhandler for rt_numfibs changes The multicast routing code will start implementing per-FIB routing tables. As a part of this, it needs to be notified when the number of FIBs changes, so that it can expand its tables. Add an eventhandler for this purpose. MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D55239 --- sys/net/route.h | 6 ++++++ sys/net/route/route_tables.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/net/route.h b/sys/net/route.h index 49bb7abd9726..34df3297d6d4 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -32,6 +32,9 @@ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ +#ifdef _KERNEL +#include +#endif #include /* @@ -124,6 +127,9 @@ VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ #define V_fib_hash_outbound VNET(fib_hash_outbound) VNET_DECLARE(u_int, fib_hash_outbound); +typedef void (*rtnumfibs_change_t)(void *, uint32_t); +EVENTHANDLER_DECLARE(rtnumfibs_change, rtnumfibs_change_t); + /* Outbound flowid generation rules */ #ifdef RSS #define fib4_calc_packet_hash xps_proto_software_hash_v4 diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 749ef063e125..571f1db9c40d 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -33,10 +33,10 @@ * Which is the new name for an in kernel routing (next hop) table. * ***********************************************************************/ -#include #include "opt_route.h" #include +#include #include #include #include @@ -268,6 +268,8 @@ grow_rtables(uint32_t num_tables) old_rt_tables = V_rt_tables; V_rt_tables = new_rt_tables; + EVENTHANDLER_INVOKE(rtnumfibs_change, num_tables); + /* Wait till all cpus see new pointers */ atomic_thread_fence_rel(); NET_EPOCH_WAIT();