git: f549e22901b3 - main - ip_mroute: Fix sysctl knobs
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f549e22901b3a391c76659bee55802b1214112fd commit f549e22901b3a391c76659bee55802b1214112fd Author: Zhenlei Huang AuthorDate: 2023-09-27 16:23:22 + Commit: Zhenlei Huang CommitDate: 2023-09-27 16:23:22 + 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 --- 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) #defineMFCHASHSIZE 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 */ #defineV_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;
git: 12349f38898f - main - ipfw.8: Adjust section for loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=12349f38898f231ca803dcf526bac88cb1b5cd2b commit 12349f38898f231ca803dcf526bac88cb1b5cd2b Author: Zhenlei Huang AuthorDate: 2023-09-28 04:58:44 + Commit: Zhenlei Huang CommitDate: 2023-09-28 04:58:44 + ipfw.8: Adjust section for loader tunables Move the descriptions of loader tunables from section 'SYSCTL VARIABLES' to section 'LOADER TUNABLES'. See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables). MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D41981 --- sbin/ipfw/ipfw.8 | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 1a042ae2bbbf..e62b8d6efc95 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd April 25, 2023 +.Dd September 28, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3761,6 +3761,16 @@ or .Xr kenv 1 before ipfw module gets loaded. .Bl -tag -width indent +.It Va net.inet.ip.fw.enable : No 1 +Enables the firewall. +Setting this variable to 0 lets you run your machine without +firewall even if compiled in. +.It Va net.inet6.ip6.fw.enable : No 1 +provides the same functionality as above for the IPv6 case. +.It Va net.link.ether.ipfw : No 0 +Controls whether layer2 packets are passed to +.Nm . +Default is no. .It Va net.inet.ip.fw.default_to_accept : No 0 Defines ipfw last rule behavior. This value overrides @@ -4154,12 +4164,6 @@ Keep dynamic states on rule/set deletion. States are relinked to default rule (65535). This can be handly for ruleset reload. Turned off by default. -.It Va net.inet.ip.fw.enable : No 1 -Enables the firewall. -Setting this variable to 0 lets you run your machine without -firewall even if compiled in. -.It Va net.inet6.ip6.fw.enable : No 1 -provides the same functionality as above for the IPv6 case. .It Va net.inet.ip.fw.one_pass : No 1 When set, the packet exiting from the .Nm dummynet @@ -4176,10 +4180,6 @@ Enables verbose messages. Limits the number of messages produced by a verbose firewall. .It Va net.inet6.ip6.fw.deny_unknown_exthdrs : No 1 If enabled packets with unknown IPv6 Extension Headers will be denied. -.It Va net.link.ether.ipfw : No 0 -Controls whether layer2 packets are passed to -.Nm . -Default is no. .It Va net.link.bridge.ipfw : No 0 Controls whether bridged packets are passed to .Nm .
git: ba883e7a5ac4 - main - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e Author: Zhenlei Huang AuthorDate: 2023-09-29 00:01:43 + Commit: Zhenlei Huang CommitDate: 2023-09-29 00:01:44 + ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.inet.ipf.large_nat` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:cy (for #network) Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42005 --- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index 35daad4715bf..69be4abb2485 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -134,7 +134,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include
git: bffb01eda9bf - stable/14 - rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bffb01eda9bffc3307ea8bf70f91087ed316e01c commit bffb01eda9bffc3307ea8bf70f91087ed316e01c Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:46 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:37 + rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.route.netisr_maxqlen` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62) --- sys/net/rtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 1a83fc2d8abe..019b9e80291c 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -241,7 +241,7 @@ sysctl_route_netisr_maxqlen(SYSCTL_HANDLER_ARGS) return (netisr_setqlimit(&rtsock_nh, qlimit)); } SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_route_netisr_maxqlen, "I", "maximum routing socket dispatch queue length");
git: da2b630c12ec - stable/14 - netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=da2b630c12ec074673dfc646b2055a31b0d8d6d9 commit da2b630c12ec074673dfc646b2055a31b0d8d6d9 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:37 + netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet6.ip6.auto_linklocal 2. net.inet6.ip6.accept_rtadv 3. net.inet6.ip6.no_radr No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66) --- sys/netinet6/in6_proto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1d67577f8055..6e7ffedc3dcd 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -278,10 +278,10 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 RA messages"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " "default router list"); @@ -334,7 +334,7 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, "Restrict AF_INET6 sockets to IPv6 addresses only"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_auto_linklocal), 0, "Default value of per-interface flag for automatically adding an IPv6 " "link-local address to interfaces when attached"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats,
git: f5f6da90597c - stable/14 - ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f5f6da90597cb65ce55c4f17718a200097f6f78f commit f5f6da90597cb65ce55c4f17718a200097f6f78f Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:37 + ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.ip.fw.enable 2. net.inet6.ip6.fw.enable 3. net.link.ether.ipfw No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d) --- sys/netpfil/ipfw/ip_fw_pfil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index 1cfff1870d7f..4dae28aa0544 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -91,20 +91,20 @@ SYSBEGIN(f1) SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6_fw); SYSCTL_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", "Enable ipfw+6"); #endif /* INET6 */ SYSCTL_DECL(_net_link_ether); SYSCTL_PROC(_net_link_ether, OID_AUTO, ipfw, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", "Pass ether pkts through firewall");
git: bb6f9a95402a - stable/14 - ipfw.8: Adjust section for loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bb6f9a95402a6c3ab8167481b81465f8ad5016fc commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc Author: Zhenlei Huang AuthorDate: 2023-09-28 04:58:44 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:38 + ipfw.8: Adjust section for loader tunables Move the descriptions of loader tunables from section 'SYSCTL VARIABLES' to section 'LOADER TUNABLES'. See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables). MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D41981 (cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b) --- sbin/ipfw/ipfw.8 | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 1a042ae2bbbf..e62b8d6efc95 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd April 25, 2023 +.Dd September 28, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3761,6 +3761,16 @@ or .Xr kenv 1 before ipfw module gets loaded. .Bl -tag -width indent +.It Va net.inet.ip.fw.enable : No 1 +Enables the firewall. +Setting this variable to 0 lets you run your machine without +firewall even if compiled in. +.It Va net.inet6.ip6.fw.enable : No 1 +provides the same functionality as above for the IPv6 case. +.It Va net.link.ether.ipfw : No 0 +Controls whether layer2 packets are passed to +.Nm . +Default is no. .It Va net.inet.ip.fw.default_to_accept : No 0 Defines ipfw last rule behavior. This value overrides @@ -4154,12 +4164,6 @@ Keep dynamic states on rule/set deletion. States are relinked to default rule (65535). This can be handly for ruleset reload. Turned off by default. -.It Va net.inet.ip.fw.enable : No 1 -Enables the firewall. -Setting this variable to 0 lets you run your machine without -firewall even if compiled in. -.It Va net.inet6.ip6.fw.enable : No 1 -provides the same functionality as above for the IPv6 case. .It Va net.inet.ip.fw.one_pass : No 1 When set, the packet exiting from the .Nm dummynet @@ -4176,10 +4180,6 @@ Enables verbose messages. Limits the number of messages produced by a verbose firewall. .It Va net.inet6.ip6.fw.deny_unknown_exthdrs : No 1 If enabled packets with unknown IPv6 Extension Headers will be denied. -.It Va net.link.ether.ipfw : No 0 -Controls whether layer2 packets are passed to -.Nm . -Default is no. .It Va net.link.bridge.ipfw : No 0 Controls whether bridged packets are passed to .Nm .
git: b0f026435a15 - stable/14 - ip_mroute: Fix sysctl knobs
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b0f026435a150933ecb6f2d1359fd1b4898657f1 commit b0f026435a150933ecb6f2d1359fd1b4898657f1 Author: Zhenlei Huang AuthorDate: 2023-09-27 16:23:22 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:38 + 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) --- 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) #defineMFCHASHSIZE 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 */ #defineV_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;
git: a9359dcde241 - stable/14 - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a9359dcde241f17421a71bc8c96dee08625db9dd commit a9359dcde241f17421a71bc8c96dee08625db9dd Author: Zhenlei Huang AuthorDate: 2023-09-29 00:01:43 + Commit: Zhenlei Huang CommitDate: 2023-10-02 00:49:38 + ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.inet.ipf.large_nat` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:cy (for #network) Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42005 (cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e) --- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index 35daad4715bf..69be4abb2485 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -134,7 +134,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include
git: c6afda2e5a03 - stable/13 - rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c6afda2e5a0389ce293d3a3ced2889979aa2e442 commit c6afda2e5a0389ce293d3a3ced2889979aa2e442 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:46 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:22 + rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.route.netisr_maxqlen` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62) (cherry picked from commit bffb01eda9bffc3307ea8bf70f91087ed316e01c) --- sys/net/rtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index d89d661ca99b..4da7e9e74025 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -231,7 +231,7 @@ sysctl_route_netisr_maxqlen(SYSCTL_HANDLER_ARGS) return (netisr_setqlimit(&rtsock_nh, qlimit)); } SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_route_netisr_maxqlen, "I", "maximum routing socket dispatch queue length");
git: 28a80239fd6a - stable/13 - netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=28a80239fd6ab2ff79af5a2b19e349fa6f1d62e9 commit 28a80239fd6ab2ff79af5a2b19e349fa6f1d62e9 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:22 + netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet6.ip6.auto_linklocal 2. net.inet6.ip6.accept_rtadv 3. net.inet6.ip6.no_radr No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66) (cherry picked from commit da2b630c12ec074673dfc646b2055a31b0d8d6d9) --- sys/netinet6/in6_proto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 4a92fff14e68..cfa368e7f7b0 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -482,10 +482,10 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 RA messages"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " "default router list"); @@ -538,7 +538,7 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, "Restrict AF_INET6 sockets to IPv6 addresses only"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_auto_linklocal), 0, "Default value of per-interface flag for automatically adding an IPv6 " "link-local address to interfaces when attached"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats,
git: 09f08dbe248e - stable/13 - ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09f08dbe248e6ffd031c1eff26aeacef0c6880e9 commit 09f08dbe248e6ffd031c1eff26aeacef0c6880e9 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:23 + ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.ip.fw.enable 2. net.inet6.ip6.fw.enable 3. net.link.ether.ipfw No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d) (cherry picked from commit f5f6da90597cb65ce55c4f17718a200097f6f78f) --- sys/netpfil/ipfw/ip_fw_pfil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index db898c97f504..9a7ecd506fc3 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -91,20 +91,20 @@ SYSBEGIN(f1) SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6_fw); SYSCTL_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", "Enable ipfw+6"); #endif /* INET6 */ SYSCTL_DECL(_net_link_ether); SYSCTL_PROC(_net_link_ether, OID_AUTO, ipfw, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", "Pass ether pkts through firewall");
git: e31a331ddda6 - stable/13 - ipfw.8: Adjust section for loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e31a331ddda6ffcb711bb950794be5d53e537e2a commit e31a331ddda6ffcb711bb950794be5d53e537e2a Author: Zhenlei Huang AuthorDate: 2023-09-28 04:58:44 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:23 + ipfw.8: Adjust section for loader tunables Move the descriptions of loader tunables from section 'SYSCTL VARIABLES' to section 'LOADER TUNABLES'. See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables). MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D41981 (cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b) (cherry picked from commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc) --- sbin/ipfw/ipfw.8 | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index efc338d40007..4a9ded2b9867 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd April 25, 2023 +.Dd September 28, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3713,6 +3713,16 @@ or .Xr kenv 1 before ipfw module gets loaded. .Bl -tag -width indent +.It Va net.inet.ip.fw.enable : No 1 +Enables the firewall. +Setting this variable to 0 lets you run your machine without +firewall even if compiled in. +.It Va net.inet6.ip6.fw.enable : No 1 +provides the same functionality as above for the IPv6 case. +.It Va net.link.ether.ipfw : No 0 +Controls whether layer2 packets are passed to +.Nm . +Default is no. .It Va net.inet.ip.fw.default_to_accept : No 0 Defines ipfw last rule behavior. This value overrides @@ -4106,12 +4116,6 @@ Keep dynamic states on rule/set deletion. States are relinked to default rule (65535). This can be handly for ruleset reload. Turned off by default. -.It Va net.inet.ip.fw.enable : No 1 -Enables the firewall. -Setting this variable to 0 lets you run your machine without -firewall even if compiled in. -.It Va net.inet6.ip6.fw.enable : No 1 -provides the same functionality as above for the IPv6 case. .It Va net.inet.ip.fw.one_pass : No 1 When set, the packet exiting from the .Nm dummynet @@ -4128,10 +4132,6 @@ Enables verbose messages. Limits the number of messages produced by a verbose firewall. .It Va net.inet6.ip6.fw.deny_unknown_exthdrs : No 1 If enabled packets with unknown IPv6 Extension Headers will be denied. -.It Va net.link.ether.ipfw : No 0 -Controls whether layer2 packets are passed to -.Nm . -Default is no. .It Va net.link.bridge.ipfw : No 0 Controls whether bridged packets are passed to .Nm .
git: ef3edef9ec8b - stable/13 - ip_mroute: Fix sysctl knobs
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ef3edef9ec8b7d19e5f66c385340604ab29ccc78 commit ef3edef9ec8b7d19e5f66c385340604ab29ccc78 Author: Zhenlei Huang AuthorDate: 2023-09-27 16:23:22 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:23 + 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) --- 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 d8c5c74231ec..ca510610e4e7 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -161,7 +161,9 @@ VNET_DEFINE_STATIC(u_long, mfchash); ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & V_mfchash) #defineMFCHASHSIZE 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 */ #defineV_nexpire VNET(nexpire) VNET_DEFINE_STATIC(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); @@ -234,7 +236,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;
git: 25c371dc559a - stable/13 - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=25c371dc559a9ea23905baa5cbfed3f6d9d6eb5c commit 25c371dc559a9ea23905baa5cbfed3f6d9d6eb5c Author: Zhenlei Huang AuthorDate: 2023-09-29 00:01:43 + Commit: Zhenlei Huang CommitDate: 2023-10-02 08:28:23 + ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.inet.ipf.large_nat` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:cy (for #network) Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42005 (cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e) (cherry picked from commit a9359dcde241f17421a71bc8c96dee08625db9dd) --- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index fcd7a94575e6..a2f1b5070818 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -134,7 +134,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include
git: 453abc9f3a3e - stable/12 - rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=453abc9f3a3e1a305e49cbf425122352a15055fd commit 453abc9f3a3e1a305e49cbf425122352a15055fd Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:46 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:54 + rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.route.netisr_maxqlen` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62) (cherry picked from commit bffb01eda9bffc3307ea8bf70f91087ed316e01c) (cherry picked from commit c6afda2e5a0389ce293d3a3ced2889979aa2e442) --- sys/net/rtsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 8009ec5dd0a2..aa2f7422d6ce 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -196,7 +196,8 @@ sysctl_route_netisr_maxqlen(SYSCTL_HANDLER_ARGS) return (EINVAL); return (netisr_setqlimit(&rtsock_nh, qlimit)); } -SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, 0, 0, sysctl_route_netisr_maxqlen, "I", "maximum routing socket dispatch queue length");
git: 2d43654e6aa8 - stable/12 - netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2d43654e6aa8215dff11e5249bdb3518ed0fbdbd commit 2d43654e6aa8215dff11e5249bdb3518ed0fbdbd Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:54 + netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet6.ip6.auto_linklocal 2. net.inet6.ip6.accept_rtadv 3. net.inet6.ip6.no_radr No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66) (cherry picked from commit da2b630c12ec074673dfc646b2055a31b0d8d6d9) (cherry picked from commit 28a80239fd6ab2ff79af5a2b19e349fa6f1d62e9) --- sys/netinet6/in6_proto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 43d99e484fb8..b8895b4aa442 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -492,10 +492,10 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 RA messages"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " "default router list"); @@ -548,7 +548,7 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, "Restrict AF_INET6 sockets to IPv6 addresses only"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_auto_linklocal), 0, "Default value of per-interface flag for automatically adding an IPv6 " "link-local address to interfaces when attached"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats,
git: 8d6188b13156 - stable/12 - ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8d6188b13156a4b88f7bf230eb0ef8bf38bad551 commit 8d6188b13156a4b88f7bf230eb0ef8bf38bad551 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:54 + ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.ip.fw.enable 2. net.inet6.ip6.fw.enable 3. net.link.ether.ipfw No functional change intended. Reviewed by:glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d) (cherry picked from commit f5f6da90597cb65ce55c4f17718a200097f6f78f) (cherry picked from commit 09f08dbe248e6ffd031c1eff26aeacef0c6880e9) --- sys/netpfil/ipfw/ip_fw_pfil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index ca8a9aa1ba13..084be4a60f05 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -96,18 +96,18 @@ SYSBEGIN(f1) SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6_fw); SYSCTL_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", "Enable ipfw+6"); #endif /* INET6 */ SYSCTL_DECL(_net_link_ether); SYSCTL_PROC(_net_link_ether, OID_AUTO, ipfw, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3, &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", "Pass ether pkts through firewall");
git: 6b8183c70caa - stable/12 - ipfw.8: Adjust section for loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6b8183c70caaa4c8b29e8528d86ff99616da4d47 commit 6b8183c70caaa4c8b29e8528d86ff99616da4d47 Author: Zhenlei Huang AuthorDate: 2023-09-28 04:58:44 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:55 + ipfw.8: Adjust section for loader tunables Move the descriptions of loader tunables from section 'SYSCTL VARIABLES' to section 'LOADER TUNABLES'. See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables). MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D41981 (cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b) (cherry picked from commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc) (cherry picked from commit e31a331ddda6ffcb711bb950794be5d53e537e2a) --- sbin/ipfw/ipfw.8 | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 512ad5baf90e..cdf9cc29fe3b 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2023 +.Dd September 28, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3683,6 +3683,16 @@ or .Xr kenv 1 before ipfw module gets loaded. .Bl -tag -width indent +.It Va net.inet.ip.fw.enable : No 1 +Enables the firewall. +Setting this variable to 0 lets you run your machine without +firewall even if compiled in. +.It Va net.inet6.ip6.fw.enable : No 1 +provides the same functionality as above for the IPv6 case. +.It Va net.link.ether.ipfw : No 0 +Controls whether layer2 packets are passed to +.Nm . +Default is no. .It Va net.inet.ip.fw.default_to_accept : No 0 Defines ipfw last rule behavior. This value overrides @@ -4076,12 +4086,6 @@ Keep dynamic states on rule/set deletion. States are relinked to default rule (65535). This can be handly for ruleset reload. Turned off by default. -.It Va net.inet.ip.fw.enable : No 1 -Enables the firewall. -Setting this variable to 0 lets you run your machine without -firewall even if compiled in. -.It Va net.inet6.ip6.fw.enable : No 1 -provides the same functionality as above for the IPv6 case. .It Va net.inet.ip.fw.one_pass : No 1 When set, the packet exiting from the .Nm dummynet @@ -4098,10 +4102,6 @@ Enables verbose messages. Limits the number of messages produced by a verbose firewall. .It Va net.inet6.ip6.fw.deny_unknown_exthdrs : No 1 If enabled packets with unknown IPv6 Extension Headers will be denied. -.It Va net.link.ether.ipfw : No 0 -Controls whether layer2 packets are passed to -.Nm . -Default is no. .It Va net.link.bridge.ipfw : No 0 Controls whether bridged packets are passed to .Nm .
git: 6a6202b4cc8c - stable/12 - ip_mroute: Fix sysctl knobs
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 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:55 + 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) #defineMFCHASHSIZE 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 */ #defineV_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;
git: 3f44d7870593 - stable/12 - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3f44d7870593bc7fd116a27310138646a00d3fff commit 3f44d7870593bc7fd116a27310138646a00d3fff Author: Zhenlei Huang AuthorDate: 2023-09-29 00:01:43 + Commit: Zhenlei Huang CommitDate: 2023-10-02 09:08:55 + ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.inet.ipf.large_nat` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:cy (for #network) Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42005 (cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e) (cherry picked from commit a9359dcde241f17421a71bc8c96dee08625db9dd) (cherry picked from commit 25c371dc559a9ea23905baa5cbfed3f6d9d6eb5c) --- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index 0b37dab558aa..33153cca246e 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -131,7 +131,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include
Re: git: a9359dcde241 - stable/14 - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
> On Oct 2, 2023, at 10:53 AM, Cy Schubert wrote: > > In message <202310020050.3920omhh029...@gitrepo.freebsd.org>, Zhenlei Huang > wri > tes: >> The branch stable/14 has been updated by zlei: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=a9359dcde241f17421a71bc8c96dee08 >> 625db9dd >> >> commit a9359dcde241f17421a71bc8c96dee08625db9dd >> Author: Zhenlei Huang >> AuthorDate: 2023-09-29 00:01:43 + >> Commit: Zhenlei Huang >> CommitDate: 2023-10-02 00:49:38 + >> >>ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable >> >>The sysctl variable `net.inet.ipf.large_nat` is actually a loader >>tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will >>report it correctly. >> >>No functional change intended. >> >>Reviewed by:cy (for #network) >>Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable >>MFC after: 3 days >>Differential Revision: https://reviews.freebsd.org/D42005 >> >>(cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e) >> --- >> sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/n >> etinet/mlfk_ipl.c >> index 35daad4715bf..69be4abb2485 100644 >> --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c >> +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c >> @@ -134,7 +134,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_R >> D, >> &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); >> SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmai >> n.ipf_chksrc), 0, ""); >> SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmai >> n.ipf_minttl), 0, ""); >> -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmai >> n.ipf_large_nat), 0, "large_nat"); >> +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFET >> CH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); >> >> #define CDEV_MAJOR 79 >> #include >> > > Can you also please MFC to stable/13 and 12? Done! Well, I just have a ( long ) break after MFCing to stable/14 ;) > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > > > X-BĶ
git: 535c90cdbcd9 - releng/14.0 - rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=535c90cdbcd9eed3e0e46ad90a886ac6d0e53386 commit 535c90cdbcd9eed3e0e46ad90a886ac6d0e53386 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:46 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 + rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.route.netisr_maxqlen` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:glebius Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62) (cherry picked from commit bffb01eda9bffc3307ea8bf70f91087ed316e01c) --- sys/net/rtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 1a83fc2d8abe..019b9e80291c 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -241,7 +241,7 @@ sysctl_route_netisr_maxqlen(SYSCTL_HANDLER_ARGS) return (netisr_setqlimit(&rtsock_nh, qlimit)); } SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_route_netisr_maxqlen, "I", "maximum routing socket dispatch queue length");
git: abd4f7d8bc57 - releng/14.0 - netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=abd4f7d8bc57249b6d09be253411aecb26095d0f commit abd4f7d8bc57249b6d09be253411aecb26095d0f Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 + netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet6.ip6.auto_linklocal 2. net.inet6.ip6.accept_rtadv 3. net.inet6.ip6.no_radr No functional change intended. Reviewed by:glebius Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66) (cherry picked from commit da2b630c12ec074673dfc646b2055a31b0d8d6d9) --- sys/netinet6/in6_proto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1d67577f8055..6e7ffedc3dcd 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -278,10 +278,10 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 RA messages"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " "default router list"); @@ -334,7 +334,7 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, "Restrict AF_INET6 sockets to IPv6 addresses only"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, + CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_auto_linklocal), 0, "Default value of per-interface flag for automatically adding an IPv6 " "link-local address to interfaces when attached"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats,
git: e19407fe9a63 - releng/14.0 - ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e19407fe9a63a16a5e8c6a0ad94e325d5289d301 commit e19407fe9a63a16a5e8c6a0ad94e325d5289d301 Author: Zhenlei Huang AuthorDate: 2023-09-25 10:10:47 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 + ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.ip.fw.enable 2. net.inet6.ip6.fw.enable 3. net.link.ether.ipfw No functional change intended. Reviewed by:glebius Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41928 (cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d) (cherry picked from commit f5f6da90597cb65ce55c4f17718a200097f6f78f) --- sys/netpfil/ipfw/ip_fw_pfil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index 1cfff1870d7f..4dae28aa0544 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -91,20 +91,20 @@ SYSBEGIN(f1) SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6_fw); SYSCTL_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", "Enable ipfw+6"); #endif /* INET6 */ SYSCTL_DECL(_net_link_ether); SYSCTL_PROC(_net_link_ether, OID_AUTO, ipfw, -CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | +CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_SECURE3 | CTLFLAG_NEEDGIANT, &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", "Pass ether pkts through firewall");
git: cc30510aeb78 - releng/14.0 - ipfw.8: Adjust section for loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cc30510aeb78d6013dfa9c137144543c2db0e4c8 commit cc30510aeb78d6013dfa9c137144543c2db0e4c8 Author: Zhenlei Huang AuthorDate: 2023-09-28 04:58:44 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 + ipfw.8: Adjust section for loader tunables Move the descriptions of loader tunables from section 'SYSCTL VARIABLES' to section 'LOADER TUNABLES'. See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables). MFC after: 2 days Approved by:re (gjb) Differential Revision: https://reviews.freebsd.org/D41981 (cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b) (cherry picked from commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc) --- sbin/ipfw/ipfw.8 | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 1a042ae2bbbf..e62b8d6efc95 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd April 25, 2023 +.Dd September 28, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3761,6 +3761,16 @@ or .Xr kenv 1 before ipfw module gets loaded. .Bl -tag -width indent +.It Va net.inet.ip.fw.enable : No 1 +Enables the firewall. +Setting this variable to 0 lets you run your machine without +firewall even if compiled in. +.It Va net.inet6.ip6.fw.enable : No 1 +provides the same functionality as above for the IPv6 case. +.It Va net.link.ether.ipfw : No 0 +Controls whether layer2 packets are passed to +.Nm . +Default is no. .It Va net.inet.ip.fw.default_to_accept : No 0 Defines ipfw last rule behavior. This value overrides @@ -4154,12 +4164,6 @@ Keep dynamic states on rule/set deletion. States are relinked to default rule (65535). This can be handly for ruleset reload. Turned off by default. -.It Va net.inet.ip.fw.enable : No 1 -Enables the firewall. -Setting this variable to 0 lets you run your machine without -firewall even if compiled in. -.It Va net.inet6.ip6.fw.enable : No 1 -provides the same functionality as above for the IPv6 case. .It Va net.inet.ip.fw.one_pass : No 1 When set, the packet exiting from the .Nm dummynet @@ -4176,10 +4180,6 @@ Enables verbose messages. Limits the number of messages produced by a verbose firewall. .It Va net.inet6.ip6.fw.deny_unknown_exthdrs : No 1 If enabled packets with unknown IPv6 Extension Headers will be denied. -.It Va net.link.ether.ipfw : No 0 -Controls whether layer2 packets are passed to -.Nm . -Default is no. .It Va net.link.bridge.ipfw : No 0 Controls whether bridged packets are passed to .Nm .
git: ea3e5ee58560 - releng/14.0 - ip_mroute: Fix sysctl knobs
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 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:16 + 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) #defineMFCHASHSIZE 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 */ #defineV_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;
git: c920810743c6 - releng/14.0 - ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c920810743c6de1f1d78936726af29752e7a0095 commit c920810743c6de1f1d78936726af29752e7a0095 Author: Zhenlei Huang AuthorDate: 2023-09-29 00:01:43 + Commit: Zhenlei Huang CommitDate: 2023-10-03 03:34:17 + ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable `net.inet.ipf.large_nat` is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:cy (for #network) Approved by:re (gjb) Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42005 (cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e) (cherry picked from commit a9359dcde241f17421a71bc8c96dee08625db9dd) --- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index 35daad4715bf..69be4abb2485 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -134,7 +134,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include
git: 38ecc80b2a4e - main - tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize'
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=38ecc80b2a4e5e11ece83ca4df63632f0b6fa394 commit 38ecc80b2a4e5e11ece83ca4df63632f0b6fa394 Author: Zhenlei Huang AuthorDate: 2023-10-08 10:03:59 + Commit: Zhenlei Huang CommitDate: 2023-10-08 10:03:59 + tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize' No functional change intended. Reviewed by:cc, rscheff, #transport MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41998 --- sys/netinet/tcp_subr.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 696bd40f7ada..27b0eae83837 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -305,8 +305,17 @@ static int tcp_log_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); -static int tcp_tcbhashsize; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +/* + * Target size of TCP PCB hash tables. Must be a power of two. + * + * Note that this can be overridden by the kernel environment + * variable net.inet.tcp.tcbhashsize + */ +#ifndef TCBHASHSIZE +#define TCBHASHSIZE0 +#endif +static int tcp_tcbhashsize = TCBHASHSIZE; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); static int do_tcpdrain = 1; @@ -1152,16 +1161,6 @@ tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged) return; } -/* - * Target size of TCP PCB hash tables. Must be a power of two. - * - * Note that this can be overridden by the kernel environment - * variable net.inet.tcp.tcbhashsize - */ -#ifndef TCBHASHSIZE -#define TCBHASHSIZE0 -#endif - MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); MALLOC_DEFINE(M_TCPFUNCTIONS, "tcpfunc", "TCP function set memory"); @@ -1508,7 +1507,6 @@ VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, static void tcp_init(void *arg __unused) { - const char *tcbhash_tuneable; int hashsize; tcp_reass_global_init(); @@ -1576,9 +1574,7 @@ tcp_init(void *arg __unused) tcp_pcap_init(); #endif - hashsize = TCBHASHSIZE; - tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; - TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); + hashsize = tcp_tcbhashsize; if (hashsize == 0) { /* * Auto tune the hash size based on maxsockets. @@ -1595,7 +1591,7 @@ tcp_init(void *arg __unused) hashsize = 512; if (bootverbose) printf("%s: %s auto tuned to %d\n", __func__, - tcbhash_tuneable, hashsize); + "net.inet.tcp.tcbhashsize", hashsize); } /* * We require a hashsize to be a power of two.
git: dac91eb76603 - main - sctp: Various fixes for loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=dac91eb7660324677d8a2f71bd6f192422355ba1 commit dac91eb7660324677d8a2f71bd6f192422355ba1 Author: Zhenlei Huang AuthorDate: 2023-10-09 04:36:48 + Commit: Zhenlei Huang CommitDate: 2023-10-09 04:36:48 + sctp: Various fixes for loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.sctp.tcbhashsize 2. net.inet.sctp.pcbhashsize 3. net.inet.sctp.chunkscale The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale' are only used during vnet initializing, thus it make no senses to make them writable tunable. Validate the values of loader tunables on vnet initialize, reset them to theirs defaults if invalid to prevent potential kernel panics. Reviewed by:tuexen, #transport, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42007 --- sys/netinet/sctp_pcb.c| 8 sys/netinet/sctp_sysctl.c | 24 ++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 16cde18c4c1d..a1742b2fffca 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5676,6 +5676,11 @@ sctp_startup_mcore_threads(void) } #endif +#define VALIDATE_LOADER_TUNABLE(var_name, prefix) \ + if (SCTP_BASE_SYSCTL(var_name) < prefix##_MIN ||\ + SCTP_BASE_SYSCTL(var_name) > prefix##_MAX) \ + SCTP_BASE_SYSCTL(var_name) = prefix##_DEFAULT + void sctp_pcb_init(void) { @@ -5717,6 +5722,9 @@ sctp_pcb_init(void) TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.pcbhashsize", &SCTP_BASE_SYSCTL(sctp_pcbtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.chunkscale", &SCTP_BASE_SYSCTL(sctp_chunkscale)); + VALIDATE_LOADER_TUNABLE(sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_chunkscale, SCTPCTL_CHUNKSCALE); SCTP_BASE_INFO(sctp_asochash) = SCTP_HASH_INIT((SCTP_BASE_SYSCTL(sctp_hashtblsize) * 31), &SCTP_BASE_INFO(hashasocmark)); SCTP_BASE_INFO(sctp_ephash) = SCTP_HASH_INIT(SCTP_BASE_SYSCTL(sctp_hashtblsize), diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 851ed408092b..2c2cc58ee086 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -867,6 +867,14 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #endif #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + +#define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + +#define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ sctp_sysctl_handle_##mib_name(SYSCTL_HANDLER_ARGS) \ { \ @@ -885,9 +893,13 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, \ -CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, NULL, 0, \ -sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ + NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + +#define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ + SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ + CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); /* * sysctl definitions @@ -909,10 +921,10 @@ SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS) -SCTP_UINT_SYSCTL(tcbhashsize, sctp_hasht
git: e2ad7ce37b1a - main - cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d commit e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:21 + cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp (for #cam) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/cam/scsi/scsi_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 985547b7ce20..0e42403d74a6 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9406,7 +9406,8 @@ sysctl_scsi_delay(SYSCTL_HANDLER_ARGS) return (set_scsi_delay(delay)); } SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_scsi_delay, "I", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)"); static int
git: 0eb2e197896e - main - ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0eb2e197896e2ec8a45730b61eeb77d5431af69f commit 0eb2e197896e2ec8a45730b61eeb77d5431af69f Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:21 + ddb: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/ddb/db_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ddb/db_capture.c b/sys/ddb/db_capture.c index 98c6e806187a..b4e598bf45cc 100644 --- a/sys/ddb/db_capture.c +++ b/sys/ddb/db_capture.c @@ -165,8 +165,8 @@ sysctl_debug_ddb_capture_bufsize(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, -sysctl_debug_ddb_capture_bufsize, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer"); /*
git: 95c01e9b3294 - main - nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=95c01e9b329406699e89907167b5c3c9effbcbca commit 95c01e9b329406699e89907167b5c3c9effbcbca Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:21 + nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/fs/nfsclient/nfs_clnfsiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 5dc1d5643591..f4f97a8646f0 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -123,8 +123,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (nfs_iodmin), -sysctl_iodmin, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int
git: 149b9c234b00 - main - x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=149b9c234b00ff902718e1f76c809609a5465198 commit 149b9c234b00ff902718e1f76c809609a5465198 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:21 + x86: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. machdep.idle 2. machdep.idle_apl31 No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/x86/x86/cpu_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 868e6e2bc365..6062b4e85e16 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -688,7 +688,7 @@ out: } static int cpu_idle_apl31_workaround; -SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &cpu_idle_apl31_workaround, 0, "Apollo Lake APL31 MWAIT bug workaround"); @@ -802,7 +802,7 @@ cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, idle, -CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, cpu_idle_sysctl, "A", "currently selected idle function");
git: 2af5ce5b5efb - main - fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2af5ce5b5efb0cf6514acdc4a8b4058221641c39 commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:21 + fd: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.maxfiles 2. kern.maxfilesperproc No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/kern/kern_descrip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 35046c856d54..6ed824e229d6 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5090,10 +5090,11 @@ DB_SHOW_COMMAND_FLAGS(files, db_show_files, DB_CMD_MEMSAFE) } #endif -SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, +CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfilesperproc, 0, "Maximum files allowed open per process"); -SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
git: 6a88498e53b2 - main - mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6a88498e53b24d870e066c2a94910ad23dd355eb commit 6a88498e53b24d870e066c2a94910ad23dd355eb Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:22 + mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.ipc.mb_use_ext_pgs 2. kern.ipc.nmbclusters 3. kern.ipc.nmbjumbop 4. kern.ipc.nmbjumbo9 5. kern.ipc.nmbjumbo16 6. kern.ipc.nmbufs No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/kern/kern_mbuf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 494379f53e7c..0897ac4cc2db 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -132,9 +132,9 @@ sysctl_mb_use_ext_pgs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLTYPE_INT | CTLFLAG_RW, -&mb_use_ext_pgs, 0, -sysctl_mb_use_ext_pgs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&mb_use_ext_pgs, 0, sysctl_mb_use_ext_pgs, "IU", "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -222,8 +222,8 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbclusters, 0, -sysctl_nmbclusters, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -244,8 +244,8 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbop, 0, -sysctl_nmbjumbop, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbop, 0, sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -266,8 +266,8 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo9, 0, -sysctl_nmbjumbo9, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -288,8 +288,8 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo16, 0, -sysctl_nmbjumbo16, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -310,7 +310,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed");
git: 978be1ee5d5f - main - sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=978be1ee5d5fef983b4163955e15c4269c0ec76d commit 978be1ee5d5fef983b4163955e15c4269c0ec76d Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:22 + sockets: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/kern/uipc_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3c7e5c4cb4bb..880dec89245b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -366,8 +366,8 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &maxsockets, 0, -sysctl_maxsockets, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets available"); /*
git: 31b94065300a - main - buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=31b94065300a76e52c26b8caec7256574d64a777 commit 31b94065300a76e52c26b8caec7256574d64a777 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:22 + buf: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index bc09131adb87..56f9d604b9eb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -320,7 +320,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW | CTLFLAG_STATS, &barrierwrites, 0, "Number of barrier writes"); -SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, +SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); int maxbcachebuf = MAXBCACHEBUF;
git: 35b3be81f1d9 - main - proc: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=35b3be81f1d9fe38457d9137bef7a2875d24e2c8 commit 35b3be81f1d9fe38457d9137bef7a2875d24e2c8 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-09 10:30:22 + proc: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.kstack_pages' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Note that on arm64 the thread0 stack size can not be controlled with it, kib@ suggested that arm64 maintainers can fix it eventually so let's enable it also on arm64 right now. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 --- sys/kern/kern_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e834e284..2daf39b398b5 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -161,7 +161,8 @@ EVENTHANDLER_LIST_DEFINE(process_fork); EVENTHANDLER_LIST_DEFINE(process_exec); int kstack_pages = KSTACK_PAGES; -SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, +SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kstack_pages, 0, "Kernel stack size in pages"); static int vmmap_skip_res_cnt = 0; SYSCTL_INT(_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,
git: 4bf38105464b - stable/14 - cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4bf38105464ba4dde42a9d3cf223f152aa980a1b commit 4bf38105464ba4dde42a9d3cf223f152aa980a1b Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:11 + cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp (for #cam) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d) --- sys/cam/scsi/scsi_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 985547b7ce20..0e42403d74a6 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9406,7 +9406,8 @@ sysctl_scsi_delay(SYSCTL_HANDLER_ARGS) return (set_scsi_delay(delay)); } SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_scsi_delay, "I", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)"); static int
git: 0de3d5316cbc - stable/14 - ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0de3d5316cbc8297c61952c392e4b9d58b538b99 commit 0de3d5316cbc8297c61952c392e4b9d58b538b99 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:18 + ddb: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 0eb2e197896e2ec8a45730b61eeb77d5431af69f) --- sys/ddb/db_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ddb/db_capture.c b/sys/ddb/db_capture.c index 98c6e806187a..b4e598bf45cc 100644 --- a/sys/ddb/db_capture.c +++ b/sys/ddb/db_capture.c @@ -165,8 +165,8 @@ sysctl_debug_ddb_capture_bufsize(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, -sysctl_debug_ddb_capture_bufsize, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer"); /*
git: 3133f4d9dec4 - stable/14 - nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3133f4d9dec495275120f920c0939b2752ac3d4d commit 3133f4d9dec495275120f920c0939b2752ac3d4d Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:19 + nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 95c01e9b329406699e89907167b5c3c9effbcbca) --- sys/fs/nfsclient/nfs_clnfsiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 5dc1d5643591..f4f97a8646f0 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -123,8 +123,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (nfs_iodmin), -sysctl_iodmin, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int
git: 9eac775b415b - stable/14 - x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9eac775b415bf54080a98a9cf62524b8a6817595 commit 9eac775b415bf54080a98a9cf62524b8a6817595 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:19 + x86: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. machdep.idle 2. machdep.idle_apl31 No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 149b9c234b00ff902718e1f76c809609a5465198) --- sys/x86/x86/cpu_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 868e6e2bc365..6062b4e85e16 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -688,7 +688,7 @@ out: } static int cpu_idle_apl31_workaround; -SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &cpu_idle_apl31_workaround, 0, "Apollo Lake APL31 MWAIT bug workaround"); @@ -802,7 +802,7 @@ cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, idle, -CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, cpu_idle_sysctl, "A", "currently selected idle function");
git: d9aa72334782 - stable/14 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d9aa723347825418c742164c3e9a77d1e4b6943d commit d9aa723347825418c742164c3e9a77d1e4b6943d Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:19 + fd: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.maxfiles 2. kern.maxfilesperproc No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39) --- sys/kern/kern_descrip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 35046c856d54..6ed824e229d6 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5090,10 +5090,11 @@ DB_SHOW_COMMAND_FLAGS(files, db_show_files, DB_CMD_MEMSAFE) } #endif -SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, +CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfilesperproc, 0, "Maximum files allowed open per process"); -SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
git: b1456fd62094 - stable/14 - mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b1456fd6209474410c031e5e82455588e2b656c0 commit b1456fd6209474410c031e5e82455588e2b656c0 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:19 + mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.ipc.mb_use_ext_pgs 2. kern.ipc.nmbclusters 3. kern.ipc.nmbjumbop 4. kern.ipc.nmbjumbo9 5. kern.ipc.nmbjumbo16 6. kern.ipc.nmbufs No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 6a88498e53b24d870e066c2a94910ad23dd355eb) --- sys/kern/kern_mbuf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 494379f53e7c..0897ac4cc2db 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -132,9 +132,9 @@ sysctl_mb_use_ext_pgs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLTYPE_INT | CTLFLAG_RW, -&mb_use_ext_pgs, 0, -sysctl_mb_use_ext_pgs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&mb_use_ext_pgs, 0, sysctl_mb_use_ext_pgs, "IU", "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -222,8 +222,8 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbclusters, 0, -sysctl_nmbclusters, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -244,8 +244,8 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbop, 0, -sysctl_nmbjumbop, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbop, 0, sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -266,8 +266,8 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo9, 0, -sysctl_nmbjumbo9, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -288,8 +288,8 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo16, 0, -sysctl_nmbjumbo16, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -310,7 +310,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed");
git: e4f97a1ec798 - stable/14 - sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f97a1ec798d69b8ebf767d0dd2e43fbb1550f6 commit e4f97a1ec798d69b8ebf767d0dd2e43fbb1550f6 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:19 + sockets: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 978be1ee5d5fef983b4163955e15c4269c0ec76d) --- sys/kern/uipc_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3c7e5c4cb4bb..880dec89245b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -366,8 +366,8 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &maxsockets, 0, -sysctl_maxsockets, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets available"); /*
git: 8c4eaac1534e - stable/14 - buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8c4eaac1534e0486bd0fc6816ccb59fc348a5707 commit 8c4eaac1534e0486bd0fc6816ccb59fc348a5707 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:20 + buf: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 31b94065300a76e52c26b8caec7256574d64a777) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index bc09131adb87..56f9d604b9eb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -320,7 +320,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW | CTLFLAG_STATS, &barrierwrites, 0, "Number of barrier writes"); -SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, +SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); int maxbcachebuf = MAXBCACHEBUF;
git: 964a91aac9c9 - stable/14 - proc: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=964a91aac9c99d16294bc76d942de7bcc2a1b169 commit 964a91aac9c99d16294bc76d942de7bcc2a1b169 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:08:20 + proc: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.kstack_pages' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Note that on arm64 the thread0 stack size can not be controlled with it, kib@ suggested that arm64 maintainers can fix it eventually so let's enable it also on arm64 right now. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 35b3be81f1d9fe38457d9137bef7a2875d24e2c8) --- sys/kern/kern_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e834e284..2daf39b398b5 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -161,7 +161,8 @@ EVENTHANDLER_LIST_DEFINE(process_fork); EVENTHANDLER_LIST_DEFINE(process_exec); int kstack_pages = KSTACK_PAGES; -SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, +SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kstack_pages, 0, "Kernel stack size in pages"); static int vmmap_skip_res_cnt = 0; SYSCTL_INT(_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,
git: 7ac42534c234 - stable/13 - cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7ac42534c2343f2fc80feb1702751094d41e6873 commit 7ac42534c2343f2fc80feb1702751094d41e6873 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:32 + cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp (for #cam) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d) (cherry picked from commit 4bf38105464ba4dde42a9d3cf223f152aa980a1b) --- sys/cam/scsi/scsi_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index a59d3047a939..3c5e509c99ad 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9238,7 +9238,8 @@ sysctl_scsi_delay(SYSCTL_HANDLER_ARGS) return (set_scsi_delay(delay)); } SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_scsi_delay, "I", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)"); static int
git: 9edd54537025 - stable/13 - ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9edd545370254b30ae4fbaa618b33004e3005bb3 commit 9edd545370254b30ae4fbaa618b33004e3005bb3 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:36 + ddb: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 0eb2e197896e2ec8a45730b61eeb77d5431af69f) (cherry picked from commit 0de3d5316cbc8297c61952c392e4b9d58b538b99) --- sys/ddb/db_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ddb/db_capture.c b/sys/ddb/db_capture.c index 98c6e806187a..b4e598bf45cc 100644 --- a/sys/ddb/db_capture.c +++ b/sys/ddb/db_capture.c @@ -165,8 +165,8 @@ sysctl_debug_ddb_capture_bufsize(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, -sysctl_debug_ddb_capture_bufsize, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer"); /*
git: cabab5c36287 - stable/13 - x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cabab5c36287e07cc2890ef76f7e849f16636164 commit cabab5c36287e07cc2890ef76f7e849f16636164 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:37 + x86: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. machdep.idle 2. machdep.idle_apl31 No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 149b9c234b00ff902718e1f76c809609a5465198) (cherry picked from commit 9eac775b415bf54080a98a9cf62524b8a6817595) --- sys/x86/x86/cpu_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index fea64484dcea..51928805a653 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -693,7 +693,7 @@ out: } static int cpu_idle_apl31_workaround; -SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &cpu_idle_apl31_workaround, 0, "Apollo Lake APL31 MWAIT bug workaround"); @@ -807,7 +807,7 @@ cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, idle, -CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, cpu_idle_sysctl, "A", "currently selected idle function");
git: 234919330105 - stable/13 - nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=234919330105ef0b06548fb92d411ad1939ac0bb commit 234919330105ef0b06548fb92d411ad1939ac0bb Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:36 + nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 95c01e9b329406699e89907167b5c3c9effbcbca) (cherry picked from commit 3133f4d9dec495275120f920c0939b2752ac3d4d) --- sys/fs/nfsclient/nfs_clnfsiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 5dc1d5643591..f4f97a8646f0 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -123,8 +123,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (nfs_iodmin), -sysctl_iodmin, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int
git: 4f8eaa24a2ac - stable/13 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4f8eaa24a2ac40363ad13101a60ba3516a7ef401 commit 4f8eaa24a2ac40363ad13101a60ba3516a7ef401 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:37 + fd: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.maxfiles 2. kern.maxfilesperproc No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39) (cherry picked from commit d9aa723347825418c742164c3e9a77d1e4b6943d) --- sys/kern/kern_descrip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index dbf4ab1828de..de6bfe8bc1ae 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5111,10 +5111,11 @@ DB_SHOW_COMMAND(files, db_show_files) } #endif -SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, +CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfilesperproc, 0, "Maximum files allowed open per process"); -SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
git: 0007ba082c33 - stable/13 - mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0007ba082c3353f0c545e5dcf328ce30d74c5ab7 commit 0007ba082c3353f0c545e5dcf328ce30d74c5ab7 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:37 + mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.ipc.mb_use_ext_pgs 2. kern.ipc.nmbclusters 3. kern.ipc.nmbjumbop 4. kern.ipc.nmbjumbo9 5. kern.ipc.nmbjumbo16 6. kern.ipc.nmbufs No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 6a88498e53b24d870e066c2a94910ad23dd355eb) (cherry picked from commit b1456fd6209474410c031e5e82455588e2b656c0) --- sys/kern/kern_mbuf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 3a5d570cb9a0..61f12ba12306 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -131,9 +131,9 @@ sysctl_mb_use_ext_pgs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLTYPE_INT | CTLFLAG_RW, -&mb_use_ext_pgs, 0, -sysctl_mb_use_ext_pgs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&mb_use_ext_pgs, 0, sysctl_mb_use_ext_pgs, "IU", "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -221,8 +221,8 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbclusters, 0, -sysctl_nmbclusters, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -243,8 +243,8 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbop, 0, -sysctl_nmbjumbop, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbop, 0, sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -265,8 +265,8 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo9, 0, -sysctl_nmbjumbo9, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -287,8 +287,8 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo16, 0, -sysctl_nmbjumbo16, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -309,7 +309,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed");
git: 6dbde8424561 - stable/13 - sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6dbde842456151de0cec331b99e7330a80ae949c commit 6dbde842456151de0cec331b99e7330a80ae949c Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:37 + sockets: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 978be1ee5d5fef983b4163955e15c4269c0ec76d) (cherry picked from commit e4f97a1ec798d69b8ebf767d0dd2e43fbb1550f6) --- sys/kern/uipc_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index e5997e439964..bcf0ad2ade2c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -373,8 +373,8 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &maxsockets, 0, -sysctl_maxsockets, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets available"); /*
git: 5184476107f7 - stable/13 - buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5184476107f7dfcbc9931a94a91f16c71915bbd9 commit 5184476107f7dfcbc9931a94a91f16c71915bbd9 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 04:19:37 + buf: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 31b94065300a76e52c26b8caec7256574d64a777) (cherry picked from commit 8c4eaac1534e0486bd0fc6816ccb59fc348a5707) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f335f32cdd28..546b6dfb6239 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -316,7 +316,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW | CTLFLAG_STATS, &barrierwrites, 0, "Number of barrier writes"); -SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, +SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); int maxbcachebuf = MAXBCACHEBUF;
git: e266819e47f7 - stable/12 - cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e266819e47f742fdff6b8cf8f34a9f53518aef75 commit e266819e47f742fdff6b8cf8f34a9f53518aef75 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:27 + cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp (for #cam) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d) (cherry picked from commit 4bf38105464ba4dde42a9d3cf223f152aa980a1b) (cherry picked from commit 7ac42534c2343f2fc80feb1702751094d41e6873) --- sys/cam/scsi/scsi_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 07171b83923f..a7883cc8d68b 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9243,7 +9243,8 @@ sysctl_scsi_delay(SYSCTL_HANDLER_ARGS) return (error); return (set_scsi_delay(delay)); } -SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, 0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)");
git: 148a0f6bf059 - stable/12 - ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=148a0f6bf059664f965920aeb1573a1937fef301 commit 148a0f6bf059664f965920aeb1573a1937fef301 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + ddb: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 0eb2e197896e2ec8a45730b61eeb77d5431af69f) (cherry picked from commit 0de3d5316cbc8297c61952c392e4b9d58b538b99) (cherry picked from commit 9edd545370254b30ae4fbaa618b33004e3005bb3) --- sys/ddb/db_capture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ddb/db_capture.c b/sys/ddb/db_capture.c index 056edef437cd..810760fbceec 100644 --- a/sys/ddb/db_capture.c +++ b/sys/ddb/db_capture.c @@ -165,7 +165,8 @@ sysctl_debug_ddb_capture_bufsize(SYSCTL_HANDLER_ARGS) return (0); } -SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, CTLTYPE_UINT|CTLFLAG_RW, +SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, 0, 0, sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer");
git: 4e74b80165b0 - stable/12 - nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4e74b80165b0e465dd37691c2f82a6c997c0ab55 commit 4e74b80165b0e465dd37691c2f82a6c997c0ab55 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 95c01e9b329406699e89907167b5c3c9effbcbca) (cherry picked from commit 3133f4d9dec495275120f920c0939b2752ac3d4d) (cherry picked from commit 234919330105ef0b06548fb92d411ad1939ac0bb) --- sys/fs/nfsclient/nfs_clnfsiod.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 3f0fb777e37b..0675ed1ae404 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -124,8 +124,9 @@ out: NFSUNLOCKIOD(); return (0); } -SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, -sizeof (nfs_iodmin), sysctl_iodmin, "IU", +SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int
git: 9d6eb30abb29 - stable/12 - x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9d6eb30abb29ec6b71896b5a8e7c130375fa8549 commit 9d6eb30abb29ec6b71896b5a8e7c130375fa8549 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + x86: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. machdep.idle 2. machdep.idle_apl31 No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 149b9c234b00ff902718e1f76c809609a5465198) (cherry picked from commit 9eac775b415bf54080a98a9cf62524b8a6817595) (cherry picked from commit cabab5c36287e07cc2890ef76f7e849f16636164) --- sys/x86/x86/cpu_machdep.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 26423228d5dc..8ea64970a391 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -640,7 +640,7 @@ out: } static int cpu_idle_apl31_workaround; -SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &cpu_idle_apl31_workaround, 0, "Apollo Lake APL31 MWAIT bug workaround"); @@ -748,8 +748,10 @@ cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) return (cpu_idle_selector(buf) ? 0 : EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, -cpu_idle_sysctl, "A", "currently selected idle function"); +SYSCTL_PROC(_machdep, OID_AUTO, idle, +CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +0, 0, cpu_idle_sysctl, "A", +"currently selected idle function"); static void cpu_idle_tun(void *unused __unused)
git: 7563e1baf46e - stable/12 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7563e1baf46ea69e46201d33a0c4a853b678afad commit 7563e1baf46ea69e46201d33a0c4a853b678afad Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + fd: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.maxfiles 2. kern.maxfilesperproc No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39) (cherry picked from commit d9aa723347825418c742164c3e9a77d1e4b6943d) (cherry picked from commit 4f8eaa24a2ac40363ad13101a60ba3516a7ef401) --- sys/kern/kern_descrip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 6e97a1e8e2f5..412d5dc5aed6 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4144,10 +4144,11 @@ DB_SHOW_COMMAND(files, db_show_files) } #endif -SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, +CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfilesperproc, 0, "Maximum files allowed open per process"); -SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
git: 8651da955203 - stable/12 - sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8651da9552032258fec819728c7fd35b3a92e4d0 commit 8651da9552032258fec819728c7fd35b3a92e4d0 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + sockets: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 978be1ee5d5fef983b4163955e15c4269c0ec76d) (cherry picked from commit e4f97a1ec798d69b8ebf767d0dd2e43fbb1550f6) (cherry picked from commit 6dbde842456151de0cec331b99e7330a80ae949c) --- sys/kern/uipc_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 620d81246062..8ef5bab8cba5 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -366,7 +366,8 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets available");
git: 5e5a2ef8585d - stable/12 - buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5e5a2ef8585da72cbdf192016c9e3d02d047cbe0 commit 5e5a2ef8585da72cbdf192016c9e3d02d047cbe0 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 05:09:31 + buf: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 31b94065300a76e52c26b8caec7256574d64a777) (cherry picked from commit 8c4eaac1534e0486bd0fc6816ccb59fc348a5707) (cherry picked from commit 5184476107f7dfcbc9931a94a91f16c71915bbd9) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index b1cc595d2887..47a663c5c50d 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -310,7 +310,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, &barrierwrites, 0, "Number of barrier writes"); -SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, +SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); int maxbcachebuf = MAXBCACHEBUF;
git: fd18dc70ceda - stable/12 - mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fd18dc70ceda596b1007f1ec81e86c03a3b334a8 commit fd18dc70ceda596b1007f1ec81e86c03a3b334a8 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:09:39 + mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.ipc.nmbclusters 2. kern.ipc.nmbjumbop 3. kern.ipc.nmbjumbo9 4. kern.ipc.nmbjumbo16 5. kern.ipc.nmbufs No functional change intended. Reviewed by:kib, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 6a88498e53b24d870e066c2a94910ad23dd355eb) (cherry picked from commit b1456fd6209474410c031e5e82455588e2b656c0) (cherry picked from commit 0007ba082c3353f0c545e5dcf328ce30d74c5ab7) --- sys/kern/kern_mbuf.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index d9a7f30d6557..0130f8f2a324 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -176,8 +176,9 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW, -&nmbclusters, 0, sysctl_nmbclusters, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -197,8 +198,9 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbop, 0, sysctl_nmbjumbop, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&nmbjumbop, 0, sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -218,8 +220,9 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -239,8 +242,9 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -260,8 +264,9 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW, -&nmbufs, 0, sysctl_nmbufs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed"); /*
git: 51dc362d1a14 - main - boottrace: Add corresponding sysctl knob for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=51dc362d1a148362dc4cfacaa3629db928523204 commit 51dc362d1a148362dc4cfacaa3629db928523204 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:48 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:14:48 + boottrace: Add corresponding sysctl knob for loader tunable The loader tunable 'kern.boottrace.table_size' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 --- sys/kern/kern_boottrace.c | 4 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c index cb013d4e8be1..86fee4f47fbe 100644 --- a/sys/kern/kern_boottrace.c +++ b/sys/kern/kern_boottrace.c @@ -158,6 +158,10 @@ SYSCTL_INT(_kern_boottrace, OID_AUTO, shutdown_trace_threshold, CTLFLAG_RWTUN, &shutdown_trace_threshold, 0, "Tracing threshold (ms) below which tracing is ignored"); +SYSCTL_UINT(_kern_boottrace, OID_AUTO, table_size, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &bt.size, 0, +"Boot-time tracing table size"); + /* * Dump a trace to buffer or if buffer is NULL to console. *
git: 1d2b743784f7 - main - kmsan: Add corresponding sysctl knob for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d2b743784f7527a6840fe35ddb7e34cd41bc17a commit 1d2b743784f7527a6840fe35ddb7e34cd41bc17a Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:14:49 + kmsan: Add corresponding sysctl knob for loader tunable The loader tunable 'debug.kmsan.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 --- sys/kern/subr_msan.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index 57caeb454b42..54948370a14a 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -108,15 +108,13 @@ static uint8_t msan_dummy_shad[PAGE_SIZE] __aligned(PAGE_SIZE); static uint8_t msan_dummy_write_shad[PAGE_SIZE] __aligned(PAGE_SIZE); static uint8_t msan_dummy_orig[PAGE_SIZE] __aligned(PAGE_SIZE); static msan_td_t msan_thread0; -static bool kmsan_enabled __read_mostly; - static bool kmsan_reporting = false; /* * Avoid clobbering any thread-local state before we panic. */ #definekmsan_panic(f, ...) do {\ - kmsan_enabled = false; \ + kmsan_disabled = true; \ panic(f, __VA_ARGS__); \ } while (0) @@ -142,6 +140,11 @@ SYSCTL_BOOL(_debug_kmsan, OID_AUTO, panic_on_violation, CTLFLAG_RWTUN, &panic_on_violation, 0, "Panic if an invalid access is detected"); +static bool kmsan_disabled __read_mostly = true; +#define kmsan_enabled (!kmsan_disabled) +SYSCTL_BOOL(_debug_kmsan, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kmsan_disabled, 0, "KMSAN is disabled"); + static MALLOC_DEFINE(M_KMSAN, "kmsan", "Kernel memory sanitizer"); /* -- */ @@ -599,7 +602,7 @@ kmsan_init(void) thread0.td_kmsan = &msan_thread0; /* Now officially enabled. */ - kmsan_enabled = true; + kmsan_disabled = false; } /* -- */
git: db5d0bc868be - main - kasan: Add corresponding sysctl knob for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=db5d0bc868be669ed6588ebeccf8c02e76aabc41 commit db5d0bc868be669ed6588ebeccf8c02e76aabc41 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:48 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:14:48 + kasan: Add corresponding sysctl knob for loader tunable The loader tunable 'debug.kasan.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 --- sys/kern/subr_asan.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 44c96435a499..c3664d9cf6c2 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -92,7 +92,10 @@ SYSCTL_INT(_debug_kasan, OID_AUTO, panic_on_violation, CTLFLAG_RDTUN, &panic_on_violation, 0, "Panic if an invalid access is detected"); -static bool kasan_enabled __read_mostly = false; +#define kasan_enabled (!kasan_disabled) +static bool kasan_disabled __read_mostly = true; +SYSCTL_BOOL(_debug_kasan, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kasan_disabled, 0, "KASAN is disabled"); /* -- */ @@ -136,7 +139,7 @@ kasan_init(void) kasan_md_init(); /* Now officially enabled. */ - kasan_enabled = true; + kasan_disabled = false; } void @@ -180,7 +183,7 @@ kasan_code_name(uint8_t code) #defineREPORT(f, ...) do { \ if (panic_on_violation) { \ - kasan_enabled = false; \ + kasan_disabled = true; \ panic(f, __VA_ARGS__); \ } else {\ struct stack st;\
git: a55fbda874db - main - vm_page: Add corresponding sysctl knob for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a55fbda874db31b804490567c69502c891b6ff61 commit a55fbda874db31b804490567c69502c891b6ff61 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:14:49 + vm_page: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.pgcache_zone_max_pcpu' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 --- sys/vm/vm_page.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 4f3c4ba2d4d7..8496a39154de 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -198,6 +198,11 @@ vm_page_init(void *dummy) bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED); } +static int pgcache_zone_max_pcpu; +SYSCTL_INT(_vm, OID_AUTO, pgcache_zone_max_pcpu, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pgcache_zone_max_pcpu, 0, +"Per-CPU page cache size"); + /* * The cache page zone is initialized later since we need to be able to allocate * pages before UMA is fully initialized. @@ -209,9 +214,8 @@ vm_page_init_cache_zones(void *dummy __unused) struct vm_pgcache *pgcache; int cache, domain, maxcache, pool; - maxcache = 0; - TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &maxcache); - maxcache *= mp_ncpus; + TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &pgcache_zone_max_pcpu); + maxcache = pgcache_zone_max_pcpu * mp_ncpus; for (domain = 0; domain < vm_ndomains; domain++) { vmd = VM_DOMAIN(domain); for (pool = 0; pool < VM_NFREEPOOL; pool++) {
git: c415cfc8be1b - main - vm_phys: Add corresponding sysctl knob for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c415cfc8be1b732a80f1ada6d52091e08eeb9ab5 commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-12 10:14:49 + vm_phys: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.numa.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 --- sys/vm/vm_phys.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 108297caac49..bc992bdfc58b 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -76,6 +76,12 @@ _Static_assert(sizeof(long long) >= sizeof(vm_paddr_t), #ifdef NUMA struct mem_affinity __read_mostly *mem_affinity; int __read_mostly *mem_locality; + +static int numa_disabled; +static SYSCTL_NODE(_vm, OID_AUTO, numa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, +"NUMA options"); +SYSCTL_INT(_vm_numa, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&numa_disabled, 0, "NUMA-awareness in the allocators is disabled"); #endif int __read_mostly vm_ndomains = 1; @@ -627,15 +633,14 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality) { #ifdef NUMA - int d, i; + int i; /* * For now the only override value that we support is 1, which * effectively disables NUMA-awareness in the allocators. */ - d = 0; - TUNABLE_INT_FETCH("vm.numa.disabled", &d); - if (d) + TUNABLE_INT_FETCH("vm.numa.disabled", &numa_disabled); + if (numa_disabled) ndomains = 1; if (ndomains > 1) {
git: 4bf2e34a35ec - releng/14.0 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4bf2e34a35ec10eaa43a3eb867f8e8fd34974264 commit 4bf2e34a35ec10eaa43a3eb867f8e8fd34974264 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + fd: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.maxfiles 2. kern.maxfilesperproc No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39) (cherry picked from commit d9aa723347825418c742164c3e9a77d1e4b6943d) --- sys/kern/kern_descrip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 35046c856d54..6ed824e229d6 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5090,10 +5090,11 @@ DB_SHOW_COMMAND_FLAGS(files, db_show_files, DB_CMD_MEMSAFE) } #endif -SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, +CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfilesperproc, 0, "Maximum files allowed open per process"); -SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, +SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
git: 5312436fef0a - releng/14.0 - x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5312436fef0a2f4b07717bbdcaca1350934d30a3 commit 5312436fef0a2f4b07717bbdcaca1350934d30a3 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + x86: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. machdep.idle 2. machdep.idle_apl31 No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 149b9c234b00ff902718e1f76c809609a5465198) (cherry picked from commit 9eac775b415bf54080a98a9cf62524b8a6817595) --- sys/x86/x86/cpu_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index c80284cf2987..38e053832608 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -688,7 +688,7 @@ out: } static int cpu_idle_apl31_workaround; -SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &cpu_idle_apl31_workaround, 0, "Apollo Lake APL31 MWAIT bug workaround"); @@ -802,7 +802,7 @@ cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, idle, -CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, cpu_idle_sysctl, "A", "currently selected idle function");
git: 654d8b545577 - releng/14.0 - ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=654d8b545577d685cc892c00dc8e4cadaf450b26 commit 654d8b545577d685cc892c00dc8e4cadaf450b26 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + ddb: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 0eb2e197896e2ec8a45730b61eeb77d5431af69f) (cherry picked from commit 0de3d5316cbc8297c61952c392e4b9d58b538b99) --- sys/ddb/db_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ddb/db_capture.c b/sys/ddb/db_capture.c index 98c6e806187a..b4e598bf45cc 100644 --- a/sys/ddb/db_capture.c +++ b/sys/ddb/db_capture.c @@ -165,8 +165,8 @@ sysctl_debug_ddb_capture_bufsize(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, -sysctl_debug_ddb_capture_bufsize, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer"); /*
git: ca40845c3aba - releng/14.0 - cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ca40845c3abae897f51733a41dc85beeddea6be5 commit ca40845c3abae897f51733a41dc85beeddea6be5 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:42 + cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp (for #cam) Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit e2ad7ce37b1a354750d2dd3567e77f72edeb7e1d) (cherry picked from commit 4bf38105464ba4dde42a9d3cf223f152aa980a1b) --- sys/cam/scsi/scsi_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 985547b7ce20..0e42403d74a6 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9406,7 +9406,8 @@ sysctl_scsi_delay(SYSCTL_HANDLER_ARGS) return (set_scsi_delay(delay)); } SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_scsi_delay, "I", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)"); static int
git: ccf8370b8193 - releng/14.0 - nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf8370b819377684b4a1e1f21b6d81d1d4c4c4b commit ccf8370b819377684b4a1e1f21b6d81d1d4c4c4b Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:21 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 95c01e9b329406699e89907167b5c3c9effbcbca) (cherry picked from commit 3133f4d9dec495275120f920c0939b2752ac3d4d) --- sys/fs/nfsclient/nfs_clnfsiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 5dc1d5643591..f4f97a8646f0 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -123,8 +123,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, -CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (nfs_iodmin), -sysctl_iodmin, "IU", +CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int
git: 83091c864451 - releng/14.0 - sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=83091c8644516091040f32bc266f1204b0e2950d commit 83091c8644516091040f32bc266f1204b0e2950d Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + sockets: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 978be1ee5d5fef983b4163955e15c4269c0ec76d) (cherry picked from commit e4f97a1ec798d69b8ebf767d0dd2e43fbb1550f6) --- sys/kern/uipc_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3c7e5c4cb4bb..880dec89245b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -366,8 +366,8 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &maxsockets, 0, -sysctl_maxsockets, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets available"); /*
git: 718c395417de - releng/14.0 - mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=718c395417deb93d16fe81087670fa9a4d0cadea commit 718c395417deb93d16fe81087670fa9a4d0cadea Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:52 + mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. kern.ipc.mb_use_ext_pgs 2. kern.ipc.nmbclusters 3. kern.ipc.nmbjumbop 4. kern.ipc.nmbjumbo9 5. kern.ipc.nmbjumbo16 6. kern.ipc.nmbufs No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 6a88498e53b24d870e066c2a94910ad23dd355eb) (cherry picked from commit b1456fd6209474410c031e5e82455588e2b656c0) --- sys/kern/kern_mbuf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 494379f53e7c..0897ac4cc2db 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -132,9 +132,9 @@ sysctl_mb_use_ext_pgs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLTYPE_INT | CTLFLAG_RW, -&mb_use_ext_pgs, 0, -sysctl_mb_use_ext_pgs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +&mb_use_ext_pgs, 0, sysctl_mb_use_ext_pgs, "IU", "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -222,8 +222,8 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbclusters, 0, -sysctl_nmbclusters, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -244,8 +244,8 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbop, 0, -sysctl_nmbjumbop, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbop, 0, sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -266,8 +266,8 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo9, 0, -sysctl_nmbjumbo9, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -288,8 +288,8 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &nmbjumbo16, 0, -sysctl_nmbjumbo16, "IU", +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, +&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -310,7 +310,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, -CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed");
git: 205b1c574cae - releng/14.0 - buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=205b1c574caeb74bcc22e8085c0cbb132cf5a298 commit 205b1c574caeb74bcc22e8085c0cbb132cf5a298 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:53 + buf: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 31b94065300a76e52c26b8caec7256574d64a777) (cherry picked from commit 8c4eaac1534e0486bd0fc6816ccb59fc348a5707) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index bc09131adb87..56f9d604b9eb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -320,7 +320,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW | CTLFLAG_STATS, &barrierwrites, 0, "Number of barrier writes"); -SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, +SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); int maxbcachebuf = MAXBCACHEBUF;
git: fc2149590f73 - releng/14.0 - proc: Add sysctl flag CTLFLAG_TUN to loader tunable
The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fc2149590f73205b641714bcaeb562a25d9332e4 commit fc2149590f73205b641714bcaeb562a25d9332e4 Author: Zhenlei Huang AuthorDate: 2023-10-09 10:30:22 + Commit: Zhenlei Huang CommitDate: 2023-10-12 14:59:53 + proc: Add sysctl flag CTLFLAG_TUN to loader tunable The sysctl variable 'kern.kstack_pages' is actually a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it correctly. No functional change intended. Note that on arm64 the thread0 stack size can not be controlled with it, kib@ suggested that arm64 maintainers can fix it eventually so let's enable it also on arm64 right now. Reviewed by:kib, imp Approved by:re (gjb) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42113 (cherry picked from commit 35b3be81f1d9fe38457d9137bef7a2875d24e2c8) (cherry picked from commit 964a91aac9c99d16294bc76d942de7bcc2a1b169) --- sys/kern/kern_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e834e284..2daf39b398b5 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -161,7 +161,8 @@ EVENTHANDLER_LIST_DEFINE(process_fork); EVENTHANDLER_LIST_DEFINE(process_exec); int kstack_pages = KSTACK_PAGES; -SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, +SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kstack_pages, 0, "Kernel stack size in pages"); static int vmmap_skip_res_cnt = 0; SYSCTL_INT(_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,
git: 2df97575088d - main - kasan.9: Mention the loader tunable 'debug.kasan.disable'
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2df97575088d2efe71d6ee136a677cf50249f96d commit 2df97575088d2efe71d6ee136a677cf50249f96d Author: Zhenlei Huang AuthorDate: 2023-10-13 14:42:34 + Commit: Zhenlei Huang CommitDate: 2023-10-13 14:42:34 + kasan.9: Mention the loader tunable 'debug.kasan.disable' Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42165 --- share/man/man9/kasan.9 | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man9/kasan.9 b/share/man/man9/kasan.9 index 1db6e187da46..209fbb06506c 100644 --- a/share/man/man9/kasan.9 +++ b/share/man/man9/kasan.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 23, 2023 +.Dd October 13, 2023 .Dt KASAN 9 .Os .Sh NAME @@ -90,6 +90,12 @@ sysctl/tunable. .Pp The .Nm +runtime in a KASAN-configured kernel can be disabled by +setting the loader tunable +.Sy debug.kasan.disable=1 . +.Pp +The +.Nm runtime works by maintaining a shadow map for the kernel map. There exists a linear mapping between addresses in the kernel map and addresses in the shadow map.
git: 7ca90db2f3ee - main - kmsan.9: Mention the loader tunable 'debug.kmsan.disable'
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7ca90db2f3ee15d9d0343d76f06a90efb8426d92 commit 7ca90db2f3ee15d9d0343d76f06a90efb8426d92 Author: Zhenlei Huang AuthorDate: 2023-10-13 14:42:34 + Commit: Zhenlei Huang CommitDate: 2023-10-13 14:42:34 + kmsan.9: Mention the loader tunable 'debug.kmsan.disable' Reviewed by:gbe (manpages), markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42166 --- share/man/man9/kmsan.9 | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man9/kmsan.9 b/share/man/man9/kmsan.9 index ae9dbdc7a052..714442e4d9fe 100644 --- a/share/man/man9/kmsan.9 +++ b/share/man/man9/kmsan.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 10, 2021 +.Dd October 13, 2023 .Dt KMSAN 9 .Os .Sh NAME @@ -108,6 +108,10 @@ should be used only for kernel testing and development. It is not recommended to enable .Nm in systems with less than 8GB of physical RAM. +.Pp +The sanitizer in a KMSAN-configured kernel can be disabled by setting the loader +tunable +.Sy debug.kmsan.disable=1 . .Sh FUNCTIONS The .Fn kmsan_mark
Re: git: c81dd8e5fe72 - main - bpf: Add IfAPI analogue for bpf_peers_present()
> On Oct 14, 2023, at 1:22 AM, Justin Hibbits wrote: > > The branch main has been updated by jhibbits: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf > > commit c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf > Author: Justin Hibbits > AuthorDate: 2023-10-04 20:56:52 + > Commit: Justin Hibbits > CommitDate: 2023-10-13 17:12:44 + > >bpf: Add IfAPI analogue for bpf_peers_present() > >An interface's bpf could feasibly not exist, in which case >bpf_peers_present() would panic from a NULL pointer dereference. Solve >this by adding a new IfAPI that includes a NULL check. Since this API The initial version DOES have NULL check. But that is redundant and removed from the committed version. >is used in only a handful of locations, it reduces the the NULL check >scope over inserting the check into bpf_peers_present(). > >Sponsored by: Juniper Networks, Inc. >MFC after: 1 week > --- > sys/dev/firewire/if_fwip.c| 4 ++-- > sys/dev/hyperv/netvsc/if_hn.c | 4 ++-- > sys/dev/my/if_my.c| 2 +- > sys/dev/usb/usb_pf.c | 4 +--- > sys/net/bpf.c | 14 ++ > sys/net/bpf.h | 1 + > 6 files changed, 21 insertions(+), 8 deletions(-) > > diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c > index 5237c555d999..b698db6c9620 100644 > --- a/sys/dev/firewire/if_fwip.c > +++ b/sys/dev/firewire/if_fwip.c > @@ -780,7 +780,7 @@ fwip_stream_input(struct fw_xferq *xferq) >* Record the sender ID for possible BPF usage. >*/ > src = ntohl(p[1]) >> 16; > - if (bpf_peers_present(if_getbpf(ifp))) { > + if (bpf_peers_present_if(ifp)) { > mtag = m_tag_alloc(MTAG_FIREWIRE, > MTAG_FIREWIRE_SENDER_EUID, > 2*sizeof(uint32_t), M_NOWAIT); > @@ -880,7 +880,7 @@ fwip_unicast_input(struct fw_xfer *xfer) > goto done; > } > > - if (bpf_peers_present(if_getbpf(ifp))) { > + if (bpf_peers_present_if(ifp)) { > /* >* Record the sender ID for possible BPF usage. >*/ > diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c > index 7d8e1914163e..f6f885873a79 100644 > --- a/sys/dev/hyperv/netvsc/if_hn.c > +++ b/sys/dev/hyperv/netvsc/if_hn.c > @@ -3262,7 +3262,7 @@ hn_txpkt(if_t ifp, struct hn_tx_ring *txr, struct > hn_txdesc *txd) > int error, send_failed = 0, has_bpf; > > again: > - has_bpf = bpf_peers_present(if_getbpf(ifp)); > + has_bpf = bpf_peers_present_if(ifp); > if (has_bpf) { > /* >* Make sure that this txd and any aggregated txds are not > @@ -5972,7 +5972,7 @@ hn_transmit(if_t ifp, struct mbuf *m) > omcast = (m->m_flags & M_MCAST) != 0; > > if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) { > - if (bpf_peers_present(if_getbpf(ifp))) { > + if (bpf_peers_present_if(ifp)) { > m_bpf = m_copypacket(m, M_NOWAIT); > if (m_bpf == NULL) { > /* > diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c > index 2bf4573d337b..631c38df9dca 100644 > --- a/sys/dev/my/if_my.c > +++ b/sys/dev/my/if_my.c > @@ -1152,7 +1152,7 @@ my_rxeof(struct my_softc * sc) >* broadcast packet, multicast packet, matches our ethernet >* address or the interface is in promiscuous mode. >*/ > - if (bpf_peers_present(if_getbpf(ifp))) { > + if (bpf_peers_present_if(ifp)) { > bpf_mtap_if(ifp, m); > if (if_getflags(ifp) & IFF_PROMISC && > (bcmp(eh->ether_dhost, if_getlladdr(sc->my_ifp), > diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c > index 43e819684857..4da59419a7c6 100644 > --- a/sys/dev/usb/usb_pf.c > +++ b/sys/dev/usb/usb_pf.c > @@ -408,9 +408,7 @@ usbpf_xfertap(struct usb_xfer *xfer, int type) > bus = xfer->xroot->bus; > > /* sanity checks */ > - if (bus->ifp == NULL || if_getbpf(bus->ifp) == NULL) > - return; > - if (!bpf_peers_present(if_getbpf(bus->ifp))) > + if (bus->ifp == NULL || !bpf_peers_present_if(bus->ifp)) > return; > > totlen = usbpf_xfer_precompute_size(xfer, type); > diff --git a/sys/net/bpf.c b/sys/net/bpf.c > index 8ca6e941e646..96420b709911 100644 > --- a/sys/net/bpf.c > +++ b/sys/net/bpf.c > @@ -2879,6 +2879,14 @@ bpfdetach(struct ifnet *ifp) > BPF_UNLOCK(); > } > > +bool > +bpf_peers_present_if(struct ifnet *ifp) > +{ > + struct bpf_if *bp = ifp->if_bpf; > + > + return (bpf_peers_present(bp) > 0); > +} > + > /* > * Get a list of available data link type of the inte
Re: git: c81dd8e5fe72 - main - bpf: Add IfAPI analogue for bpf_peers_present()
> On Oct 14, 2023, at 2:13 AM, Zhenlei Huang wrote: > > > >> On Oct 14, 2023, at 1:22 AM, Justin Hibbits wrote: >> >> The branch main has been updated by jhibbits: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf >> >> commit c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf >> Author: Justin Hibbits >> AuthorDate: 2023-10-04 20:56:52 + >> Commit: Justin Hibbits >> CommitDate: 2023-10-13 17:12:44 + >> >> bpf: Add IfAPI analogue for bpf_peers_present() >> >> An interface's bpf could feasibly not exist, in which case >> bpf_peers_present() would panic from a NULL pointer dereference. Solve >> this by adding a new IfAPI that includes a NULL check. Since this API > > The initial version DOES have NULL check. But that is redundant and removed > from the committed version. See https://reviews.freebsd.org/D42082 <https://reviews.freebsd.org/D42082> . > >> is used in only a handful of locations, it reduces the the NULL check >> scope over inserting the check into bpf_peers_present(). >> >> Sponsored by: Juniper Networks, Inc. >> MFC after: 1 week >> --- >> sys/dev/firewire/if_fwip.c| 4 ++-- >> sys/dev/hyperv/netvsc/if_hn.c | 4 ++-- >> sys/dev/my/if_my.c| 2 +- >> sys/dev/usb/usb_pf.c | 4 +--- >> sys/net/bpf.c | 14 ++ >> sys/net/bpf.h | 1 + >> 6 files changed, 21 insertions(+), 8 deletions(-) >> >> diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c >> index 5237c555d999..b698db6c9620 100644 >> --- a/sys/dev/firewire/if_fwip.c >> +++ b/sys/dev/firewire/if_fwip.c >> @@ -780,7 +780,7 @@ fwip_stream_input(struct fw_xferq *xferq) >> * Record the sender ID for possible BPF usage. >> */ >> src = ntohl(p[1]) >> 16; >> -if (bpf_peers_present(if_getbpf(ifp))) { >> +if (bpf_peers_present_if(ifp)) { >> mtag = m_tag_alloc(MTAG_FIREWIRE, >> MTAG_FIREWIRE_SENDER_EUID, >> 2*sizeof(uint32_t), M_NOWAIT); >> @@ -880,7 +880,7 @@ fwip_unicast_input(struct fw_xfer *xfer) >> goto done; >> } >> >> -if (bpf_peers_present(if_getbpf(ifp))) { >> +if (bpf_peers_present_if(ifp)) { >> /* >> * Record the sender ID for possible BPF usage. >> */ >> diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c >> index 7d8e1914163e..f6f885873a79 100644 >> --- a/sys/dev/hyperv/netvsc/if_hn.c >> +++ b/sys/dev/hyperv/netvsc/if_hn.c >> @@ -3262,7 +3262,7 @@ hn_txpkt(if_t ifp, struct hn_tx_ring *txr, struct >> hn_txdesc *txd) >> int error, send_failed = 0, has_bpf; >> >> again: >> -has_bpf = bpf_peers_present(if_getbpf(ifp)); >> +has_bpf = bpf_peers_present_if(ifp); >> if (has_bpf) { >> /* >> * Make sure that this txd and any aggregated txds are not >> @@ -5972,7 +5972,7 @@ hn_transmit(if_t ifp, struct mbuf *m) >> omcast = (m->m_flags & M_MCAST) != 0; >> >> if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) { >> -if (bpf_peers_present(if_getbpf(ifp))) { >> +if (bpf_peers_present_if(ifp)) { >> m_bpf = m_copypacket(m, M_NOWAIT); >> if (m_bpf == NULL) { >> /* >> diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c >> index 2bf4573d337b..631c38df9dca 100644 >> --- a/sys/dev/my/if_my.c >> +++ b/sys/dev/my/if_my.c >> @@ -1152,7 +1152,7 @@ my_rxeof(struct my_softc * sc) >> * broadcast packet, multicast packet, matches our ethernet >> * address or the interface is in promiscuous mode. >> */ >> -if (bpf_peers_present(if_getbpf(ifp))) { >> +if (bpf_peers_present_if(ifp)) { >> bpf_mtap_if(ifp, m); >> if (if_getflags(ifp) & IFF_PROMISC && >> (bcmp(eh->ether_dhost, if_getlladdr(sc->my_ifp), >> diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c >> index 43e819684857..4da59419a7c6 100644 >> --- a/sys/dev/usb/usb_pf.c >> +++ b/sys/dev/usb/us
git: f34c9c4e3bdc - main - veriexec: Correctly export symbols
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f34c9c4e3bdc2b8bffae4ac26897e0e847e9f76f commit f34c9c4e3bdc2b8bffae4ac26897e0e847e9f76f Author: Zhenlei Huang AuthorDate: 2023-10-15 14:29:18 + Commit: Zhenlei Huang CommitDate: 2023-10-15 14:29:18 + veriexec: Correctly export symbols There's no symbol named 'mac_veriexec_get_executable_flags', the right one should be the function 'mac_veriexec_metadata_get_executable_flags()'. Reviewed by:stevek MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42133 --- sys/modules/mac_veriexec/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/mac_veriexec/Makefile b/sys/modules/mac_veriexec/Makefile index a165daeec043..82cf468fec50 100644 --- a/sys/modules/mac_veriexec/Makefile +++ b/sys/modules/mac_veriexec/Makefile @@ -18,7 +18,7 @@ SRCS += \ EXPORT_SYMS+= ve_mutex \ mac_veriexec_in_state \ - mac_veriexec_get_executable_flags + mac_veriexec_metadata_get_executable_flags .if defined(KERNBUILDDIR) MKDEP= -include ${KERNBUILDDIR}/opt_global.h
git: 3a97686fc11a - stable/14 - tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize'
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3a97686fc11ae51ceb4004c07702a8a20f71410d commit 3a97686fc11ae51ceb4004c07702a8a20f71410d Author: Zhenlei Huang AuthorDate: 2023-10-08 10:03:59 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:15:37 + tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize' No functional change intended. Reviewed by:cc, rscheff, #transport MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41998 (cherry picked from commit 38ecc80b2a4e5e11ece83ca4df63632f0b6fa394) --- sys/netinet/tcp_subr.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 696bd40f7ada..27b0eae83837 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -305,8 +305,17 @@ static int tcp_log_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); -static int tcp_tcbhashsize; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +/* + * Target size of TCP PCB hash tables. Must be a power of two. + * + * Note that this can be overridden by the kernel environment + * variable net.inet.tcp.tcbhashsize + */ +#ifndef TCBHASHSIZE +#define TCBHASHSIZE0 +#endif +static int tcp_tcbhashsize = TCBHASHSIZE; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); static int do_tcpdrain = 1; @@ -1152,16 +1161,6 @@ tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged) return; } -/* - * Target size of TCP PCB hash tables. Must be a power of two. - * - * Note that this can be overridden by the kernel environment - * variable net.inet.tcp.tcbhashsize - */ -#ifndef TCBHASHSIZE -#define TCBHASHSIZE0 -#endif - MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); MALLOC_DEFINE(M_TCPFUNCTIONS, "tcpfunc", "TCP function set memory"); @@ -1508,7 +1507,6 @@ VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, static void tcp_init(void *arg __unused) { - const char *tcbhash_tuneable; int hashsize; tcp_reass_global_init(); @@ -1576,9 +1574,7 @@ tcp_init(void *arg __unused) tcp_pcap_init(); #endif - hashsize = TCBHASHSIZE; - tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; - TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); + hashsize = tcp_tcbhashsize; if (hashsize == 0) { /* * Auto tune the hash size based on maxsockets. @@ -1595,7 +1591,7 @@ tcp_init(void *arg __unused) hashsize = 512; if (bootverbose) printf("%s: %s auto tuned to %d\n", __func__, - tcbhash_tuneable, hashsize); + "net.inet.tcp.tcbhashsize", hashsize); } /* * We require a hashsize to be a power of two.
git: fd9de12a7110 - stable/14 - sctp: Various fixes for loader tunables
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fd9de12a71109d1e3bb4b20e7d040fc9a1784dc2 commit fd9de12a71109d1e3bb4b20e7d040fc9a1784dc2 Author: Zhenlei Huang AuthorDate: 2023-10-09 04:36:48 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:15:37 + sctp: Various fixes for loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.sctp.tcbhashsize 2. net.inet.sctp.pcbhashsize 3. net.inet.sctp.chunkscale The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale' are only used during vnet initializing, thus it make no senses to make them writable tunable. Validate the values of loader tunables on vnet initialize, reset them to theirs defaults if invalid to prevent potential kernel panics. Reviewed by:tuexen, #transport, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42007 (cherry picked from commit dac91eb7660324677d8a2f71bd6f192422355ba1) --- sys/netinet/sctp_pcb.c| 8 sys/netinet/sctp_sysctl.c | 24 ++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 16cde18c4c1d..a1742b2fffca 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5676,6 +5676,11 @@ sctp_startup_mcore_threads(void) } #endif +#define VALIDATE_LOADER_TUNABLE(var_name, prefix) \ + if (SCTP_BASE_SYSCTL(var_name) < prefix##_MIN ||\ + SCTP_BASE_SYSCTL(var_name) > prefix##_MAX) \ + SCTP_BASE_SYSCTL(var_name) = prefix##_DEFAULT + void sctp_pcb_init(void) { @@ -5717,6 +5722,9 @@ sctp_pcb_init(void) TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.pcbhashsize", &SCTP_BASE_SYSCTL(sctp_pcbtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.chunkscale", &SCTP_BASE_SYSCTL(sctp_chunkscale)); + VALIDATE_LOADER_TUNABLE(sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_chunkscale, SCTPCTL_CHUNKSCALE); SCTP_BASE_INFO(sctp_asochash) = SCTP_HASH_INIT((SCTP_BASE_SYSCTL(sctp_hashtblsize) * 31), &SCTP_BASE_INFO(hashasocmark)); SCTP_BASE_INFO(sctp_ephash) = SCTP_HASH_INIT(SCTP_BASE_SYSCTL(sctp_hashtblsize), diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 851ed408092b..2c2cc58ee086 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -867,6 +867,14 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #endif #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + +#define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + +#define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ sctp_sysctl_handle_##mib_name(SYSCTL_HANDLER_ARGS) \ { \ @@ -885,9 +893,13 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, \ -CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, NULL, 0, \ -sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ + NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + +#define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ + SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ + CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); /* * sysctl definitions @@ -909,10 +921,10 @@ SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_o
git: 69e05e06c60d - stable/13 - sctp: Various fixes for loader tunables
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=69e05e06c60d1f068fafcc4a26ef5efdb8771c71 commit 69e05e06c60d1f068fafcc4a26ef5efdb8771c71 Author: Zhenlei Huang AuthorDate: 2023-10-09 04:36:48 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:38:26 + sctp: Various fixes for loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.sctp.tcbhashsize 2. net.inet.sctp.pcbhashsize 3. net.inet.sctp.chunkscale The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale' are only used during vnet initializing, thus it make no senses to make them writable tunable. Validate the values of loader tunables on vnet initialize, reset them to theirs defaults if invalid to prevent potential kernel panics. Reviewed by:tuexen, #transport, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42007 (cherry picked from commit dac91eb7660324677d8a2f71bd6f192422355ba1) (cherry picked from commit fd9de12a71109d1e3bb4b20e7d040fc9a1784dc2) --- sys/netinet/sctp_pcb.c| 8 sys/netinet/sctp_sysctl.c | 24 ++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index cecc727ac77f..b5c78bb67745 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5690,6 +5690,11 @@ sctp_startup_mcore_threads(void) } #endif +#define VALIDATE_LOADER_TUNABLE(var_name, prefix) \ + if (SCTP_BASE_SYSCTL(var_name) < prefix##_MIN ||\ + SCTP_BASE_SYSCTL(var_name) > prefix##_MAX) \ + SCTP_BASE_SYSCTL(var_name) = prefix##_DEFAULT + void sctp_pcb_init(void) { @@ -5731,6 +5736,9 @@ sctp_pcb_init(void) TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.pcbhashsize", &SCTP_BASE_SYSCTL(sctp_pcbtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.chunkscale", &SCTP_BASE_SYSCTL(sctp_chunkscale)); + VALIDATE_LOADER_TUNABLE(sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_chunkscale, SCTPCTL_CHUNKSCALE); SCTP_BASE_INFO(sctp_asochash) = SCTP_HASH_INIT((SCTP_BASE_SYSCTL(sctp_hashtblsize) * 31), &SCTP_BASE_INFO(hashasocmark)); SCTP_BASE_INFO(sctp_ephash) = SCTP_HASH_INIT(SCTP_BASE_SYSCTL(sctp_hashtblsize), diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index d05274f32bca..88d16f71ef3c 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -864,6 +864,14 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #endif #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + +#define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + +#define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ sctp_sysctl_handle_##mib_name(SYSCTL_HANDLER_ARGS) \ { \ @@ -882,9 +890,13 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, \ -CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, NULL, 0, \ -sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ + NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + +#define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ + SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ + CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); /* * sysctl definitions @@ -906,10 +918,10 @@ SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_defau
git: 379f41a117eb - stable/13 - tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize'
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=379f41a117eb8aaf1dd43414658606d2ef0534a7 commit 379f41a117eb8aaf1dd43414658606d2ef0534a7 Author: Zhenlei Huang AuthorDate: 2023-10-08 10:03:59 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:38:26 + tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize' No functional change intended. Reviewed by:cc, rscheff, #transport MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41998 (cherry picked from commit 38ecc80b2a4e5e11ece83ca4df63632f0b6fa394) (cherry picked from commit 3a97686fc11ae51ceb4004c07702a8a20f71410d) --- sys/netinet/tcp_subr.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 905a72dd1f91..9bf02d21a307 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -299,8 +299,17 @@ static int tcp_log_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); -static int tcp_tcbhashsize; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +/* + * Target size of TCP PCB hash tables. Must be a power of two. + * + * Note that this can be overridden by the kernel environment + * variable net.inet.tcp.tcbhashsize + */ +#ifndef TCBHASHSIZE +#define TCBHASHSIZE0 +#endif +static int tcp_tcbhashsize = TCBHASHSIZE; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); static int do_tcpdrain = 1; @@ -1052,16 +1061,6 @@ tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged) return; } -/* - * Target size of TCP PCB hash tables. Must be a power of two. - * - * Note that this can be overridden by the kernel environment - * variable net.inet.tcp.tcbhashsize - */ -#ifndef TCBHASHSIZE -#define TCBHASHSIZE0 -#endif - /* * XXX * Callouts should be moved into struct tcp directly. They are currently @@ -1374,11 +1373,8 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, void tcp_init(void) { - const char *tcbhash_tuneable; int hashsize; - tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; - #ifdef TCP_HHOOK if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) @@ -1392,8 +1388,7 @@ tcp_init(void) printf("%s: WARNING: unable to initialise TCP stats\n", __func__); #endif - hashsize = TCBHASHSIZE; - TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); + hashsize = tcp_tcbhashsize; if (hashsize == 0) { /* * Auto tune the hash size based on maxsockets. @@ -1410,7 +1405,7 @@ tcp_init(void) hashsize = 512; if (bootverbose && IS_DEFAULT_VNET(curvnet)) printf("%s: %s auto tuned to %d\n", __func__, - tcbhash_tuneable, hashsize); + "net.inet.tcp.tcbhashsize", hashsize); } /* * We require a hashsize to be a power of two.
git: 0a31dbecd43d - stable/12 - tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize'
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0a31dbecd43d3aaa4be053a9d3c21c3c81077604 commit 0a31dbecd43d3aaa4be053a9d3c21c3c81077604 Author: Zhenlei Huang AuthorDate: 2023-10-08 10:03:59 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:49:59 + tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize' No functional change intended. Reviewed by:cc, rscheff, #transport MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41998 (cherry picked from commit 38ecc80b2a4e5e11ece83ca4df63632f0b6fa394) (cherry picked from commit 3a97686fc11ae51ceb4004c07702a8a20f71410d) (cherry picked from commit 379f41a117eb8aaf1dd43414658606d2ef0534a7) --- sys/netinet/tcp_subr.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index c82a5bf21a15..2a5ab3d402c8 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -216,8 +216,17 @@ static int tcp_log_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); -static int tcp_tcbhashsize; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +/* + * Target size of TCP PCB hash tables. Must be a power of two. + * + * Note that this can be overridden by the kernel environment + * variable net.inet.tcp.tcbhashsize + */ +#ifndef TCBHASHSIZE +#define TCBHASHSIZE0 +#endif +static int tcp_tcbhashsize = TCBHASHSIZE; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); static int do_tcpdrain = 1; @@ -692,16 +701,6 @@ tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged) return; } -/* - * Target size of TCP PCB hash tables. Must be a power of two. - * - * Note that this can be overridden by the kernel environment - * variable net.inet.tcp.tcbhashsize - */ -#ifndef TCBHASHSIZE -#define TCBHASHSIZE0 -#endif - /* * XXX * Callouts should be moved into struct tcp directly. They are currently @@ -1017,11 +1016,8 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, void tcp_init(void) { - const char *tcbhash_tuneable; int hashsize; - tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; - #ifdef TCP_HHOOK if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) @@ -1030,8 +1026,7 @@ tcp_init(void) &V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); #endif - hashsize = TCBHASHSIZE; - TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); + hashsize = tcp_tcbhashsize; if (hashsize == 0) { /* * Auto tune the hash size based on maxsockets. @@ -1048,7 +1043,7 @@ tcp_init(void) hashsize = 512; if (bootverbose && IS_DEFAULT_VNET(curvnet)) printf("%s: %s auto tuned to %d\n", __func__, - tcbhash_tuneable, hashsize); + "net.inet.tcp.tcbhashsize", hashsize); } /* * We require a hashsize to be a power of two.
git: 53379a40395d - stable/12 - sctp: Various fixes for loader tunables
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=53379a40395dc4e66540c1c539dd1b70d8592852 commit 53379a40395dc4e66540c1c539dd1b70d8592852 Author: Zhenlei Huang AuthorDate: 2023-10-09 04:36:48 + Commit: Zhenlei Huang CommitDate: 2023-10-16 15:49:59 + sctp: Various fixes for loader tunables The following sysctl variables are actually loader tunables. Add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly. 1. net.inet.sctp.tcbhashsize 2. net.inet.sctp.pcbhashsize 3. net.inet.sctp.chunkscale The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale' are only used during vnet initializing, thus it make no senses to make them writable tunable. Validate the values of loader tunables on vnet initialize, reset them to theirs defaults if invalid to prevent potential kernel panics. Reviewed by:tuexen, #transport, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42007 (cherry picked from commit dac91eb7660324677d8a2f71bd6f192422355ba1) (cherry picked from commit fd9de12a71109d1e3bb4b20e7d040fc9a1784dc2) (cherry picked from commit 69e05e06c60d1f068fafcc4a26ef5efdb8771c71) --- sys/netinet/sctp_pcb.c| 8 sys/netinet/sctp_sysctl.c | 24 ++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index a1e6ebb8589b..4761fb69c05f 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5743,6 +5743,11 @@ sctp_startup_mcore_threads(void) } #endif +#define VALIDATE_LOADER_TUNABLE(var_name, prefix) \ + if (SCTP_BASE_SYSCTL(var_name) < prefix##_MIN ||\ + SCTP_BASE_SYSCTL(var_name) > prefix##_MAX) \ + SCTP_BASE_SYSCTL(var_name) = prefix##_DEFAULT + void sctp_pcb_init(void) { @@ -5785,6 +5790,9 @@ sctp_pcb_init(void) TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.pcbhashsize", &SCTP_BASE_SYSCTL(sctp_pcbtblsize)); TUNABLE_INT_FETCH("net.inet.sctp.chunkscale", &SCTP_BASE_SYSCTL(sctp_chunkscale)); + VALIDATE_LOADER_TUNABLE(sctp_hashtblsize, SCTPCTL_TCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE); + VALIDATE_LOADER_TUNABLE(sctp_chunkscale, SCTPCTL_CHUNKSCALE); SCTP_BASE_INFO(sctp_asochash) = SCTP_HASH_INIT((SCTP_BASE_SYSCTL(sctp_hashtblsize) * 31), &SCTP_BASE_INFO(hashasocmark)); SCTP_BASE_INFO(sctp_ephash) = SCTP_HASH_INIT(SCTP_BASE_SYSCTL(sctp_hashtblsize), diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 6e3b1d4ac3d5..2d5e573c0f8e 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -838,6 +838,14 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) #endif #define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW); + +#define SCTP_UINT_SYSCTL_TUN(mib_name, var_name, prefix) \ + SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, \ + CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RWTUN|CTLFLAG_NOFETCH); + +#define SCTP_UINT_SYSCTL_FLAG(mib_name, var_name, prefix, flags) \ static int \ sctp_sysctl_handle_##mib_name(SYSCTL_HANDLER_ARGS) \ { \ @@ -856,9 +864,13 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) } \ return (error); \ } \ - SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, \ -CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, NULL, 0, \ -sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, \ + NULL, 0, sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + +#define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ + SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ + CTLFLAG_VNET|CTLFLAG_RDTUN|CTLFLAG_NOFETCH, \ + &VNET_NAME(system_base_info.sctpsysctl.var_name), 0, prefix##_DESC); /* * sysctl definitions @@ -880,10 +892,10 @@ SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default
git: c525ec74b44f - stable/14 - boottrace: Add corresponding sysctl knob for loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c525ec74b44f471261b0e67eaa254e05fdef3d05 commit c525ec74b44f471261b0e67eaa254e05fdef3d05 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:48 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:50 + boottrace: Add corresponding sysctl knob for loader tunable The loader tunable 'kern.boottrace.table_size' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit 51dc362d1a148362dc4cfacaa3629db928523204) --- sys/kern/kern_boottrace.c | 4 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c index cb013d4e8be1..86fee4f47fbe 100644 --- a/sys/kern/kern_boottrace.c +++ b/sys/kern/kern_boottrace.c @@ -158,6 +158,10 @@ SYSCTL_INT(_kern_boottrace, OID_AUTO, shutdown_trace_threshold, CTLFLAG_RWTUN, &shutdown_trace_threshold, 0, "Tracing threshold (ms) below which tracing is ignored"); +SYSCTL_UINT(_kern_boottrace, OID_AUTO, table_size, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &bt.size, 0, +"Boot-time tracing table size"); + /* * Dump a trace to buffer or if buffer is NULL to console. *
git: 1b289728e93d - stable/14 - kmsan: Add corresponding sysctl knob for loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1b289728e93d1000e6ca03354c8bc4209ea8da51 commit 1b289728e93d1000e6ca03354c8bc4209ea8da51 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:56 + kmsan: Add corresponding sysctl knob for loader tunable The loader tunable 'debug.kmsan.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit 1d2b743784f7527a6840fe35ddb7e34cd41bc17a) --- sys/kern/subr_msan.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index 57caeb454b42..54948370a14a 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -108,15 +108,13 @@ static uint8_t msan_dummy_shad[PAGE_SIZE] __aligned(PAGE_SIZE); static uint8_t msan_dummy_write_shad[PAGE_SIZE] __aligned(PAGE_SIZE); static uint8_t msan_dummy_orig[PAGE_SIZE] __aligned(PAGE_SIZE); static msan_td_t msan_thread0; -static bool kmsan_enabled __read_mostly; - static bool kmsan_reporting = false; /* * Avoid clobbering any thread-local state before we panic. */ #definekmsan_panic(f, ...) do {\ - kmsan_enabled = false; \ + kmsan_disabled = true; \ panic(f, __VA_ARGS__); \ } while (0) @@ -142,6 +140,11 @@ SYSCTL_BOOL(_debug_kmsan, OID_AUTO, panic_on_violation, CTLFLAG_RWTUN, &panic_on_violation, 0, "Panic if an invalid access is detected"); +static bool kmsan_disabled __read_mostly = true; +#define kmsan_enabled (!kmsan_disabled) +SYSCTL_BOOL(_debug_kmsan, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kmsan_disabled, 0, "KMSAN is disabled"); + static MALLOC_DEFINE(M_KMSAN, "kmsan", "Kernel memory sanitizer"); /* -- */ @@ -599,7 +602,7 @@ kmsan_init(void) thread0.td_kmsan = &msan_thread0; /* Now officially enabled. */ - kmsan_enabled = true; + kmsan_disabled = false; } /* -- */
git: 6f8ef4d6e44e - stable/14 - kasan: Add corresponding sysctl knob for loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6f8ef4d6e44ee27a08c14ab6a892ffccf332bcf7 commit 6f8ef4d6e44ee27a08c14ab6a892ffccf332bcf7 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:48 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:56 + kasan: Add corresponding sysctl knob for loader tunable The loader tunable 'debug.kasan.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit db5d0bc868be669ed6588ebeccf8c02e76aabc41) --- sys/kern/subr_asan.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 44c96435a499..c3664d9cf6c2 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -92,7 +92,10 @@ SYSCTL_INT(_debug_kasan, OID_AUTO, panic_on_violation, CTLFLAG_RDTUN, &panic_on_violation, 0, "Panic if an invalid access is detected"); -static bool kasan_enabled __read_mostly = false; +#define kasan_enabled (!kasan_disabled) +static bool kasan_disabled __read_mostly = true; +SYSCTL_BOOL(_debug_kasan, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kasan_disabled, 0, "KASAN is disabled"); /* -- */ @@ -136,7 +139,7 @@ kasan_init(void) kasan_md_init(); /* Now officially enabled. */ - kasan_enabled = true; + kasan_disabled = false; } void @@ -180,7 +183,7 @@ kasan_code_name(uint8_t code) #defineREPORT(f, ...) do { \ if (panic_on_violation) { \ - kasan_enabled = false; \ + kasan_disabled = true; \ panic(f, __VA_ARGS__); \ } else {\ struct stack st;\
git: cb5bc8a748df - stable/14 - vm_page: Add corresponding sysctl knob for loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cb5bc8a748dfefc68e3905e8fdf17e0484844383 commit cb5bc8a748dfefc68e3905e8fdf17e0484844383 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:57 + vm_page: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.pgcache_zone_max_pcpu' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit a55fbda874db31b804490567c69502c891b6ff61) --- sys/vm/vm_page.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 4f3c4ba2d4d7..8496a39154de 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -198,6 +198,11 @@ vm_page_init(void *dummy) bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED); } +static int pgcache_zone_max_pcpu; +SYSCTL_INT(_vm, OID_AUTO, pgcache_zone_max_pcpu, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pgcache_zone_max_pcpu, 0, +"Per-CPU page cache size"); + /* * The cache page zone is initialized later since we need to be able to allocate * pages before UMA is fully initialized. @@ -209,9 +214,8 @@ vm_page_init_cache_zones(void *dummy __unused) struct vm_pgcache *pgcache; int cache, domain, maxcache, pool; - maxcache = 0; - TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &maxcache); - maxcache *= mp_ncpus; + TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &pgcache_zone_max_pcpu); + maxcache = pgcache_zone_max_pcpu * mp_ncpus; for (domain = 0; domain < vm_ndomains; domain++) { vmd = VM_DOMAIN(domain); for (pool = 0; pool < VM_NFREEPOOL; pool++) {
git: e26b7e8d02f6 - stable/14 - vm_phys: Add corresponding sysctl knob for loader tunable
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e26b7e8d02f648623ad343016533487634a16698 commit e26b7e8d02f648623ad343016533487634a16698 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:57 + vm_phys: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.numa.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5) --- sys/vm/vm_phys.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 108297caac49..bc992bdfc58b 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -76,6 +76,12 @@ _Static_assert(sizeof(long long) >= sizeof(vm_paddr_t), #ifdef NUMA struct mem_affinity __read_mostly *mem_affinity; int __read_mostly *mem_locality; + +static int numa_disabled; +static SYSCTL_NODE(_vm, OID_AUTO, numa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, +"NUMA options"); +SYSCTL_INT(_vm_numa, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&numa_disabled, 0, "NUMA-awareness in the allocators is disabled"); #endif int __read_mostly vm_ndomains = 1; @@ -627,15 +633,14 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality) { #ifdef NUMA - int d, i; + int i; /* * For now the only override value that we support is 1, which * effectively disables NUMA-awareness in the allocators. */ - d = 0; - TUNABLE_INT_FETCH("vm.numa.disabled", &d); - if (d) + TUNABLE_INT_FETCH("vm.numa.disabled", &numa_disabled); + if (numa_disabled) ndomains = 1; if (ndomains > 1) {
git: de2b262fde2f - stable/13 - vm_page: Add corresponding sysctl knob for loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=de2b262fde2f0955cff5cade6cca58b06fbdd37f commit de2b262fde2f0955cff5cade6cca58b06fbdd37f Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:17:29 + vm_page: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.pgcache_zone_max_pcpu' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit a55fbda874db31b804490567c69502c891b6ff61) (cherry picked from commit cb5bc8a748dfefc68e3905e8fdf17e0484844383) --- sys/vm/vm_page.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 76c50ba676c2..d21022930396 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -198,6 +198,11 @@ vm_page_init(void *dummy) bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED); } +static int pgcache_zone_max_pcpu; +SYSCTL_INT(_vm, OID_AUTO, pgcache_zone_max_pcpu, +CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pgcache_zone_max_pcpu, 0, +"Per-CPU page cache size"); + /* * The cache page zone is initialized later since we need to be able to allocate * pages before UMA is fully initialized. @@ -209,9 +214,8 @@ vm_page_init_cache_zones(void *dummy __unused) struct vm_pgcache *pgcache; int cache, domain, maxcache, pool; - maxcache = 0; - TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &maxcache); - maxcache *= mp_ncpus; + TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &pgcache_zone_max_pcpu); + maxcache = pgcache_zone_max_pcpu * mp_ncpus; for (domain = 0; domain < vm_ndomains; domain++) { vmd = VM_DOMAIN(domain); for (pool = 0; pool < VM_NFREEPOOL; pool++) {
git: c2be2c87dc21 - stable/13 - kasan: Add corresponding sysctl knob for loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c2be2c87dc2100b107a20ddd918ed9d74b8533e3 commit c2be2c87dc2100b107a20ddd918ed9d74b8533e3 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:48 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:17:29 + kasan: Add corresponding sysctl knob for loader tunable The loader tunable 'debug.kasan.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit db5d0bc868be669ed6588ebeccf8c02e76aabc41) (cherry picked from commit 6f8ef4d6e44ee27a08c14ab6a892ffccf332bcf7) --- sys/kern/subr_asan.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 1b8c52c0eb8d..9c33d0187a6d 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -92,7 +92,10 @@ SYSCTL_INT(_debug_kasan, OID_AUTO, panic_on_violation, CTLFLAG_RDTUN, &panic_on_violation, 0, "Panic if an invalid access is detected"); -static bool kasan_enabled __read_mostly = false; +#define kasan_enabled (!kasan_disabled) +static bool kasan_disabled __read_mostly = true; +SYSCTL_BOOL(_debug_kasan, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&kasan_disabled, 0, "KASAN is disabled"); /* -- */ @@ -136,7 +139,7 @@ kasan_init(void) kasan_md_init(); /* Now officially enabled. */ - kasan_enabled = true; + kasan_disabled = false; } static inline const char * @@ -174,7 +177,7 @@ kasan_code_name(uint8_t code) #defineREPORT(f, ...) do { \ if (panic_on_violation) { \ - kasan_enabled = false; \ + kasan_disabled = true; \ panic(f, __VA_ARGS__); \ } else {\ struct stack st;\
git: b180f0040f95 - stable/13 - vm_phys: Add corresponding sysctl knob for loader tunable
The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b180f0040f95973a30fa26f5435e4bbab1197e80 commit b180f0040f95973a30fa26f5435e4bbab1197e80 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:17:30 + vm_phys: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.numa.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5) (cherry picked from commit e26b7e8d02f648623ad343016533487634a16698) --- sys/vm/vm_phys.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 0c51bfc3e5c2..6894040cbefd 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -74,6 +74,12 @@ _Static_assert(sizeof(long) * NBBY >= VM_PHYSSEG_MAX, #ifdef NUMA struct mem_affinity __read_mostly *mem_affinity; int __read_mostly *mem_locality; + +static int numa_disabled; +static SYSCTL_NODE(_vm, OID_AUTO, numa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, +"NUMA options"); +SYSCTL_INT(_vm_numa, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&numa_disabled, 0, "NUMA-awareness in the allocators is disabled"); #endif int __read_mostly vm_ndomains = 1; @@ -622,15 +628,14 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality) { #ifdef NUMA - int d, i; + int i; /* * For now the only override value that we support is 1, which * effectively disables NUMA-awareness in the allocators. */ - d = 0; - TUNABLE_INT_FETCH("vm.numa.disabled", &d); - if (d) + TUNABLE_INT_FETCH("vm.numa.disabled", &numa_disabled); + if (numa_disabled) ndomains = 1; if (ndomains > 1) {
git: 9aeb24e214c1 - stable/12 - vm_phys: Add corresponding sysctl knob for loader tunable
The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9aeb24e214c19743bec202e66114aaba37896741 commit 9aeb24e214c19743bec202e66114aaba37896741 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 + Commit: Zhenlei Huang CommitDate: 2023-10-19 14:26:18 + vm_phys: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.numa.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by:markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5) (cherry picked from commit e26b7e8d02f648623ad343016533487634a16698) (cherry picked from commit b180f0040f95973a30fa26f5435e4bbab1197e80) --- sys/vm/vm_phys.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 7fb92cb06220..d4e51936222c 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -76,6 +76,12 @@ _Static_assert(sizeof(long) * NBBY >= VM_PHYSSEG_MAX, #ifdef NUMA struct mem_affinity __read_mostly *mem_affinity; int __read_mostly *mem_locality; + +static int numa_disabled; +static SYSCTL_NODE(_vm, OID_AUTO, numa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, +"NUMA options"); +SYSCTL_INT(_vm_numa, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, +&numa_disabled, 0, "NUMA-awareness in the allocators is disabled"); #endif int __read_mostly vm_ndomains = 1; @@ -604,15 +610,14 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality) { #ifdef NUMA - int d, i; + int i; /* * For now the only override value that we support is 1, which * effectively disables NUMA-awareness in the allocators. */ - d = 0; - TUNABLE_INT_FETCH("vm.numa.disabled", &d); - if (d) + TUNABLE_INT_FETCH("vm.numa.disabled", &numa_disabled); + if (numa_disabled) ndomains = 1; if (ndomains > 1) {
git: afbb8041a063 - main - amd64: Fix two typos of loader tunables
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=afbb8041a0633c97acb51ac895c9ae3cde4fe540 commit afbb8041a0633c97acb51ac895c9ae3cde4fe540 Author: Zhenlei Huang AuthorDate: 2023-10-19 15:23:33 + Commit: Zhenlei Huang CommitDate: 2023-10-19 15:23:33 + amd64: Fix two typos of loader tunables To match the sysctl MIBs and document entries in security(7). Fixes: 2dec2b4a34b4 amd64: flush L1 data cache on syscall return with an error Fixes: 17edf152e556 Control for Special Register Buffer Data Sampling mitigation Reviewed by:kib MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D42249 --- sys/amd64/amd64/machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 440c21c918be..f235d72519ae 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1480,7 +1480,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); TUNABLE_INT_FETCH("machdep.mitigations.ssb.disable", &hw_ssb_disable); - TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush", + TUNABLE_INT_FETCH("machdep.syscall_ret_flush_l1d", &syscall_ret_l1d_flush_mode); TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable); @@ -1488,7 +1488,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("machdep.mitigations.taa.enable", &x86_taa_enable); - TUNABLE_INT_FETCH("machdep.mitigations.rndgs.enable", + TUNABLE_INT_FETCH("machdep.mitigations.rngds.enable", &x86_rngds_mitg_enable); TUNABLE_INT_FETCH("machdep.mitigations.zenbleed.enable",
git: 02320f642095 - main - pmap: Prefer consistent naming for loader tunable
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=02320f64209563e35fa371fc5eac94067f688f7f commit 02320f64209563e35fa371fc5eac94067f688f7f Author: Zhenlei Huang AuthorDate: 2023-10-19 17:00:31 + Commit: Zhenlei Huang CommitDate: 2023-10-19 17:00:31 + pmap: Prefer consistent naming for loader tunable The sysctl knob 'vm.pmap.pv_entry_max' becomes a loader tunable since 7ff48af7040f (Allow a specific setting for pv entries) but is fetched from system environment 'vm.pmap.pv_entries'. That is inconsistent and obscure. This reverts 36e1b9702e21 (Correct the tunable name in the message). PR: 231577 Reviewed by:jhibbits, alc, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42274 --- sys/arm/arm/pmap-v6.c| 4 ++-- sys/i386/i386/pmap.c | 4 ++-- sys/powerpc/booke/pmap.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 719851432203..92e992a4b25e 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -1750,7 +1750,7 @@ pmap_init(void) */ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + TUNABLE_INT_FETCH("vm.pmap.pv_entry_max", &pv_entry_max); pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); @@ -3012,7 +3012,7 @@ get_pv_entry(pmap_t pmap, boolean_t try) if (ratecheck(&lastprint, &printinterval)) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " - "vm.pmap.pv_entries tunable.\n"); + "vm.pmap.pv_entry_max tunable.\n"); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 6b839484e6c5..967ad48de460 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -998,7 +998,7 @@ __CONCAT(PMTYPE, init)(void) */ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + TUNABLE_INT_FETCH("vm.pmap.pv_entry_max", &pv_entry_max); pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); @@ -2519,7 +2519,7 @@ get_pv_entry(pmap_t pmap, boolean_t try) if (ratecheck(&lastprint, &printinterval)) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " - "vm.pmap.pv_entries tunable.\n"); + "vm.pmap.pv_entry_max tunable.\n"); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index fe6b95eda085..f41ea24cd30c 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -1069,7 +1069,7 @@ mmu_booke_init(void) TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + TUNABLE_INT_FETCH("vm.pmap.pv_entry_max", &pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); uma_zone_reserve_kva(pvzone, pv_entry_max);