From nobody Mon Oct 2 09:10:01 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 4RzZsk2DZjz4vplp; Mon, 2 Oct 2023 09:10:02 +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 4RzZsk1CJPz4PG4; Mon, 2 Oct 2023 09:10:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696237802; 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=Nk+Mji7ejtL42aBQCRxPf4BmeEp05g6PG5Ha/qn5W1k=; b=Pa+5lBZbUdmgFIdwPkww+e3QLGkIj3AqNDnp062p390sHpNAx3OuUfGSgfWI7tjL66yB1K GvXUq+IDUrgnAeMpdAI58eQqK9UbQgMgaBQyzybgbHM1OkQ57UujVY+HHoeG8k1RaFT/6I B1++JhHjFx1mtjdA29WWCOU0QxMvwRq1+AqWC+4dYgZwpbIObPn9RNxafdmbp2ySKRLFZb GVNhauqVyXTPizO/iGp9T4zjZ/Xwuphk41q4sacDd1rBxb22u577bbzx/KTyX8C64XRHYI 4c86FT0aJud4kqwm7BX6cI2TN485LZCviFni2Yo7c5BZ3dXieM92BB+9/hdTGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696237802; a=rsa-sha256; cv=none; b=C0D5cpARn6CBpzcP/8de8CJ+Zb0zIvQso371Tjjo9PlhZ80zZ8h+rswd1oKlWKLKlLNLID RmkshGc2UFyNiD5qBPIETtGsOXNqvqfkuzaIR2gCYNX0dIhxigeMSHJyGpl7iVw0cAk6eo yF+SgNC9p4J1KEFLfyRzAALJ3Y7P8+f/DDyohXNsa/Y7wjCSDBTw70qaRGhRuyUzrlknMs Z+BrVxOFytIuu04Tab5CgULZ4/ZZwAT4/Z590k8zF2UBolWxO4KXMYn07TiQHjA4fykKZE NsksN8soLUpWBiIK6CXA+l/Z2WHOQFnaZXuEfdWs+RZuDOBZ8Q6V8Jyk33Psjg== 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=1696237802; 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=Nk+Mji7ejtL42aBQCRxPf4BmeEp05g6PG5Ha/qn5W1k=; b=oNy2BOSC6+jo38GtexfbvU8NSlixuEMrY++esqJkqIYD9r97t8/XOkjuef6AT7SxRbYicd kEtAjU7GdJz/oa7r6cqfSytzgsYEF6yHd9aB1vH5lT1w8WGN8NOAgvs+SMReZD8Rcqduri s63C7jprnDtirw5dkAuXMdT8IF2lNy9/sxjAXWXZrZD4WlpyB70VCErPpxtHqKDu3pVJ0G lCQqOXUHjp1UNC7oLDCyr1P1sCEVTojPC9exAd5UZIAfeoCUsjTWaoxpuO1OYvrNKCJtvW t2r59776H3cgW11Uor57VgzE5rmVz7tSz7I5Lz2fb58bt4+X9LIgdONF1sC1Cw== 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 4RzZsk0FDBz15Rr; Mon, 2 Oct 2023 09:10:02 +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 3929A1Ms055861; Mon, 2 Oct 2023 09:10:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3929A1tv055857; Mon, 2 Oct 2023 09:10:01 GMT (envelope-from git) Date: Mon, 2 Oct 2023 09:10:01 GMT Message-Id: <202310020910.3929A1tv055857@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: 6a6202b4cc8c - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 6a6202b4cc8cff663c94a3f78a47d171cfe0938c Auto-Submitted: auto-generated The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6a6202b4cc8cff663c94a3f78a47d171cfe0938c commit 6a6202b4cc8cff663c94a3f78a47d171cfe0938c Author: Zhenlei Huang AuthorDate: 2023-09-27 16:23:22 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:55 +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 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) (cherry picked from commit ef3edef9ec8b7d19e5f66c385340604ab29ccc78) --- 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 92074670cf60..fb96a9ccdb43 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -163,7 +163,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); @@ -235,7 +237,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"); @@ -2876,18 +2878,12 @@ ip_mroute_modevent(module_t mod, int type, void *unused) MFC_LOCK_INIT(); VIF_LOCK_INIT(); - 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;