From nobody Tue Oct 03 03:37:26 2023 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 4S03RV4nqcz4vf26; Tue, 3 Oct 2023 03:37:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S03RV455pz4TlL; Tue, 3 Oct 2023 03:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696304246; 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=zCkG3EwHw0OAuoT6L+kxC+WFKd/fdwSeV0KNY0gOjX0=; b=dzKP/zfTrhqx0XS9KBkebWonMhgCQULzBdOBHKJZGiz9U7zHO39l1pFB1tUUaQ5cwKMUMG gI2egONJup21xBuxdxEbTtt2DSAkU6O/QWl2hxCB985XCKRqRha5cHBkDqekbm4GSan29C yFnUYsvJL5vfjF4A4dUQ3hBclvUEhXz9pNnmvETahtKDXhEf7qnWORdqJ+Z83kgyWw2mbu VIBIdrkJQ6TKRD6QA9dv/721xFxdlE/+EHdd83961DvS19NCZTpVd1eBWspgUyJkRZ+i9o iM2B0RX91OsBB0U5KRc06ILzINLfsbUmzdVcXnoekBpi71tDJpJLPsAoopo5gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696304246; a=rsa-sha256; cv=none; b=CsHHgnmO78ppsTiJFFVWq2mbgNHfA0xNFVWf67jJl7rpVUOzcet7V/1U3yddsRXmH1bDKz LXCaQ+AZ1rkCHdGUmwM51IGOFfE5amBdhxkkCd1vHizBqk9tYwQt4NyCB7d7jvOgNZdzvR jTJvY/4veP8BqD8FPIlz3LD980r9/Epb9CBuakNAM9TiD+kVfiLL+Q4vBafSaz4BdSRY96 R/mIRskXVndOa9a9y32Nh8Ag6Qf1qrM21mLBPlwf9OFAJOUiZnGb5sQWv+GklkkYnaAsK7 nLelX8NTK5yHATHsMLof7sdo0SnVC9E2O2YqfIG7cqyqzHV0u/leMiT9tM8PEQ== 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=1696304246; 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=zCkG3EwHw0OAuoT6L+kxC+WFKd/fdwSeV0KNY0gOjX0=; b=MUijPEVZTyeCzeO8SQW7FUedayu2tw/hRse/WxS9El3U8H1aut/yadZsu76RpsTqDxPHQn H0ImyxEbMzd9nLKM6ynBPACo+u1/q/dzBOykUffi9yFyoz2WuuJOCuR5Oi1bjMcKeWklD4 rGDfpneeOw3V6sJdx82v3Iybd5w2Vjg2+5Nsi/rTdSfIQGDgoT+9uuXOVn9SxmV5DsJSQI VrDMuVaB3H4k22LV5/QSswSfl4aXPQUPTIfodjNpvRBBJAiNE8UTBpeVi4afUL3dUl+zKP pWmbQ2PEzTp5JNsbdyKsDkmec1pqK9NxANRwSF/Jb/G7XD2mBVpX960tdqndgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S03RV37XxzfVK; Tue, 3 Oct 2023 03:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3933bQ67003125; Tue, 3 Oct 2023 03:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3933bQ68003122; Tue, 3 Oct 2023 03:37:26 GMT (envelope-from git) Date: Tue, 3 Oct 2023 03:37:26 GMT Message-Id: <202310030337.3933bQ68003122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ea3e5ee58560 - releng/14.0 - ip_mroute: Fix sysctl knobs 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: ea3e5ee5856008ea469fe4e90d231a36d5b432b5 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3e5ee5856008ea469fe4e90d231a36d5b432b5 commit ea3e5ee5856008ea469fe4e90d231a36d5b432b5 Author: Zhenlei Huang AuthorDate: 2023-09-27 16:23:22 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 +0000 ip_mroute: Fix sysctl knobs The loader tunable `net.inet.ip.mfchashsize` does not have corresponding sysctl MIB entry. Just add it. While here, the sysctl variable `net.inet.pim.squelch_wholepkt` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. Reviewed by: kp Approved by: re (gjb) Fixes: 443fc3176dee Introduce a number of changes to the MROUTING code MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41997 (cherry picked from commit f549e22901b3a391c76659bee55802b1214112fd) (cherry picked from commit b0f026435a150933ecb6f2d1359fd1b4898657f1) --- sys/netinet/ip_mroute.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 2444fd9686f7..cda5f160e8fb 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -172,7 +172,9 @@ VNET_DEFINE_STATIC(u_long, mfchash); ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & V_mfchash) #define MFCHASHSIZE 256 -static u_long mfchashsize; /* Hash size */ +static u_long mfchashsize = MFCHASHSIZE; /* Hash size */ +SYSCTL_ULONG(_net_inet_ip, OID_AUTO, mfchashsize, CTLFLAG_RDTUN, + &mfchashsize, 0, "IPv4 Multicast Forwarding Table hash size"); VNET_DEFINE_STATIC(u_char *, nexpire); /* 0..mfchashsize-1 */ #define V_nexpire VNET(nexpire) VNET_DEFINE_STATIC(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); @@ -226,7 +228,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_pim, PIMCTL_STATS, stats, struct pimstat, pimstat, "PIM Statistics (struct pimstat, netinet/pim_var.h)"); static u_long pim_squelch_wholepkt = 0; -SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW, +SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RWTUN, &pim_squelch_wholepkt, 0, "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified"); @@ -2817,18 +2819,12 @@ ip_mroute_modevent(module_t mod, int type, void *unused) return (EINVAL); } - mfchashsize = MFCHASHSIZE; - if (TUNABLE_ULONG_FETCH("net.inet.ip.mfchashsize", &mfchashsize) && - !powerof2(mfchashsize)) { + if (!powerof2(mfchashsize)) { printf("WARNING: %s not a power of 2; using default\n", "net.inet.ip.mfchashsize"); mfchashsize = MFCHASHSIZE; } - pim_squelch_wholepkt = 0; - TUNABLE_ULONG_FETCH("net.inet.pim.squelch_wholepkt", - &pim_squelch_wholepkt); - pim_encap_cookie = ip_encap_attach(&ipv4_encap_cfg, NULL, M_WAITOK); ip_mcast_src = X_ip_mcast_src;