diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-06-28 03:56:17 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-06-28 03:56:17 +0000 |
commit | 35b126e324b8032aebea9ab6b4daf7c0bf8daed0 (patch) | |
tree | 2ebc46d89e79d747fa284f379b1979658216c719 | |
parent | 02776baefafae26b2e8b15569fe1868071fb550a (diff) | |
download | FreeBSD-src-35b126e324b8032aebea9ab6b4daf7c0bf8daed0.zip FreeBSD-src-35b126e324b8032aebea9ab6b4daf7c0bf8daed0.tar.gz |
Pull in r267961 and r267973 again. Fix for issues reported will follow.
263 files changed, 803 insertions, 1389 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index e5dd4c3..049b51bb4e 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -45,9 +45,8 @@ __FBSDID("$FreeBSD$"); #include <machine/nexusvar.h> int acpi_resume_beep; -TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); -SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, - 0, "Beep the PC speaker when resuming"); +SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RWTUN, + &acpi_resume_beep, 0, "Beep the PC speaker when resuming"); int acpi_reset_video; TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index e77a96f..29cf2c0 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -69,7 +69,6 @@ static char *mem_owner_bios = "BIOS"; (((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK)) static int mtrrs_disabled; -TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled); SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN, &mtrrs_disabled, 0, "Disable amd64 MTRRs."); diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 14cb137..b8999bd 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -675,8 +675,7 @@ cpu_halt(void) void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ -TUNABLE_INT("machdep.idle_mwait", &idle_mwait); -SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait, 0, "Use MONITOR/MWAIT for short idle"); #define STATE_RUNNING 0x0 diff --git a/sys/amd64/amd64/mp_watchdog.c b/sys/amd64/amd64/mp_watchdog.c index b1799a2..b03d261 100644 --- a/sys/amd64/amd64/mp_watchdog.c +++ b/sys/amd64/amd64/mp_watchdog.c @@ -68,8 +68,7 @@ static int watchdog_dontfire = 1; static int watchdog_timer = -1; static int watchdog_nmi = 1; -TUNABLE_INT("debug.watchdog", &watchdog_cpu); -SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RW, &watchdog_nmi, 0, +SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RWTUN, &watchdog_nmi, 0, "IPI the boot processor with an NMI to enter the debugger"); static struct callout watchdog_callout; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index ae0041f..7492960 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -332,8 +332,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, "Is page attribute table fully functional?"); static int pg_ps_enabled = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, - "Are large page mappings enabled?"); +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pg_ps_enabled, 0, "Are large page mappings enabled?"); #define PAT_INDEX_SIZE 8 static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ @@ -368,8 +368,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ static struct unrhdr pcid_unr; static struct mtx pcid_mtx; int pmap_pcid_enabled = 0; -SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled, - 0, "Is TLB Context ID enabled ?"); +SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 41709c2..37935cf 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -73,7 +73,6 @@ static void max_ldt_segment_init(void *arg __unused) { - TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment); if (max_ldt_segment <= 0) max_ldt_segment = 1; if (max_ldt_segment > MAX_LD) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index ce0ab6a..0e57666 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -143,20 +143,18 @@ static char *trap_msg[] = { #ifdef KDB static int kdb_on_nmi = 1; -SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN, &kdb_on_nmi, 0, "Go to KDB on NMI"); -TUNABLE_INT("machdep.kdb_on_nmi", &kdb_on_nmi); #endif static int panic_on_nmi = 1; -SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, &panic_on_nmi, 0, "Panic on NMI"); -TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi); static int prot_fault_translation; -SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); static int uprintf_signal; -SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, &uprintf_signal, 0, "Print debugging information on trap signal to ctty"); diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index 706fdd3..0039008 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -65,7 +65,6 @@ static int pcie_minbus, pcie_maxbus; static uint32_t pcie_badslots; static struct mtx pcicfg_mtx; static int mcfg_enable = 1; -TUNABLE_INT("hw.pci.mcfg", &mcfg_enable); SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0, "Enable support for PCI-e memory mapped config access"); diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index c2a9fd1..e4c82a1 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -199,7 +199,6 @@ SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); * interrupts disabled. */ static int halt_detection_enabled = 1; -TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, &halt_detection_enabled, 0, "Halt VM if all vcpus execute HLT with interrupts disabled"); diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 6cbcae4..f45a5d1 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -224,10 +224,10 @@ busdma_init(void *dummy) /* * This init historically used SI_SUB_VM, but now the init code requires * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by - * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using - * SI_SUB_KMEM and SI_ORDER_THIRD. + * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using + * SI_SUB_KMEM and SI_ORDER_FOURTH. */ -SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL); +SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL); static __inline int _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 8ef8e03..57b58fc 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -276,10 +276,10 @@ busdma_init(void *dummy) /* * This init historically used SI_SUB_VM, but now the init code requires * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by - * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using - * SI_SUB_KMEM and SI_ORDER_THIRD. + * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using + * SI_SUB_KMEM and SI_ORDER_FOURTH. */ -SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL); +SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL); /* * End block of code useful to transplant to other implementations. diff --git a/sys/arm/arm/dump_machdep.c b/sys/arm/arm/dump_machdep.c index f37346c..5056a33 100644 --- a/sys/arm/arm/dump_machdep.c +++ b/sys/arm/arm/dump_machdep.c @@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; -TUNABLE_INT("debug.minidump", &do_minidump); -SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, "Enable mini crash dumps"); /* diff --git a/sys/arm/arm/platform.c b/sys/arm/arm/platform.c index c744d7e..8dcccc7 100644 --- a/sys/arm/arm/platform.c +++ b/sys/arm/arm/platform.c @@ -65,8 +65,8 @@ static platform_t plat_obj; static struct kobj_ops plat_kernel_kops; static struct platform_kobj plat_kernel_obj; -static char plat_name[64] = ""; -SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, plat_name, 0, +static char plat_name[64]; +SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, plat_name, 0, "Platform currently in use"); /* diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 67ae8dd..804469e 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -465,7 +465,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); /* Superpages utilization enabled = 1 / disabled = 0 */ static int sp_enabled = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0, "Are large page mappings enabled?"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, diff --git a/sys/arm/freescale/imx/imx6_anatop.c b/sys/arm/freescale/imx/imx6_anatop.c index b1757fb..3097838 100644 --- a/sys/arm/freescale/imx/imx6_anatop.c +++ b/sys/arm/freescale/imx/imx6_anatop.c @@ -375,12 +375,12 @@ cpufreq_initialize(struct imx6_anatop_softc *sc) "CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), - OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, - cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); + OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), - OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, - cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); + OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, @@ -413,9 +413,6 @@ cpufreq_initialize(struct imx6_anatop_softc *sc) sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed]; sc->cpu_maxmhz = sc->cpu_maxmhz_hw; - TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable", - &sc->cpu_overclock_enable); - TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz); op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz); sc->cpu_minmhz = op->mhz; diff --git a/sys/arm/xscale/ixp425/if_npe.c b/sys/arm/xscale/ixp425/if_npe.c index aae31a0..d1ef51c 100644 --- a/sys/arm/xscale/ixp425/if_npe.c +++ b/sys/arm/xscale/ixp425/if_npe.c @@ -255,9 +255,8 @@ static SYSCTL_NODE(_hw, OID_AUTO, npe, CTLFLAG_RD, 0, "IXP4XX NPE driver parameters"); static int npe_debug = 0; -SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug, +SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RWTUN, &npe_debug, 0, "IXP4XX NPE network interface debug msgs"); -TUNABLE_INT("hw.npe.debug", &npe_debug); #define DPRINTF(sc, fmt, ...) do { \ if (sc->sc_debug) device_printf(sc->sc_dev, fmt, __VA_ARGS__); \ } while (0) @@ -265,18 +264,15 @@ TUNABLE_INT("hw.npe.debug", &npe_debug); if (sc->sc_debug >= n) device_printf(sc->sc_dev, fmt, __VA_ARGS__);\ } while (0) static int npe_tickinterval = 3; /* npe_tick frequency (secs) */ -SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RD, &npe_tickinterval, +SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RDTUN, &npe_tickinterval, 0, "periodic work interval (secs)"); -TUNABLE_INT("hw.npe.tickinterval", &npe_tickinterval); static int npe_rxbuf = 64; /* # rx buffers to allocate */ -SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RD, &npe_rxbuf, +SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RDTUN, &npe_rxbuf, 0, "rx buffers allocated"); -TUNABLE_INT("hw.npe.rxbuf", &npe_rxbuf); static int npe_txbuf = 128; /* # tx buffers to allocate */ -SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RD, &npe_txbuf, +SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RDTUN, &npe_txbuf, 0, "tx buffers allocated"); -TUNABLE_INT("hw.npe.txbuf", &npe_txbuf); static int unit2npeid(int unit) diff --git a/sys/arm/xscale/ixp425/ixp425_npe.c b/sys/arm/xscale/ixp425/ixp425_npe.c index 0ccc7d0..6dbce4c 100644 --- a/sys/arm/xscale/ixp425/ixp425_npe.c +++ b/sys/arm/xscale/ixp425/ixp425_npe.c @@ -181,9 +181,8 @@ typedef struct { } IxNpeDlNpeMgrStateInfoBlock; static int npe_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RW, &npe_debug, +SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RWTUN, &npe_debug, 0, "IXP4XX NPE debug msgs"); -TUNABLE_INT("debug.ixp425npe", &npe_debug); #define DPRINTF(dev, fmt, ...) do { \ if (npe_debug) device_printf(dev, fmt, __VA_ARGS__); \ } while (0) diff --git a/sys/arm/xscale/ixp425/ixp425_qmgr.c b/sys/arm/xscale/ixp425/ixp425_qmgr.c index b6fe434..cb6c8de 100644 --- a/sys/arm/xscale/ixp425/ixp425_qmgr.c +++ b/sys/arm/xscale/ixp425/ixp425_qmgr.c @@ -159,10 +159,9 @@ struct ixpqmgr_softc { uint32_t aqmFreeSramAddress; /* SRAM free space */ }; -static int qmgr_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RW, &qmgr_debug, +static int qmgr_debug; +SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RWTUN, &qmgr_debug, 0, "IXP4XX Q-Manager debug msgs"); -TUNABLE_INT("debug.qmgr", &qmgr_debug); #define DPRINTF(dev, fmt, ...) do { \ if (qmgr_debug) printf(fmt, __VA_ARGS__); \ } while (0) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 7d0d272..5ea981c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -546,30 +546,22 @@ static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN, &ada_legacy_aliases, 0, "Create legacy-like device aliases"); -TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN, &ada_retry_count, 0, "Normal I/O retry count"); -TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN, &ada_default_timeout, 0, "Normal I/O timeout (in seconds)"); -TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RWTUN, &ada_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RWTUN, &ada_spindown_shutdown, 0, "Spin down upon shutdown"); -TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RWTUN, &ada_spindown_suspend, 0, "Spin down upon suspend"); -TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RWTUN, &ada_read_ahead, 0, "Enable disk read-ahead"); -TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN, &ada_write_cache, 0, "Enable disk write cache"); -TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache); /* * ADA_ORDEREDTAG_INTERVAL determines how often, relative diff --git a/sys/cam/ata/ata_pmp.c b/sys/cam/ata/ata_pmp.c index bd4d25a..fab0e6f 100644 --- a/sys/cam/ata/ata_pmp.c +++ b/sys/cam/ata/ata_pmp.c @@ -139,15 +139,12 @@ static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); -SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN, &pmp_retry_count, 0, "Normal I/O retry count"); -TUNABLE_INT("kern.cam.pmp.retry_count", &pmp_retry_count); -SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); -TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); -SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN, &pmp_hide_special, 0, "Hide extra ports"); -TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { diff --git a/sys/cam/cam.c b/sys/cam/cam.c index f608d6f..939dd76 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -116,7 +116,6 @@ SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); #endif int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES; -TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues); SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN, &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns"); #endif diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index bfad6dd..4a8f14b 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -149,7 +149,6 @@ typedef int xpt_pdrvfunc_t (struct periph_driver **pdrv, void *arg); /* Transport layer configuration information */ static struct xpt_softc xsoftc; -TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay); SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); @@ -163,7 +162,6 @@ static struct cam_doneq cam_doneqs[MAXCPU]; static int cam_num_doneqs; static struct proc *cam_proc; -TUNABLE_INT("kern.cam.num_doneqs", &cam_num_doneqs); SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN, &cam_num_doneqs, 0, "Number of completion queues/threads"); @@ -197,12 +195,10 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ struct cam_path *cam_dpath; u_int32_t cam_dflags = CAM_DEBUG_FLAGS; -TUNABLE_INT("kern.cam.dflags", &cam_dflags); -SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, +SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN, &cam_dflags, 0, "Enabled debug flags"); u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; -TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); -SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, +SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN, &cam_debug_delay, 0, "Delay in us after each debug message"); /* Our boot-time initialization hook */ diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 38de0c22..9576142 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -308,11 +308,9 @@ static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; -TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, &worker_threads, 1, "Number of worker threads"); static int verbose = 0; -TUNABLE_INT("kern.cam.ctl.verbose", &verbose); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN, &verbose, 0, "Show SCSI errors returned to initiator"); diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 95c6788..c7ec899 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -220,10 +220,9 @@ struct ctl_be_block_io { }; static int cbb_num_threads = 14; -TUNABLE_INT("kern.cam.ctl.block.num_threads", &cbb_num_threads); SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0, "CAM Target Layer Block Backend"); -SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, &cbb_num_threads, 0, "Number of threads per backing file"); static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc); diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 6284081..2334337 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -85,19 +85,15 @@ static uma_zone_t cfiscsi_data_wait_zone; SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0, "CAM Target Layer iSCSI Frontend"); static int debug = 3; -TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int ping_timeout = 5; -TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds"); static int login_timeout = 60; -TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds"); static int maxcmdsn_delta = 256; -TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN, &maxcmdsn_delta, 256, "Number of commands the initiator can send " "without confirmation"); diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 81c29a6..47a5a43 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -277,15 +277,12 @@ static int cd_retry_count = CD_DEFAULT_RETRY; static int cd_timeout = CD_DEFAULT_TIMEOUT; static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); -SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN, &cd_poll_period, 0, "Media polling period in seconds"); -TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period); -SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN, &cd_retry_count, 0, "Normal I/O retry count"); -TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); -SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RWTUN, &cd_timeout, 0, "Timeout, in us, for read operations"); -TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 1a07577..0b1f8d5 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1188,18 +1188,14 @@ static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); -SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RWTUN, &da_poll_period, 0, "Media polling period in seconds"); -TUNABLE_INT("kern.cam.da.poll_period", &da_poll_period); -SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RWTUN, &da_retry_count, 0, "Normal I/O retry count"); -TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count); -SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RWTUN, &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); -TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout); -SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RWTUN, &da_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered); /* * DA_ORDEREDTAG_INTERVAL determines how often, relative diff --git a/sys/cam/scsi/scsi_enc_safte.c b/sys/cam/scsi/scsi_enc_safte.c index 8282d01..89f70a5 100644 --- a/sys/cam/scsi/scsi_enc_safte.c +++ b/sys/cam/scsi/scsi_enc_safte.c @@ -226,9 +226,8 @@ static char *safte_2little = "Too Little Data Returned (%d) at line %d\n"; int emulate_array_devices = 1; SYSCTL_DECL(_kern_cam_enc); -SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN, &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE"); -TUNABLE_INT("kern.cam.enc.emulate_array_devices", &emulate_array_devices); static int safte_fill_read_buf_io(enc_softc_t *enc, struct enc_fsm_state *state, diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index c1cd0f0..16b7b14 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -445,9 +445,10 @@ static int sa_allow_io_split = SA_DEFAULT_IO_SPLIT; * is bad behavior, because it hides the true tape block size from the * application. */ -TUNABLE_INT("kern.cam.sa.allow_io_split", &sa_allow_io_split); static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0, "CAM Sequential Access Tape Driver"); +SYSCTL_INT(_kern_cam_sa, OID_AUTO, allow_io_split, CTLFLAG_RDTUN, + &sa_allow_io_split, 0, "Default I/O split value"); static struct periph_driver sadriver = { @@ -1494,7 +1495,7 @@ sasysctlinit(void *context, int pending) goto bailout; SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, + OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &softc->allow_io_split, 0, "Allow Splitting I/O"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 942f712..42b8774 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -78,9 +78,8 @@ struct scsi_quirk_entry { #define SCSI_QUIRK(dev) ((struct scsi_quirk_entry *)((dev)->quirk)) static int cam_srch_hi = 0; -TUNABLE_INT("kern.cam.cam_srch_hi", &cam_srch_hi); static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT|CTLFLAG_RW, 0, 0, +SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT | CTLFLAG_RWTUN, 0, 0, sysctl_cam_search_luns, "I", "allow search above LUN 7 for SCSI3 and greater devices"); diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c index ba65109..0399355 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics"); -SYSCTL_NODE(, OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); +SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); kstat_t * kstat_create(char *module, int instance, char *name, char *class, uchar_t type, diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index bc4989e..b31d948 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -204,8 +204,6 @@ int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; int zfs_disable_dup_eviction = 0; -TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max); -TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); SYSCTL_DECL(_vfs_zfs); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0, diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c index 7863e6a..df5b77e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c @@ -44,8 +44,7 @@ int zfs_dedup_prefetch = 1; SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS DEDUP"); -TUNABLE_INT("vfs.zfs.dedup.prefetch", &zfs_dedup_prefetch); -SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RW, &zfs_dedup_prefetch, +SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RWTUN, &zfs_dedup_prefetch, 0, "Enable/disable prefetching of dedup-ed blocks which are going to be freed"); static const ddt_ops_t *ddt_ops[DDT_TYPES] = { diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c index 4aa1c88..1b222b6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c @@ -54,7 +54,6 @@ */ int zfs_nopwrite_enabled = 1; SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled); SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); @@ -1626,8 +1625,7 @@ dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress, } int zfs_mdcomp_disable = 0; -TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RWTUN, &zfs_mdcomp_disable, 0, "Disable metadata compression"); /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c index d51a981..0290b28 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c @@ -55,16 +55,12 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW, &zfs_prefetch_disable, 0, "Disable prefetch"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); -TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams); -SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN, &zfetch_max_streams, 0, "Max # of streams per zfetch"); -TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN, &zfetch_min_sec_reap, 0, "Min time before stream reclaim"); -TUNABLE_INT("vfs.zfs.zfetch.block_cap", &zfetch_block_cap); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN, &zfetch_block_cap, 0, "Max number of blocks to fetch at a time"); -TUNABLE_QUAD("vfs.zfs.zfetch.array_rd_sz", &zfetch_array_rd_sz); SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN, &zfetch_array_rd_sz, 0, "Number of bytes in a array_read at which we stop prefetching"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c index 213c2f2..3ed8735 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c @@ -141,23 +141,19 @@ extern int zfs_vdev_async_write_active_max_dirty_percent; SYSCTL_DECL(_vfs_zfs); -TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN, &zfs_dirty_data_max, 0, "The maximum amount of dirty data in bytes after which new writes are " "halted until space becomes available"); -TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN, &zfs_dirty_data_max_max, 0, "The absolute cap on dirty_data_max when auto calculating"); -TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent); SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, &zfs_dirty_data_max_percent, 0, "The percent of physical memory used to auto calculate dirty_data_max"); -TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN, &zfs_dirty_data_sync, 0, "Force a txg if the number of dirty buffer bytes exceed this value"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c index c62be1a..c78a111 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c @@ -71,32 +71,23 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */ boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */ SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN, &zfs_top_maxinflight, 0, "Maximum I/Os per top-level vdev"); -TUNABLE_INT("vfs.zfs.resilver_delay", &zfs_resilver_delay); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RWTUN, &zfs_resilver_delay, 0, "Number of ticks to delay resilver"); -TUNABLE_INT("vfs.zfs.scrub_delay", &zfs_scrub_delay); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RWTUN, &zfs_scrub_delay, 0, "Number of ticks to delay scrub"); -TUNABLE_INT("vfs.zfs.scan_idle", &zfs_scan_idle); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RWTUN, &zfs_scan_idle, 0, "Idle scan window in clock ticks"); -TUNABLE_INT("vfs.zfs.scan_min_time_ms", &zfs_scan_min_time_ms); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RWTUN, &zfs_scan_min_time_ms, 0, "Min millisecs to scrub per txg"); -TUNABLE_INT("vfs.zfs.free_min_time_ms", &zfs_free_min_time_ms); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RWTUN, &zfs_free_min_time_ms, 0, "Min millisecs to free per txg"); -TUNABLE_INT("vfs.zfs.resilver_min_time_ms", &zfs_resilver_min_time_ms); -SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RWTUN, &zfs_resilver_min_time_ms, 0, "Min millisecs to resilver per txg"); -TUNABLE_INT("vfs.zfs.no_scrub_io", &zfs_no_scrub_io); -SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RWTUN, &zfs_no_scrub_io, 0, "Disable scrub I/O"); -TUNABLE_INT("vfs.zfs.no_scrub_prefetch", &zfs_no_scrub_prefetch); -SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RWTUN, &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching"); enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c index 407c6ea..93fd28e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c @@ -55,7 +55,6 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ -TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, &metaslab_gang_bang, 0, "Force gang block allocation for blocks larger than or equal to this value"); @@ -67,7 +66,6 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; -TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, &zfs_condense_pct, 0, "Condense on-disk spacemap when it is more than this many percents" @@ -87,7 +85,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; -TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, &zfs_mg_noalloc_threshold, 0, "Percentage of metaslab group size that should be free" @@ -97,7 +94,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, * When set will load all metaslabs when pool is first opened. */ int metaslab_debug_load = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, &metaslab_debug_load, 0, "Load all metaslabs when pool is first opened"); @@ -106,7 +102,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, * When set will prevent metaslabs from being unloaded. */ int metaslab_debug_unload = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, &metaslab_debug_unload, 0, "Prevent metaslabs from being unloaded"); @@ -118,8 +113,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, * aggressive strategy (i.e search by size rather than offset). */ uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; -TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold", - &metaslab_df_alloc_threshold); SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, &metaslab_df_alloc_threshold, 0, "Minimum size which forces the dynamic allocator to change it's allocation strategy"); @@ -131,27 +124,25 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, * switch to using best-fit allocations. */ int metaslab_df_free_pct = 4; -TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN, &metaslab_df_free_pct, 0, - "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion"); + "The minimum free space, in percent, which must be available in a " + "space map to continue allocations in a first-fit fashion"); /* * A metaslab is considered "free" if it contains a contiguous * segment which is greater than metaslab_min_alloc_size. */ uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; -TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size", - &metaslab_min_alloc_size); SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN, &metaslab_min_alloc_size, 0, - "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); + "A metaslab is considered \"free\" if it contains a contiguous " + "segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* * Percentage of all cpus that can be used by the metaslab taskq. */ int metaslab_load_pct = 50; -TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, &metaslab_load_pct, 0, "Percentage of cpus that can be used by the metaslab taskq"); @@ -162,7 +153,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, * keep it loaded. */ int metaslab_unload_delay = TXG_SIZE * 2; -TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, &metaslab_unload_delay, 0, "Number of TXGs that an unused metaslab can be kept in memory"); @@ -173,13 +163,11 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, boolean_t zfs_write_to_degraded = B_FALSE; SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN, &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs"); -TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* * Max number of metaslabs per group to preload. */ int metaslab_preload_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, &metaslab_preload_limit, 0, "Max number of metaslabs per group to preload"); @@ -188,7 +176,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, * Enable/disable preloading of metaslab. */ boolean_t metaslab_preload_enabled = B_TRUE; -TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, &metaslab_preload_enabled, 0, "Max number of metaslabs per group to preload"); @@ -197,8 +184,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, * Enable/disable additional weight factor for each metaslab. */ boolean_t metaslab_weight_factor_enable = B_FALSE; -TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", - &metaslab_weight_factor_enable); SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, &metaslab_weight_factor_enable, 0, "Enable additional weight factor for each metaslab"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c index 6c79a30..097dc86 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -84,8 +84,7 @@ static int check_hostid = 1; SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid); -SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, +SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0, "Check hostid on import?"); /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c index dbcb729..0588fbd 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c @@ -244,7 +244,6 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZFS_DEBUG_SPA); int zfs_flags = 0; #endif SYSCTL_DECL(_debug); -TUNABLE_INT("debug.zfs_flags", &zfs_flags); SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0, "ZFS debug flags."); @@ -257,7 +256,6 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0, */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.recover", &zfs_recover); SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); @@ -270,7 +268,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, * in a system panic. */ uint64_t zfs_deadman_synctime_ms = 1000000ULL; -TUNABLE_QUAD("vfs.zfs.deadman_synctime_ms", &zfs_deadman_synctime_ms); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, &zfs_deadman_synctime_ms, 0, "Stalled ZFS I/O expiration time in milliseconds"); @@ -280,7 +277,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, * for hung I/O. */ uint64_t zfs_deadman_checktime_ms = 5000ULL; -TUNABLE_QUAD("vfs.zfs.deadman_checktime_ms", &zfs_deadman_checktime_ms); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, &zfs_deadman_checktime_ms, 0, "Period of checks for stalled ZFS I/O in milliseconds"); @@ -290,7 +286,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, * zfs_deadman_init() */ int zfs_deadman_enabled = -1; -TUNABLE_INT("vfs.zfs.deadman_enabled", &zfs_deadman_enabled); SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); @@ -304,7 +299,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; -TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c index 7e98199..5c52042 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c @@ -85,31 +85,22 @@ static u_int trim_vdev_max_pending = 64; SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD, 0, "ZFS TRIM"); -TUNABLE_INT("vfs.zfs.trim.txg_delay", &trim_txg_delay); SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, txg_delay, CTLFLAG_RWTUN, &trim_txg_delay, 0, "Delay TRIMs by up to this many TXGs"); - -TUNABLE_INT("vfs.zfs.trim.timeout", &trim_timeout); SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, timeout, CTLFLAG_RWTUN, &trim_timeout, 0, "Delay TRIMs by up to this many seconds"); - -TUNABLE_INT("vfs.zfs.trim.max_interval", &trim_max_interval); SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, max_interval, CTLFLAG_RWTUN, &trim_max_interval, 0, "Maximum interval between TRIM queue processing (seconds)"); SYSCTL_DECL(_vfs_zfs_vdev); -TUNABLE_QUAD("vfs.zfs.vdev.trim_max_bytes", &trim_vdev_max_bytes); SYSCTL_QUAD(_vfs_zfs_vdev, OID_AUTO, trim_max_bytes, CTLFLAG_RWTUN, &trim_vdev_max_bytes, 0, "Maximum pending TRIM bytes for a vdev"); - -TUNABLE_INT("vfs.zfs.vdev.trim_max_pending", &trim_vdev_max_pending); SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, trim_max_pending, CTLFLAG_RWTUN, &trim_vdev_max_pending, 0, "Maximum pending TRIM segments for a vdev"); - static void trim_map_vdev_commit_done(spa_t *spa, vdev_t *vd); static int diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c index 0201bef..6f52266 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c @@ -112,8 +112,7 @@ int zfs_txg_timeout = 5; /* max seconds worth of delta per txg */ SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG"); -TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout); -SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RW, &zfs_txg_timeout, 0, +SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RWTUN, &zfs_txg_timeout, 0, "Maximum seconds worth of delta per txg"); /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c index 2ad15fe..a3e9b02 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c @@ -90,13 +90,10 @@ int zfs_vdev_cache_bshift = 16; SYSCTL_DECL(_vfs_zfs_vdev); SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache"); -TUNABLE_INT("vfs.zfs.vdev.cache.max", &zfs_vdev_cache_max); SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, max, CTLFLAG_RDTUN, &zfs_vdev_cache_max, 0, "Maximum I/O request size that increase read size"); -TUNABLE_INT("vfs.zfs.vdev.cache.size", &zfs_vdev_cache_size); SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, size, CTLFLAG_RDTUN, &zfs_vdev_cache_size, 0, "Size of VDEV cache"); -TUNABLE_INT("vfs.zfs.vdev.cache.bshift", &zfs_vdev_cache_bshift); SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, bshift, CTLFLAG_RDTUN, &zfs_vdev_cache_bshift, 0, "Turn too small requests into 1 << this value"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c index b64ebdd..c38a2fc 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c @@ -53,14 +53,12 @@ DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_vdev); SYSCTL_DECL(_vfs_zfs_vdev); /* Don't send BIO_FLUSH. */ -static int vdev_geom_bio_flush_disable = 0; -TUNABLE_INT("vfs.zfs.vdev.bio_flush_disable", &vdev_geom_bio_flush_disable); -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RW, +static int vdev_geom_bio_flush_disable; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RWTUN, &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH"); /* Don't send BIO_DELETE. */ -static int vdev_geom_bio_delete_disable = 0; -TUNABLE_INT("vfs.zfs.vdev.bio_delete_disable", &vdev_geom_bio_delete_disable); -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RW, +static int vdev_geom_bio_delete_disable; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN, &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE"); static void diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c index 0b8d449..d9b15db 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c @@ -74,32 +74,26 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0, /* Rotating media load calculation configuration. */ static int rotating_inc = 0; -TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc); -SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN, &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's"); static int rotating_seek_inc = 5; -TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc); -SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN, &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's"); static int rotating_seek_offset = 1 * 1024 * 1024; -TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset); -SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN, &rotating_seek_offset, 0, "Offset in bytes from the last I/O which " "triggers a reduced rotating media seek increment"); /* Non-rotating media load calculation configuration. */ static int non_rotating_inc = 0; -TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc); -SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN, &non_rotating_inc, 0, "Non-rotating media load increment for non-seeking I/O's"); static int non_rotating_seek_inc = 1; -TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc", - &non_rotating_seek_inc); -SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN, &non_rotating_seek_inc, 0, "Non-rotating media load increment for seeking I/O's"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c index 60fd4c3..b2e10c1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c @@ -176,23 +176,18 @@ int zfs_vdev_write_gap_limit = 4 << 10; #ifdef __FreeBSD__ SYSCTL_DECL(_vfs_zfs_vdev); -TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active); -SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW, +SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RWTUN, &zfs_vdev_max_active, 0, "The maximum number of I/Os of all types active for each device."); #define ZFS_VDEV_QUEUE_KNOB_MIN(name) \ -TUNABLE_INT("vfs.zfs.vdev." #name "_min_active", \ - &zfs_vdev_ ## name ## _min_active); \ -SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, name ## _min_active, CTLFLAG_RW, \ +SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, name ## _min_active, CTLFLAG_RWTUN,\ &zfs_vdev_ ## name ## _min_active, 0, \ "Initial number of I/O requests of type " #name \ " active for each device"); #define ZFS_VDEV_QUEUE_KNOB_MAX(name) \ -TUNABLE_INT("vfs.zfs.vdev." #name "_max_active", \ - &zfs_vdev_ ## name ## _max_active); \ -SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, name ## _max_active, CTLFLAG_RW, \ +SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, name ## _max_active, CTLFLAG_RWTUN,\ &zfs_vdev_ ## name ## _max_active, 0, \ "Maximum number of I/O requests of type " #name \ " active for each device"); @@ -212,16 +207,13 @@ ZFS_VDEV_QUEUE_KNOB_MAX(trim); #undef ZFS_VDEV_QUEUE_KNOB -TUNABLE_INT("vfs.zfs.vdev.aggregation_limit", &zfs_vdev_aggregation_limit); -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, aggregation_limit, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, aggregation_limit, CTLFLAG_RWTUN, &zfs_vdev_aggregation_limit, 0, "I/O requests are aggregated up to this size"); -TUNABLE_INT("vfs.zfs.vdev.read_gap_limit", &zfs_vdev_read_gap_limit); -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, read_gap_limit, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, read_gap_limit, CTLFLAG_RWTUN, &zfs_vdev_read_gap_limit, 0, "Acceptable gap between two reads being aggregated"); -TUNABLE_INT("vfs.zfs.vdev.write_gap_limit", &zfs_vdev_write_gap_limit); -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, write_gap_limit, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, write_gap_limit, CTLFLAG_RWTUN, &zfs_vdev_write_gap_limit, 0, "Acceptable gap between two writes being aggregated"); #endif diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index 4f7c082..6b5b86d 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -195,8 +195,7 @@ CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); static int snapshot_list_prefetch; SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.snapshot_list_prefetch", &snapshot_list_prefetch); -SYSCTL_INT(_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RWTUN, &snapshot_list_prefetch, 0, "Prefetch data when listing snapshots"); static struct cdev *zfsdev; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 7ce41a1..5f2cf3f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -74,8 +74,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, super_owner, CTLFLAG_RW, &zfs_super_owner, 0, "File system owner can perform privileged operation on his file systems"); int zfs_debug_level; -TUNABLE_INT("vfs.zfs.debug", &zfs_debug_level); -SYSCTL_INT(_vfs_zfs, OID_AUTO, debug, CTLFLAG_RW, &zfs_debug_level, 0, +SYSCTL_INT(_vfs_zfs, OID_AUTO, debug, CTLFLAG_RWTUN, &zfs_debug_level, 0, "Debug level"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, version, CTLFLAG_RD, 0, "ZFS versions"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c index ea5bb13a..c17c96f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c @@ -70,8 +70,7 @@ */ int zil_replay_disable = 0; SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.zil_replay_disable", &zil_replay_disable); -SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTLFLAG_RW, +SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTLFLAG_RWTUN, &zil_replay_disable, 0, "Disable intent logging replay"); /* @@ -80,12 +79,10 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTLFLAG_RW, * out-of-order write cache is enabled. */ boolean_t zfs_nocacheflush = B_FALSE; -TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, &zfs_nocacheflush, 0, "Disable cache flush"); boolean_t zfs_trim_enabled = B_TRUE; SYSCTL_DECL(_vfs_zfs_trim); -TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, "Enable ZFS TRIM"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c index 01946fb..ba32648 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -46,11 +46,9 @@ static int zio_use_uma = 1; #else static int zio_use_uma = 0; #endif -TUNABLE_INT("vfs.zfs.zio.use_uma", &zio_use_uma); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, "Use uma(9) for ZIO allocations"); static int zio_exclude_metadata = 0; -TUNABLE_INT("vfs.zfs.zio.exclude_metadata", &zio_exclude_metadata); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, "Exclude metadata buffers from dumps as well"); @@ -104,15 +102,12 @@ extern vmem_t *zio_alloc_arena; * regular blocks are not deferred. */ int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ -TUNABLE_INT("vfs.zfs.sync_pass_deferred_free", &zfs_sync_pass_deferred_free); SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_deferred_free, CTLFLAG_RDTUN, &zfs_sync_pass_deferred_free, 0, "defer frees starting in this pass"); int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ -TUNABLE_INT("vfs.zfs.sync_pass_dont_compress", &zfs_sync_pass_dont_compress); SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_dont_compress, CTLFLAG_RDTUN, &zfs_sync_pass_dont_compress, 0, "don't compress starting in this pass"); int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ -TUNABLE_INT("vfs.zfs.sync_pass_rewrite", &zfs_sync_pass_rewrite); SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_rewrite, CTLFLAG_RDTUN, &zfs_sync_pass_rewrite, 0, "rewrite new bps starting in this pass"); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c index fb3789f..53877d7 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c @@ -119,7 +119,6 @@ static uint32_t zvol_minors; SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, "ZFS VOLUME"); static int volmode = ZFS_VOLMODE_GEOM; -TUNABLE_INT("vfs.zfs.vol.mode", &volmode); SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); diff --git a/sys/cddl/dev/dtrace/dtrace_sysctl.c b/sys/cddl/dev/dtrace/dtrace_sysctl.c index d98111d..9f8b14f 100644 --- a/sys/cddl/dev/dtrace/dtrace_sysctl.c +++ b/sys/cddl/dev/dtrace/dtrace_sysctl.c @@ -25,8 +25,7 @@ SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); int dtrace_debug = 0; -TUNABLE_INT("debug.dtrace.debug", &dtrace_debug); -SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, ""); +SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RWTUN, &dtrace_debug, 0, ""); /* Report registered DTrace providers. */ static int diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index a8e52e8..770bbbf 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -89,14 +89,11 @@ extern const char *freebsd32_syscallnames[]; static SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); static u_long ia32_maxdsiz = IA32_MAXDSIZ; -SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RW, &ia32_maxdsiz, 0, ""); -TUNABLE_ULONG("compat.ia32.maxdsiz", &ia32_maxdsiz); +SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RWTUN, &ia32_maxdsiz, 0, ""); u_long ia32_maxssiz = IA32_MAXSSIZ; -SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxssiz, CTLFLAG_RW, &ia32_maxssiz, 0, ""); -TUNABLE_ULONG("compat.ia32.maxssiz", &ia32_maxssiz); +SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxssiz, CTLFLAG_RWTUN, &ia32_maxssiz, 0, ""); static u_long ia32_maxvmem = IA32_MAXVMEM; -SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RW, &ia32_maxvmem, 0, ""); -TUNABLE_ULONG("compat.ia32.maxvmem", &ia32_maxvmem); +SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RWTUN, &ia32_maxvmem, 0, ""); struct sysentvec ia32_freebsd_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 32b9929..5cd31e8 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -70,12 +70,10 @@ static struct mtx x86bios_lock; static SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); static int x86bios_trace_call; -TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); -SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, +SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RWTUN, &x86bios_trace_call, 0, "Trace far function calls"); static int x86bios_trace_int; -TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int); -SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0, +SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RWTUN, &x86bios_trace_int, 0, "Trace software interrupt handlers"); #ifdef X86BIOS_NATIVE_VM86 diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c index ccf537e..83e7e63 100644 --- a/sys/dev/aac/aac_pci.c +++ b/sys/dev/aac/aac_pci.c @@ -61,7 +61,6 @@ static int aac_pci_probe(device_t dev); static int aac_pci_attach(device_t dev); static int aac_enable_msi = 1; -TUNABLE_INT("hw.aac.enable_msi", &aac_enable_msi); SYSCTL_INT(_hw_aac, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &aac_enable_msi, 0, "Enable MSI interrupts"); diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index e5d3d51..d49f886 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -56,7 +56,6 @@ ACPI_MODULE_NAME("SCHEDULE") * Allow the user to tune the maximum number of tasks we may enqueue. */ static int acpi_max_tasks = ACPI_MAX_TASKS; -TUNABLE_INT("debug.acpi.max_tasks", &acpi_max_tasks); SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks, 0, "Maximum acpi tasks"); @@ -65,7 +64,6 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks, * some systems have problems with increased parallelism. */ static int acpi_max_threads = ACPI_MAX_THREADS; -TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads); SYSCTL_INT(_debug_acpi, OID_AUTO, max_threads, CTLFLAG_RDTUN, &acpi_max_threads, 0, "Maximum acpi threads"); diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index f95510c..5cb22a9 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -129,7 +129,6 @@ struct acpi_cpu_device { /* Allow users to ignore processor orders in MADT. */ static int cpu_unordered; -TUNABLE_INT("debug.acpi.cpu_unordered", &cpu_unordered); SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, &cpu_unordered, 0, "Do not use the MADT to match ACPI Processor objects to CPUs."); diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 6e2f0dd..6537e40 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -181,16 +181,13 @@ ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; -TUNABLE_INT("debug.acpi.ec.burst", &ec_burst_mode); -SYSCTL_INT(_debug_acpi_ec, OID_AUTO, burst, CTLFLAG_RW, &ec_burst_mode, 0, +SYSCTL_INT(_debug_acpi_ec, OID_AUTO, burst, CTLFLAG_RWTUN, &ec_burst_mode, 0, "Enable use of burst mode (faster for nearly all systems)"); static int ec_polled_mode; -TUNABLE_INT("debug.acpi.ec.polled", &ec_polled_mode); -SYSCTL_INT(_debug_acpi_ec, OID_AUTO, polled, CTLFLAG_RW, &ec_polled_mode, 0, +SYSCTL_INT(_debug_acpi_ec, OID_AUTO, polled, CTLFLAG_RWTUN, &ec_polled_mode, 0, "Force use of polled mode (only if interrupt mode doesn't work)"); static int ec_timeout = EC_TIMEOUT; -TUNABLE_INT("debug.acpi.ec.timeout", &ec_timeout); -SYSCTL_INT(_debug_acpi_ec, OID_AUTO, timeout, CTLFLAG_RW, &ec_timeout, +SYSCTL_INT(_debug_acpi_ec, OID_AUTO, timeout, CTLFLAG_RWTUN, &ec_timeout, EC_TIMEOUT, "Total time spent waiting for a response (poll+sleep)"); static ACPI_STATUS diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index 81ddc32..9346e8c 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -92,7 +92,6 @@ static int amr_setup_mbox(struct amr_softc *sc); static int amr_ccb_map(struct amr_softc *sc); static u_int amr_force_sg32 = 0; -TUNABLE_INT("hw.amr.force_sg32", &amr_force_sg32); SYSCTL_DECL(_hw_amr); SYSCTL_UINT(_hw_amr, OID_AUTO, force_sg32, CTLFLAG_RDTUN, &amr_force_sg32, 0, "Force the AMR driver to use 32bit scatter gather"); diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index b45c868..579a2c5 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -80,9 +80,8 @@ int ata_dma_check_80pin = 1; /* sysctl vars */ static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); -TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin, - CTLFLAG_RW, &ata_dma_check_80pin, 1, + CTLFLAG_RWTUN, &ata_dma_check_80pin, 0, "Check for 80pin cable before setting ATA DMA mode"); FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver"); diff --git a/sys/dev/ath/ah_osdep.c b/sys/dev/ath/ah_osdep.c index 8e9edd1..fe4a657 100644 --- a/sys/dev/ath/ah_osdep.c +++ b/sys/dev/ath/ah_osdep.c @@ -96,9 +96,8 @@ static SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, #ifdef AH_DEBUG int ath_hal_debug = 0; -SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, +SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RWTUN, &ath_hal_debug, 0, "Atheros HAL debugging printfs"); -TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); #endif /* AH_DEBUG */ static MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index a3ab2f6..f176b63 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -240,17 +240,14 @@ SYSCTL_INT(_hw_ath, OID_AUTO, anical, CTLFLAG_RW, &ath_anicalinterval, 0, "ANI calibration (msecs)"); int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ -SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, +SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RWTUN, &ath_rxbuf, 0, "rx buffers allocated"); -TUNABLE_INT("hw.ath.rxbuf", &ath_rxbuf); int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */ -SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RW, &ath_txbuf, +SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RWTUN, &ath_txbuf, 0, "tx buffers allocated"); -TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); int ath_txbuf_mgmt = ATH_MGMT_TXBUF; /* # mgmt tx buffers to allocate */ -SYSCTL_INT(_hw_ath, OID_AUTO, txbuf_mgmt, CTLFLAG_RW, &ath_txbuf_mgmt, +SYSCTL_INT(_hw_ath, OID_AUTO, txbuf_mgmt, CTLFLAG_RWTUN, &ath_txbuf_mgmt, 0, "tx (mgmt) buffers allocated"); -TUNABLE_INT("hw.ath.txbuf_mgmt", &ath_txbuf_mgmt); int ath_bstuck_threshold = 4; /* max missed beacons */ SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, diff --git a/sys/dev/ath/if_ath_debug.c b/sys/dev/ath/if_ath_debug.c index e3c73f5..d21ad6f 100644 --- a/sys/dev/ath/if_ath_debug.c +++ b/sys/dev/ath/if_ath_debug.c @@ -92,9 +92,8 @@ __FBSDID("$FreeBSD$"); uint64_t ath_debug = 0; SYSCTL_DECL(_hw_ath); -SYSCTL_QUAD(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, +SYSCTL_QUAD(_hw_ath, OID_AUTO, debug, CTLFLAG_RWTUN, &ath_debug, 0, "control debugging printfs"); -TUNABLE_QUAD("hw.ath.debug", &ath_debug); void ath_printrxbuf(struct ath_softc *sc, const struct ath_buf *bf, diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index c888b49..dfb1dc4 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -535,44 +535,37 @@ static SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); /* Allowable values are TRUE or FALSE */ static int bce_verbose = TRUE; -TUNABLE_INT("hw.bce.verbose", &bce_verbose); SYSCTL_INT(_hw_bce, OID_AUTO, verbose, CTLFLAG_RDTUN, &bce_verbose, 0, "Verbose output enable/disable"); /* Allowable values are TRUE or FALSE */ static int bce_tso_enable = TRUE; -TUNABLE_INT("hw.bce.tso_enable", &bce_tso_enable); SYSCTL_INT(_hw_bce, OID_AUTO, tso_enable, CTLFLAG_RDTUN, &bce_tso_enable, 0, "TSO Enable/Disable"); /* Allowable values are 0 (IRQ), 1 (MSI/IRQ), and 2 (MSI-X/MSI/IRQ) */ /* ToDo: Add MSI-X support. */ static int bce_msi_enable = 1; -TUNABLE_INT("hw.bce.msi_enable", &bce_msi_enable); SYSCTL_INT(_hw_bce, OID_AUTO, msi_enable, CTLFLAG_RDTUN, &bce_msi_enable, 0, "MSI-X|MSI|INTx selector"); /* Allowable values are 1, 2, 4, 8. */ static int bce_rx_pages = DEFAULT_RX_PAGES; -TUNABLE_INT("hw.bce.rx_pages", &bce_rx_pages); SYSCTL_UINT(_hw_bce, OID_AUTO, rx_pages, CTLFLAG_RDTUN, &bce_rx_pages, 0, "Receive buffer descriptor pages (1 page = 255 buffer descriptors)"); /* Allowable values are 1, 2, 4, 8. */ static int bce_tx_pages = DEFAULT_TX_PAGES; -TUNABLE_INT("hw.bce.tx_pages", &bce_tx_pages); SYSCTL_UINT(_hw_bce, OID_AUTO, tx_pages, CTLFLAG_RDTUN, &bce_tx_pages, 0, "Transmit buffer descriptor pages (1 page = 255 buffer descriptors)"); /* Allowable values are TRUE or FALSE. */ static int bce_hdr_split = TRUE; -TUNABLE_INT("hw.bce.hdr_split", &bce_hdr_split); SYSCTL_UINT(_hw_bce, OID_AUTO, hdr_split, CTLFLAG_RDTUN, &bce_hdr_split, 0, "Frame header/payload splitting Enable/Disable"); /* Allowable values are TRUE or FALSE. */ static int bce_strict_rx_mtu = FALSE; -TUNABLE_INT("hw.bce.strict_rx_mtu", &bce_strict_rx_mtu); SYSCTL_UINT(_hw_bce, OID_AUTO, strict_rx_mtu, CTLFLAG_RDTUN, &bce_strict_rx_mtu, 0, "Enable/Disable strict RX frame size checking"); @@ -585,7 +578,6 @@ static int bce_tx_quick_cons_trip_int = 1; /* Generate 1 interrupt for every 20 transmit completions. */ static int bce_tx_quick_cons_trip_int = DEFAULT_TX_QUICK_CONS_TRIP_INT; #endif -TUNABLE_INT("hw.bce.tx_quick_cons_trip_int", &bce_tx_quick_cons_trip_int); SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip_int, CTLFLAG_RDTUN, &bce_tx_quick_cons_trip_int, 0, "Transmit BD trip point during interrupts"); @@ -598,7 +590,6 @@ static int bce_tx_quick_cons_trip = 1; /* Generate 1 interrupt for every 20 transmit completions. */ static int bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; #endif -TUNABLE_INT("hw.bce.tx_quick_cons_trip", &bce_tx_quick_cons_trip); SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip, CTLFLAG_RDTUN, &bce_tx_quick_cons_trip, 0, "Transmit BD trip point"); @@ -611,7 +602,6 @@ static int bce_tx_ticks_int = 0; /* Generate an interrupt if 80us have elapsed since the last TX completion. */ static int bce_tx_ticks_int = DEFAULT_TX_TICKS_INT; #endif -TUNABLE_INT("hw.bce.tx_ticks_int", &bce_tx_ticks_int); SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks_int, CTLFLAG_RDTUN, &bce_tx_ticks_int, 0, "Transmit ticks count during interrupt"); @@ -623,7 +613,6 @@ static int bce_tx_ticks = 0; /* Generate an interrupt if 80us have elapsed since the last TX completion. */ static int bce_tx_ticks = DEFAULT_TX_TICKS; #endif -TUNABLE_INT("hw.bce.tx_ticks", &bce_tx_ticks); SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks, CTLFLAG_RDTUN, &bce_tx_ticks, 0, "Transmit ticks count"); @@ -635,7 +624,6 @@ static int bce_rx_quick_cons_trip_int = 1; /* Generate 1 interrupt for every 6 received frames. */ static int bce_rx_quick_cons_trip_int = DEFAULT_RX_QUICK_CONS_TRIP_INT; #endif -TUNABLE_INT("hw.bce.rx_quick_cons_trip_int", &bce_rx_quick_cons_trip_int); SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip_int, CTLFLAG_RDTUN, &bce_rx_quick_cons_trip_int, 0, "Receive BD trip point duirng interrupts"); @@ -648,7 +636,6 @@ static int bce_rx_quick_cons_trip = 1; /* Generate 1 interrupt for every 6 received frames. */ static int bce_rx_quick_cons_trip = DEFAULT_RX_QUICK_CONS_TRIP; #endif -TUNABLE_INT("hw.bce.rx_quick_cons_trip", &bce_rx_quick_cons_trip); SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip, CTLFLAG_RDTUN, &bce_rx_quick_cons_trip, 0, "Receive BD trip point"); @@ -661,7 +648,6 @@ static int bce_rx_ticks_int = 0; /* Generate an int. if 18us have elapsed since the last received frame. */ static int bce_rx_ticks_int = DEFAULT_RX_TICKS_INT; #endif -TUNABLE_INT("hw.bce.rx_ticks_int", &bce_rx_ticks_int); SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks_int, CTLFLAG_RDTUN, &bce_rx_ticks_int, 0, "Receive ticks count during interrupt"); @@ -673,7 +659,6 @@ static int bce_rx_ticks = 0; /* Generate an int. if 18us have elapsed since the last received frame. */ static int bce_rx_ticks = DEFAULT_RX_TICKS; #endif -TUNABLE_INT("hw.bce.rx_ticks", &bce_rx_ticks); SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks, CTLFLAG_RDTUN, &bce_rx_ticks, 0, "Receive ticks count"); diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 40f562e..e236771 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -542,10 +542,8 @@ DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; -TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); - static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); -SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0, +SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RDTUN, &bge_allow_asf, 0, "Allow ASF mode if available"); #define SPARC64_BLADE_1500_MODEL "SUNW,Sun-Blade-1500" @@ -6237,7 +6235,6 @@ bge_add_sysctls(struct bge_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; - char tn[32]; int unit; ctx = device_get_sysctl_ctx(sc->bge_dev); @@ -6276,18 +6273,14 @@ bge_add_sysctls(struct bge_softc *sc) * consumes a lot of CPU cycles, so leave it off by default. */ sc->bge_forced_collapse = 0; - snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit); - TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse", - CTLFLAG_RW, &sc->bge_forced_collapse, 0, + CTLFLAG_RWTUN, &sc->bge_forced_collapse, 0, "Number of fragmented TX buffers of a frame allowed before " "forced collapsing"); sc->bge_msi = 1; - snprintf(tn, sizeof(tn), "dev.bge.%d.msi", unit); - TUNABLE_INT_FETCH(tn, &sc->bge_msi); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "msi", - CTLFLAG_RD, &sc->bge_msi, 0, "Enable MSI"); + CTLFLAG_RDTUN, &sc->bge_msi, 0, "Enable MSI"); /* * It seems all Broadcom controllers have a bug that can generate UDP @@ -6300,10 +6293,8 @@ bge_add_sysctls(struct bge_softc *sc) * dev.bge.0.forced_udpcsum. */ sc->bge_forced_udpcsum = 0; - snprintf(tn, sizeof(tn), "dev.bge.%d.bge_forced_udpcsum", unit); - TUNABLE_INT_FETCH(tn, &sc->bge_forced_udpcsum); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_udpcsum", - CTLFLAG_RW, &sc->bge_forced_udpcsum, 0, + CTLFLAG_RWTUN, &sc->bge_forced_udpcsum, 0, "Enable UDP checksum offloading even if controller can " "generate UDP checksum value 0"); diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index cc34b12..4e9a8d9 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -83,9 +83,8 @@ static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, #ifdef BWN_DEBUG static int bwn_debug = 0; -SYSCTL_INT(_hw_bwn, OID_AUTO, debug, CTLFLAG_RW, &bwn_debug, 0, +SYSCTL_INT(_hw_bwn, OID_AUTO, debug, CTLFLAG_RWTUN, &bwn_debug, 0, "Broadcom debugging printfs"); -TUNABLE_INT("hw.bwn.debug", &bwn_debug); enum { BWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ BWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index feae5bc..974852b 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -297,67 +297,56 @@ SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); /* Debug */ unsigned long bxe_debug = 0; -TUNABLE_ULONG("hw.bxe.debug", &bxe_debug); -SYSCTL_ULONG(_hw_bxe, OID_AUTO, debug, (CTLFLAG_RDTUN), +SYSCTL_ULONG(_hw_bxe, OID_AUTO, debug, CTLFLAG_RDTUN, &bxe_debug, 0, "Debug logging mode"); /* Interrupt Mode: 0 (IRQ), 1 (MSI/IRQ), and 2 (MSI-X/MSI/IRQ) */ static int bxe_interrupt_mode = INTR_MODE_MSIX; -TUNABLE_INT("hw.bxe.interrupt_mode", &bxe_interrupt_mode); SYSCTL_INT(_hw_bxe, OID_AUTO, interrupt_mode, CTLFLAG_RDTUN, &bxe_interrupt_mode, 0, "Interrupt (MSI-X/MSI/INTx) mode"); /* Number of Queues: 0 (Auto) or 1 to 16 (fixed queue number) */ static int bxe_queue_count = 4; -TUNABLE_INT("hw.bxe.queue_count", &bxe_queue_count); SYSCTL_INT(_hw_bxe, OID_AUTO, queue_count, CTLFLAG_RDTUN, &bxe_queue_count, 0, "Multi-Queue queue count"); /* max number of buffers per queue (default RX_BD_USABLE) */ static int bxe_max_rx_bufs = 0; -TUNABLE_INT("hw.bxe.max_rx_bufs", &bxe_max_rx_bufs); SYSCTL_INT(_hw_bxe, OID_AUTO, max_rx_bufs, CTLFLAG_RDTUN, &bxe_max_rx_bufs, 0, "Maximum Number of Rx Buffers Per Queue"); /* Host interrupt coalescing RX tick timer (usecs) */ static int bxe_hc_rx_ticks = 25; -TUNABLE_INT("hw.bxe.hc_rx_ticks", &bxe_hc_rx_ticks); SYSCTL_INT(_hw_bxe, OID_AUTO, hc_rx_ticks, CTLFLAG_RDTUN, &bxe_hc_rx_ticks, 0, "Host Coalescing Rx ticks"); /* Host interrupt coalescing TX tick timer (usecs) */ static int bxe_hc_tx_ticks = 50; -TUNABLE_INT("hw.bxe.hc_tx_ticks", &bxe_hc_tx_ticks); SYSCTL_INT(_hw_bxe, OID_AUTO, hc_tx_ticks, CTLFLAG_RDTUN, &bxe_hc_tx_ticks, 0, "Host Coalescing Tx ticks"); /* Maximum number of Rx packets to process at a time */ static int bxe_rx_budget = 0xffffffff; -TUNABLE_INT("hw.bxe.rx_budget", &bxe_rx_budget); SYSCTL_INT(_hw_bxe, OID_AUTO, rx_budget, CTLFLAG_TUN, &bxe_rx_budget, 0, "Rx processing budget"); /* Maximum LRO aggregation size */ static int bxe_max_aggregation_size = 0; -TUNABLE_INT("hw.bxe.max_aggregation_size", &bxe_max_aggregation_size); SYSCTL_INT(_hw_bxe, OID_AUTO, max_aggregation_size, CTLFLAG_TUN, &bxe_max_aggregation_size, 0, "max aggregation size"); /* PCI MRRS: -1 (Auto), 0 (128B), 1 (256B), 2 (512B), 3 (1KB) */ static int bxe_mrrs = -1; -TUNABLE_INT("hw.bxe.mrrs", &bxe_mrrs); SYSCTL_INT(_hw_bxe, OID_AUTO, mrrs, CTLFLAG_RDTUN, &bxe_mrrs, 0, "PCIe maximum read request size"); /* AutoGrEEEn: 0 (hardware default), 1 (force on), 2 (force off) */ static int bxe_autogreeen = 0; -TUNABLE_INT("hw.bxe.autogreeen", &bxe_autogreeen); SYSCTL_INT(_hw_bxe, OID_AUTO, autogreeen, CTLFLAG_RDTUN, &bxe_autogreeen, 0, "AutoGrEEEn support"); /* 4-tuple RSS support for UDP: 0 (disabled), 1 (enabled) */ static int bxe_udp_rss = 0; -TUNABLE_INT("hw.bxe.udp_rss", &bxe_udp_rss); SYSCTL_INT(_hw_bxe, OID_AUTO, udp_rss, CTLFLAG_RDTUN, &bxe_udp_rss, 0, "UDP RSS support"); diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 00d4a19..c591fe9 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -57,16 +57,12 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); int cardbus_debug = 0; -TUNABLE_INT("hw.cardbus.debug", &cardbus_debug); -SYSCTL_INT(_hw_cardbus, OID_AUTO, debug, CTLFLAG_RW, - &cardbus_debug, 0, - "CardBus debug"); +SYSCTL_INT(_hw_cardbus, OID_AUTO, debug, CTLFLAG_RWTUN, + &cardbus_debug, 0, "CardBus debug"); int cardbus_cis_debug = 0; -TUNABLE_INT("hw.cardbus.cis_debug", &cardbus_cis_debug); -SYSCTL_INT(_hw_cardbus, OID_AUTO, cis_debug, CTLFLAG_RW, - &cardbus_cis_debug, 0, - "CardBus CIS debug"); +SYSCTL_INT(_hw_cardbus, OID_AUTO, cis_debug, CTLFLAG_RWTUN, + &cardbus_cis_debug, 0, "CardBus CIS debug"); #define DPRINTF(a) if (cardbus_debug) printf a #define DEVPRINTF(x) if (cardbus_debug) device_printf x diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index b6a3d3b..502c2b3 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -107,14 +107,12 @@ driver_intr_t csintr; static SYSCTL_NODE(_hw, OID_AUTO, cs, CTLFLAG_RD, 0, "cs device parameters"); int cs_ignore_cksum_failure = 0; -TUNABLE_INT("hw.cs.ignore_checksum_failure", &cs_ignore_cksum_failure); -SYSCTL_INT(_hw_cs, OID_AUTO, ignore_checksum_failure, CTLFLAG_RW, +SYSCTL_INT(_hw_cs, OID_AUTO, ignore_checksum_failure, CTLFLAG_RWTUN, &cs_ignore_cksum_failure, 0, "ignore checksum errors in cs card EEPROM"); static int cs_recv_delay = 570; -TUNABLE_INT("hw.cs.recv_delay", &cs_recv_delay); -SYSCTL_INT(_hw_cs, OID_AUTO, recv_delay, CTLFLAG_RW, &cs_recv_delay, 570, ""); +SYSCTL_INT(_hw_cs, OID_AUTO, recv_delay, CTLFLAG_RWTUN, &cs_recv_delay, 570, ""); static int cs8900_eeint2irq[16] = { 10, 11, 12, 5, 255, 255, 255, 255, diff --git a/sys/dev/cxgb/cxgb_include.h b/sys/dev/cxgb/cxgb_include.h index 90080b5..d98ef57 100644 --- a/sys/dev/cxgb/cxgb_include.h +++ b/sys/dev/cxgb/cxgb_include.h @@ -5,6 +5,7 @@ #include <sys/cdefs.h> #include <sys/param.h> #include <sys/types.h> +#include <sys/sysctl.h> #include <machine/bus.h> #include <cxgb_osdep.h> #include <common/cxgb_common.h> @@ -16,3 +17,5 @@ #include <common/cxgb_sge_defs.h> #include <common/cxgb_firmware_exports.h> #include <common/jhash.h> + +SYSCTL_DECL(_hw_cxgb); diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 6ccf6e3..3000129 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -208,7 +208,6 @@ static SLIST_HEAD(, uld_info) t3_uld_list; */ static int msi_allowed = 2; -TUNABLE_INT("hw.cxgb.msi_allowed", &msi_allowed); SYSCTL_NODE(_hw, OID_AUTO, cxgb, CTLFLAG_RD, 0, "CXGB driver parameters"); SYSCTL_INT(_hw_cxgb, OID_AUTO, msi_allowed, CTLFLAG_RDTUN, &msi_allowed, 0, "MSI-X, MSI, INTx selector"); @@ -218,7 +217,6 @@ SYSCTL_INT(_hw_cxgb, OID_AUTO, msi_allowed, CTLFLAG_RDTUN, &msi_allowed, 0, * To disable it and force a single queue-set per port, use multiq = 0 */ static int multiq = 1; -TUNABLE_INT("hw.cxgb.multiq", &multiq); SYSCTL_INT(_hw_cxgb, OID_AUTO, multiq, CTLFLAG_RDTUN, &multiq, 0, "use min(ncpus/ports, 8) queue-sets per port"); @@ -228,17 +226,14 @@ SYSCTL_INT(_hw_cxgb, OID_AUTO, multiq, CTLFLAG_RDTUN, &multiq, 0, * */ static int force_fw_update = 0; -TUNABLE_INT("hw.cxgb.force_fw_update", &force_fw_update); SYSCTL_INT(_hw_cxgb, OID_AUTO, force_fw_update, CTLFLAG_RDTUN, &force_fw_update, 0, "update firmware even if up to date"); int cxgb_use_16k_clusters = -1; -TUNABLE_INT("hw.cxgb.use_16k_clusters", &cxgb_use_16k_clusters); SYSCTL_INT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); static int nfilters = -1; -TUNABLE_INT("hw.cxgb.nfilters", &nfilters); SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, &nfilters, 0, "max number of entries in the filter table"); diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 42744fa..fcc0376 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -86,13 +86,11 @@ CTASSERT(NUM_CPL_HANDLERS >= NUM_CPL_CMDS); extern struct sysctl_oid_list sysctl__hw_cxgb_children; int cxgb_txq_buf_ring_size = TX_ETH_Q_SIZE; -TUNABLE_INT("hw.cxgb.txq_mr_size", &cxgb_txq_buf_ring_size); SYSCTL_INT(_hw_cxgb, OID_AUTO, txq_mr_size, CTLFLAG_RDTUN, &cxgb_txq_buf_ring_size, 0, "size of per-queue mbuf ring"); static int cxgb_tx_coalesce_force = 0; -TUNABLE_INT("hw.cxgb.tx_coalesce_force", &cxgb_tx_coalesce_force); -SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_force, CTLFLAG_RW, +SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_force, CTLFLAG_RWTUN, &cxgb_tx_coalesce_force, 0, "coalesce small packets into a single work request regardless of ring state"); @@ -106,19 +104,15 @@ SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_force, CTLFLAG_RW, static int cxgb_tx_coalesce_enable_start = COALESCE_START_DEFAULT; -TUNABLE_INT("hw.cxgb.tx_coalesce_enable_start", - &cxgb_tx_coalesce_enable_start); -SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_enable_start, CTLFLAG_RW, +SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_enable_start, CTLFLAG_RWTUN, &cxgb_tx_coalesce_enable_start, 0, "coalesce enable threshold"); static int cxgb_tx_coalesce_enable_stop = COALESCE_STOP_DEFAULT; -TUNABLE_INT("hw.cxgb.tx_coalesce_enable_stop", &cxgb_tx_coalesce_enable_stop); -SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_enable_stop, CTLFLAG_RW, +SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_coalesce_enable_stop, CTLFLAG_RWTUN, &cxgb_tx_coalesce_enable_stop, 0, "coalesce disable threshold"); static int cxgb_tx_reclaim_threshold = TX_RECLAIM_DEFAULT; -TUNABLE_INT("hw.cxgb.tx_reclaim_threshold", &cxgb_tx_reclaim_threshold); -SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_reclaim_threshold, CTLFLAG_RW, +SYSCTL_INT(_hw_cxgb, OID_AUTO, tx_reclaim_threshold, CTLFLAG_RWTUN, &cxgb_tx_reclaim_threshold, 0, "tx cleaning minimum threshold"); diff --git a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c index 9afad62..fea86eb 100644 --- a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c +++ b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c @@ -106,43 +106,35 @@ static char *states[] = { SYSCTL_NODE(_hw, OID_AUTO, iw_cxgb, CTLFLAG_RD, 0, "iw_cxgb driver parameters"); static int ep_timeout_secs = 60; -TUNABLE_INT("hw.iw_cxgb.ep_timeout_secs", &ep_timeout_secs); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, ep_timeout_secs, CTLFLAG_RW, &ep_timeout_secs, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, ep_timeout_secs, CTLFLAG_RWTUN, &ep_timeout_secs, 0, "CM Endpoint operation timeout in seconds (default=60)"); static int mpa_rev = 1; -TUNABLE_INT("hw.iw_cxgb.mpa_rev", &mpa_rev); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, mpa_rev, CTLFLAG_RW, &mpa_rev, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, mpa_rev, CTLFLAG_RWTUN, &mpa_rev, 0, "MPA Revision, 0 supports amso1100, 1 is spec compliant. (default=1)"); static int markers_enabled = 0; -TUNABLE_INT("hw.iw_cxgb.markers_enabled", &markers_enabled); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, markers_enabled, CTLFLAG_RW, &markers_enabled, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, markers_enabled, CTLFLAG_RWTUN, &markers_enabled, 0, "Enable MPA MARKERS (default(0)=disabled)"); static int crc_enabled = 1; -TUNABLE_INT("hw.iw_cxgb.crc_enabled", &crc_enabled); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, crc_enabled, CTLFLAG_RW, &crc_enabled, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, crc_enabled, CTLFLAG_RWTUN, &crc_enabled, 0, "Enable MPA CRC (default(1)=enabled)"); static int rcv_win = 256 * 1024; -TUNABLE_INT("hw.iw_cxgb.rcv_win", &rcv_win); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, rcv_win, CTLFLAG_RW, &rcv_win, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, rcv_win, CTLFLAG_RWTUN, &rcv_win, 0, "TCP receive window in bytes (default=256KB)"); static int snd_win = 32 * 1024; -TUNABLE_INT("hw.iw_cxgb.snd_win", &snd_win); -SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, snd_win, CTLFLAG_RW, &snd_win, 0, +SYSCTL_INT(_hw_iw_cxgb, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default=32KB)"); static unsigned int nocong = 0; -TUNABLE_INT("hw.iw_cxgb.nocong", &nocong); -SYSCTL_UINT(_hw_iw_cxgb, OID_AUTO, nocong, CTLFLAG_RW, &nocong, 0, +SYSCTL_UINT(_hw_iw_cxgb, OID_AUTO, nocong, CTLFLAG_RWTUN, &nocong, 0, "Turn off congestion control (default=0)"); static unsigned int cong_flavor = 1; -TUNABLE_INT("hw.iw_cxgb.cong_flavor", &cong_flavor); -SYSCTL_UINT(_hw_iw_cxgb, OID_AUTO, cong_flavor, CTLFLAG_RW, &cong_flavor, 0, +SYSCTL_UINT(_hw_iw_cxgb, OID_AUTO, cong_flavor, CTLFLAG_RWTUN, &cong_flavor, 0, "TCP Congestion control flavor (default=1)"); static void ep_timeout(void *arg); diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index 03652a3..fb93a9b 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -769,88 +769,72 @@ process_socket_event(struct c4iw_ep *ep) SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); int db_delay_usecs = 1; -TUNABLE_INT("hw.iw_cxgbe.db_delay_usecs", &db_delay_usecs); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RW, &db_delay_usecs, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RWTUN, &db_delay_usecs, 0, "Usecs to delay awaiting db fifo to drain"); static int dack_mode = 1; -TUNABLE_INT("hw.iw_cxgbe.dack_mode", &dack_mode); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RW, &dack_mode, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, "Delayed ack mode (default = 1)"); int c4iw_max_read_depth = 8; -TUNABLE_INT("hw.iw_cxgbe.c4iw_max_read_depth", &c4iw_max_read_depth); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_max_read_depth, CTLFLAG_RW, &c4iw_max_read_depth, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_max_read_depth, CTLFLAG_RWTUN, &c4iw_max_read_depth, 0, "Per-connection max ORD/IRD (default = 8)"); static int enable_tcp_timestamps; -TUNABLE_INT("hw.iw_cxgbe.enable_tcp_timestamps", &enable_tcp_timestamps); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_timestamps, CTLFLAG_RW, &enable_tcp_timestamps, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_timestamps, CTLFLAG_RWTUN, &enable_tcp_timestamps, 0, "Enable tcp timestamps (default = 0)"); static int enable_tcp_sack; -TUNABLE_INT("hw.iw_cxgbe.enable_tcp_sack", &enable_tcp_sack); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_sack, CTLFLAG_RW, &enable_tcp_sack, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_sack, CTLFLAG_RWTUN, &enable_tcp_sack, 0, "Enable tcp SACK (default = 0)"); static int enable_tcp_window_scaling = 1; -TUNABLE_INT("hw.iw_cxgbe.enable_tcp_window_scaling", &enable_tcp_window_scaling); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_window_scaling, CTLFLAG_RW, &enable_tcp_window_scaling, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, enable_tcp_window_scaling, CTLFLAG_RWTUN, &enable_tcp_window_scaling, 0, "Enable tcp window scaling (default = 1)"); int c4iw_debug = 1; -TUNABLE_INT("hw.iw_cxgbe.c4iw_debug", &c4iw_debug); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_debug, CTLFLAG_RW, &c4iw_debug, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_debug, CTLFLAG_RWTUN, &c4iw_debug, 0, "Enable debug logging (default = 0)"); static int peer2peer; -TUNABLE_INT("hw.iw_cxgbe.peer2peer", &peer2peer); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, peer2peer, CTLFLAG_RW, &peer2peer, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, peer2peer, CTLFLAG_RWTUN, &peer2peer, 0, "Support peer2peer ULPs (default = 0)"); static int p2p_type = FW_RI_INIT_P2PTYPE_READ_REQ; -TUNABLE_INT("hw.iw_cxgbe.p2p_type", &p2p_type); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, p2p_type, CTLFLAG_RW, &p2p_type, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, p2p_type, CTLFLAG_RWTUN, &p2p_type, 0, "RDMAP opcode to use for the RTR message: 1 = RDMA_READ 0 = RDMA_WRITE (default 1)"); static int ep_timeout_secs = 60; -TUNABLE_INT("hw.iw_cxgbe.ep_timeout_secs", &ep_timeout_secs); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, ep_timeout_secs, CTLFLAG_RW, &ep_timeout_secs, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, ep_timeout_secs, CTLFLAG_RWTUN, &ep_timeout_secs, 0, "CM Endpoint operation timeout in seconds (default = 60)"); static int mpa_rev = 1; -TUNABLE_INT("hw.iw_cxgbe.mpa_rev", &mpa_rev); #ifdef IW_CM_MPAV2 -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RW, &mpa_rev, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RWTUN, &mpa_rev, 0, "MPA Revision, 0 supports amso1100, 1 is RFC0544 spec compliant, 2 is IETF MPA Peer Connect Draft compliant (default = 1)"); #else -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RW, &mpa_rev, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RWTUN, &mpa_rev, 0, "MPA Revision, 0 supports amso1100, 1 is RFC0544 spec compliant (default = 1)"); #endif static int markers_enabled; -TUNABLE_INT("hw.iw_cxgbe.markers_enabled", &markers_enabled); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, markers_enabled, CTLFLAG_RW, &markers_enabled, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, markers_enabled, CTLFLAG_RWTUN, &markers_enabled, 0, "Enable MPA MARKERS (default(0) = disabled)"); static int crc_enabled = 1; -TUNABLE_INT("hw.iw_cxgbe.crc_enabled", &crc_enabled); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, crc_enabled, CTLFLAG_RW, &crc_enabled, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, crc_enabled, CTLFLAG_RWTUN, &crc_enabled, 0, "Enable MPA CRC (default(1) = enabled)"); static int rcv_win = 256 * 1024; -TUNABLE_INT("hw.iw_cxgbe.rcv_win", &rcv_win); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, rcv_win, CTLFLAG_RW, &rcv_win, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, rcv_win, CTLFLAG_RWTUN, &rcv_win, 0, "TCP receive window in bytes (default = 256KB)"); static int snd_win = 128 * 1024; -TUNABLE_INT("hw.iw_cxgbe.snd_win", &snd_win); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RW, &snd_win, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); int db_fc_threshold = 2000; -TUNABLE_INT("hw.iw_cxgbe.db_fc_threshold", &db_fc_threshold); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_fc_threshold, CTLFLAG_RW, &db_fc_threshold, 0, +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_fc_threshold, CTLFLAG_RWTUN, &db_fc_threshold, 0, "QP count/threshold that triggers automatic"); static void diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index 75902a7..7598376 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -132,7 +132,6 @@ static struct cdevsw drm_cdevsw = { }; static int drm_msi = 1; /* Enable by default. */ -TUNABLE_INT("hw.drm.msi", &drm_msi); SYSCTL_NODE(_hw, OID_AUTO, drm, CTLFLAG_RW, NULL, "DRM device"); SYSCTL_INT(_hw_drm, OID_AUTO, msi, CTLFLAG_RDTUN, &drm_msi, 1, "Enable MSI interrupts for drm devices"); diff --git a/sys/dev/drm/drm_sysctl.c b/sys/dev/drm/drm_sysctl.c index ce3e5b4..75d8306 100644 --- a/sys/dev/drm/drm_sysctl.c +++ b/sys/dev/drm/drm_sysctl.c @@ -70,7 +70,7 @@ int drm_sysctl_init(struct drm_device *dev) dev->sysctl = info; /* Add the sysctl node for DRI if it doesn't already exist */ - drioid = SYSCTL_ADD_NODE( &info->ctx, &sysctl__hw_children, OID_AUTO, "dri", CTLFLAG_RW, NULL, "DRI Graphics"); + drioid = SYSCTL_ADD_NODE(&info->ctx, SYSCTL_CHILDREN(&sysctl___hw), OID_AUTO, "dri", CTLFLAG_RW, NULL, "DRI Graphics"); if (!drioid) return 1; diff --git a/sys/dev/drm2/drm_drv.c b/sys/dev/drm2/drm_drv.c index 7b00bcf..81fcee3 100644 --- a/sys/dev/drm2/drm_drv.c +++ b/sys/dev/drm2/drm_drv.c @@ -203,7 +203,6 @@ static struct cdevsw drm_cdevsw = { }; static int drm_msi = 1; /* Enable by default. */ -TUNABLE_INT("hw.drm.msi", &drm_msi); SYSCTL_NODE(_hw, OID_AUTO, drm, CTLFLAG_RW, NULL, "DRM device"); SYSCTL_INT(_hw_drm, OID_AUTO, msi, CTLFLAG_RDTUN, &drm_msi, 1, "Enable MSI interrupts for drm devices"); diff --git a/sys/dev/drm2/drm_sysctl.c b/sys/dev/drm2/drm_sysctl.c index a30c7ab..aac21e6 100644 --- a/sys/dev/drm2/drm_sysctl.c +++ b/sys/dev/drm2/drm_sysctl.c @@ -68,7 +68,7 @@ int drm_sysctl_init(struct drm_device *dev) dev->sysctl = info; /* Add the sysctl node for DRI if it doesn't already exist */ - drioid = SYSCTL_ADD_NODE(&info->ctx, &sysctl__hw_children, OID_AUTO, + drioid = SYSCTL_ADD_NODE(&info->ctx, SYSCTL_CHILDREN(&sysctl___hw), OID_AUTO, "dri", CTLFLAG_RW, NULL, "DRI Graphics"); if (!drioid) return 1; diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index d44ad37..d2872cb 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -353,8 +353,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); static int em_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int em_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); -TUNABLE_INT("hw.em.tx_int_delay", &em_tx_int_delay_dflt); -TUNABLE_INT("hw.em.rx_int_delay", &em_rx_int_delay_dflt); SYSCTL_INT(_hw_em, OID_AUTO, tx_int_delay, CTLFLAG_RDTUN, &em_tx_int_delay_dflt, 0, "Default transmit interrupt delay in usecs"); SYSCTL_INT(_hw_em, OID_AUTO, rx_int_delay, CTLFLAG_RDTUN, &em_rx_int_delay_dflt, @@ -362,8 +360,6 @@ SYSCTL_INT(_hw_em, OID_AUTO, rx_int_delay, CTLFLAG_RDTUN, &em_rx_int_delay_dflt, static int em_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV); static int em_rx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_RADV); -TUNABLE_INT("hw.em.tx_abs_int_delay", &em_tx_abs_int_delay_dflt); -TUNABLE_INT("hw.em.rx_abs_int_delay", &em_rx_abs_int_delay_dflt); SYSCTL_INT(_hw_em, OID_AUTO, tx_abs_int_delay, CTLFLAG_RDTUN, &em_tx_abs_int_delay_dflt, 0, "Default transmit interrupt delay limit in usecs"); @@ -373,32 +369,26 @@ SYSCTL_INT(_hw_em, OID_AUTO, rx_abs_int_delay, CTLFLAG_RDTUN, static int em_rxd = EM_DEFAULT_RXD; static int em_txd = EM_DEFAULT_TXD; -TUNABLE_INT("hw.em.rxd", &em_rxd); -TUNABLE_INT("hw.em.txd", &em_txd); SYSCTL_INT(_hw_em, OID_AUTO, rxd, CTLFLAG_RDTUN, &em_rxd, 0, "Number of receive descriptors per queue"); SYSCTL_INT(_hw_em, OID_AUTO, txd, CTLFLAG_RDTUN, &em_txd, 0, "Number of transmit descriptors per queue"); static int em_smart_pwr_down = FALSE; -TUNABLE_INT("hw.em.smart_pwr_down", &em_smart_pwr_down); SYSCTL_INT(_hw_em, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &em_smart_pwr_down, 0, "Set to true to leave smart power down enabled on newer adapters"); /* Controls whether promiscuous also shows bad packets */ static int em_debug_sbp = FALSE; -TUNABLE_INT("hw.em.sbp", &em_debug_sbp); SYSCTL_INT(_hw_em, OID_AUTO, sbp, CTLFLAG_RDTUN, &em_debug_sbp, 0, "Show bad packets in promiscuous mode"); static int em_enable_msix = TRUE; -TUNABLE_INT("hw.em.enable_msix", &em_enable_msix); SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0, "Enable MSI-X interrupts"); /* How many packets rxeof tries to clean at a time */ static int em_rx_process_limit = 100; -TUNABLE_INT("hw.em.rx_process_limit", &em_rx_process_limit); SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, &em_rx_process_limit, 0, "Maximum number of received packets to process " @@ -406,7 +396,6 @@ SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, /* Energy efficient ethernet - default to OFF */ static int eee_setting = 1; -TUNABLE_INT("hw.em.eee_setting", &eee_setting); SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0, "Enable Energy Efficient Ethernet"); diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 38153f4..5c54c84 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -327,8 +327,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, igb, CTLFLAG_RD, 0, "IGB driver parameters"); /* Descriptor defaults */ static int igb_rxd = IGB_DEFAULT_RXD; static int igb_txd = IGB_DEFAULT_TXD; -TUNABLE_INT("hw.igb.rxd", &igb_rxd); -TUNABLE_INT("hw.igb.txd", &igb_txd); SYSCTL_INT(_hw_igb, OID_AUTO, rxd, CTLFLAG_RDTUN, &igb_rxd, 0, "Number of receive descriptors per queue"); SYSCTL_INT(_hw_igb, OID_AUTO, txd, CTLFLAG_RDTUN, &igb_txd, 0, @@ -341,8 +339,7 @@ SYSCTL_INT(_hw_igb, OID_AUTO, txd, CTLFLAG_RDTUN, &igb_txd, 0, ** traffic for that interrupt vector */ static int igb_enable_aim = TRUE; -TUNABLE_INT("hw.igb.enable_aim", &igb_enable_aim); -SYSCTL_INT(_hw_igb, OID_AUTO, enable_aim, CTLFLAG_RW, &igb_enable_aim, 0, +SYSCTL_INT(_hw_igb, OID_AUTO, enable_aim, CTLFLAG_RWTUN, &igb_enable_aim, 0, "Enable adaptive interrupt moderation"); /* @@ -350,7 +347,6 @@ SYSCTL_INT(_hw_igb, OID_AUTO, enable_aim, CTLFLAG_RW, &igb_enable_aim, 0, * but this allows it to be forced off for testing. */ static int igb_enable_msix = 1; -TUNABLE_INT("hw.igb.enable_msix", &igb_enable_msix); SYSCTL_INT(_hw_igb, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &igb_enable_msix, 0, "Enable MSI-X interrupts"); @@ -358,7 +354,6 @@ SYSCTL_INT(_hw_igb, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &igb_enable_msix, 0, ** Tuneable Interrupt rate */ static int igb_max_interrupt_rate = 8000; -TUNABLE_INT("hw.igb.max_interrupt_rate", &igb_max_interrupt_rate); SYSCTL_INT(_hw_igb, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &igb_max_interrupt_rate, 0, "Maximum interrupts per second"); @@ -367,7 +362,6 @@ SYSCTL_INT(_hw_igb, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, ** Tuneable number of buffers in the buf-ring (drbr_xxx) */ static int igb_buf_ring_size = IGB_BR_SIZE; -TUNABLE_INT("hw.igb.buf_ring_size", &igb_buf_ring_size); SYSCTL_INT(_hw_igb, OID_AUTO, buf_ring_size, CTLFLAG_RDTUN, &igb_buf_ring_size, 0, "Size of the bufring"); #endif @@ -381,7 +375,6 @@ SYSCTL_INT(_hw_igb, OID_AUTO, buf_ring_size, CTLFLAG_RDTUN, ** a very workload dependent type feature. */ static int igb_header_split = FALSE; -TUNABLE_INT("hw.igb.hdr_split", &igb_header_split); SYSCTL_INT(_hw_igb, OID_AUTO, header_split, CTLFLAG_RDTUN, &igb_header_split, 0, "Enable receive mbuf header split"); @@ -391,7 +384,6 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_split, CTLFLAG_RDTUN, &igb_header_split, 0, ** MSIX messages if left at 0. */ static int igb_num_queues = 0; -TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); SYSCTL_INT(_hw_igb, OID_AUTO, num_queues, CTLFLAG_RDTUN, &igb_num_queues, 0, "Number of queues to configure, 0 indicates autoconfigure"); @@ -404,7 +396,6 @@ static int igb_last_bind_cpu = -1; /* How many packets rxeof tries to clean at a time */ static int igb_rx_process_limit = 100; -TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); SYSCTL_INT(_hw_igb, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, &igb_rx_process_limit, 0, "Maximum number of received packets to process at a time, -1 means unlimited"); diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index 48067b6..c7c2d64 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -101,7 +101,6 @@ static video_adapter_t *vesa_adp; static SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); static int vesa_shadow_rom; -TUNABLE_INT("debug.vesa.shadow_rom", &vesa_shadow_rom); SYSCTL_INT(_debug_vesa, OID_AUTO, shadow_rom, CTLFLAG_RDTUN, &vesa_shadow_rom, 0, "Enable video BIOS shadow"); diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index ae753d5..4ac4302 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -78,14 +78,13 @@ #undef OHCI_DEBUG -static int nocyclemaster = 0; +static int nocyclemaster; int firewire_phydma_enable = 1; SYSCTL_DECL(_hw_firewire); -SYSCTL_INT(_hw_firewire, OID_AUTO, nocyclemaster, CTLFLAG_RW, &nocyclemaster, 0, - "Do not send cycle start packets"); -SYSCTL_INT(_hw_firewire, OID_AUTO, phydma_enable, CTLFLAG_RW, - &firewire_phydma_enable, 1, "Allow physical request DMA from firewire"); -TUNABLE_INT("hw.firewire.phydma_enable", &firewire_phydma_enable); +SYSCTL_INT(_hw_firewire, OID_AUTO, nocyclemaster, CTLFLAG_RWTUN, + &nocyclemaster, 0, "Do not send cycle start packets"); +SYSCTL_INT(_hw_firewire, OID_AUTO, phydma_enable, CTLFLAG_RWTUN, + &firewire_phydma_enable, 0, "Allow physical request DMA from firewire"); static char dbcode[16][0x10]={"OUTM", "OUTL","INPM","INPL", "STOR","LOAD","NOP ","STOP",}; diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index a7d9bc3..cb21cf6 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -88,21 +88,17 @@ static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; static MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); -SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RWTUN, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, "Ethernet emulation subsystem"); -SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RW, &stream_ch, 0, +SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RWTUN, &stream_ch, 0, "Stream channel to use"); -SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, tx_speed, CTLFLAG_RW, &tx_speed, 0, +SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, tx_speed, CTLFLAG_RWTUN, &tx_speed, 0, "Transmission speed"); -SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len, +SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, rx_queue_len, CTLFLAG_RWTUN, &rx_queue_len, 0, "Length of the receive queue"); -TUNABLE_INT("hw.firewire.fwe.stream_ch", &stream_ch); -TUNABLE_INT("hw.firewire.fwe.tx_speed", &tx_speed); -TUNABLE_INT("hw.firewire.fwe.rx_queue_len", &rx_queue_len); - #ifdef DEVICE_POLLING static poll_handler_t fwe_poll; diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index e98f44e..df3e1f6 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -105,11 +105,9 @@ SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, "Firewire ip subsystem"); -SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len, +SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RWTUN, &rx_queue_len, 0, "Length of the receive queue"); -TUNABLE_INT("hw.firewire.fwip.rx_queue_len", &rx_queue_len); - #ifdef DEVICE_POLLING static poll_handler_t fwip_poll; diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 10e8c60..eeca4c7 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -134,31 +134,23 @@ static int sbp_tags = 0; SYSCTL_DECL(_hw_firewire); static SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, "SBP-II Subsystem"); -SYSCTL_INT(_debug, OID_AUTO, sbp_debug, CTLFLAG_RW, &debug, 0, +SYSCTL_INT(_debug, OID_AUTO, sbp_debug, CTLFLAG_RWTUN, &debug, 0, "SBP debug flag"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, auto_login, CTLFLAG_RW, &auto_login, 0, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, auto_login, CTLFLAG_RWTUN, &auto_login, 0, "SBP perform login automatically"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, max_speed, CTLFLAG_RW, &max_speed, 0, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, max_speed, CTLFLAG_RWTUN, &max_speed, 0, "SBP transfer max speed"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, exclusive_login, CTLFLAG_RW, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, exclusive_login, CTLFLAG_RWTUN, &ex_login, 0, "SBP enable exclusive login"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, login_delay, CTLFLAG_RW, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, login_delay, CTLFLAG_RWTUN, &login_delay, 0, "SBP login delay in msec"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, scan_delay, CTLFLAG_RW, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, scan_delay, CTLFLAG_RWTUN, &scan_delay, 0, "SBP scan delay in msec"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, use_doorbell, CTLFLAG_RW, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, use_doorbell, CTLFLAG_RWTUN, &use_doorbell, 0, "SBP use doorbell request"); -SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, tags, CTLFLAG_RW, &sbp_tags, 0, +SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, tags, CTLFLAG_RWTUN, &sbp_tags, 0, "SBP tagged queuing support"); -TUNABLE_INT("hw.firewire.sbp.auto_login", &auto_login); -TUNABLE_INT("hw.firewire.sbp.max_speed", &max_speed); -TUNABLE_INT("hw.firewire.sbp.exclusive_login", &ex_login); -TUNABLE_INT("hw.firewire.sbp.login_delay", &login_delay); -TUNABLE_INT("hw.firewire.sbp.scan_delay", &scan_delay); -TUNABLE_INT("hw.firewire.sbp.use_doorbell", &use_doorbell); -TUNABLE_INT("hw.firewire.sbp.tags", &sbp_tags); - #define NEED_RESPONSE 0 #define SBP_SEG_MAX rounddown(0xffff, PAGE_SIZE) diff --git a/sys/dev/glxiic/glxiic.c b/sys/dev/glxiic/glxiic.c index 939c32d..95d8602 100644 --- a/sys/dev/glxiic/glxiic.c +++ b/sys/dev/glxiic/glxiic.c @@ -314,7 +314,6 @@ glxiic_attach(device_t dev) struct sysctl_oid *tree; int error, irq, unit; uint32_t irq_map; - char tn[32]; sc = device_get_softc(dev); sc->dev = dev; @@ -402,10 +401,8 @@ glxiic_attach(device_t dev) tree = device_get_sysctl_tree(dev); sc->timeout = GLXIIC_DEFAULT_TIMEOUT; - snprintf(tn, sizeof(tn), "dev.glxiic.%d.timeout", unit); - TUNABLE_INT_FETCH(tn, &sc->timeout); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "timeout", CTLFLAG_RW | CTLFLAG_TUN, &sc->timeout, 0, + "timeout", CTLFLAG_RWTUN, &sc->timeout, 0, "activity timeout in ms"); glxiic_gpio_enable(sc); diff --git a/sys/dev/hptmv/hptproc.c b/sys/dev/hptmv/hptproc.c index 93eff51..1141edc 100644 --- a/sys/dev/hptmv/hptproc.c +++ b/sys/dev/hptmv/hptproc.c @@ -617,7 +617,7 @@ out: NULL, 0, hpt_status, "A", "Get/Set " #name " state") #else #define hptregister_node(name) \ - SYSCTL_NODE(, OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ + SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ SYSCTL_OID(_ ## name, OID_AUTO, status, CTLTYPE_STRING|CTLFLAG_RW, \ NULL, 0, hpt_status, "A", "Get/Set " #name " state"); #endif diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index c9b8aea..ee5b897 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -66,8 +66,7 @@ SYSCTL_DECL(_kern_hwpmc); */ static int pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "logbuffersize", &pmclog_buffer_size); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, &pmclog_buffer_size, 0, "size of log buffers in kilobytes"); /* @@ -75,8 +74,7 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_TUN|CTLFLAG_RD, */ static int pmc_nlogbuffers = PMC_NLOGBUFFERS; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nbuffers", &pmc_nlogbuffers); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers, CTLFLAG_RDTUN, &pmc_nlogbuffers, 0, "number of global log buffers"); /* diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 8e5eac8..6241638 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -234,8 +234,7 @@ static void pmc_generic_cpu_finalize(struct pmc_mdep *md); SYSCTL_DECL(_kern_hwpmc); static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "callchaindepth", &pmc_callchaindepth); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, &pmc_callchaindepth, 0, "depth of call chain records"); #ifdef DEBUG @@ -244,7 +243,7 @@ char pmc_debugstr[PMC_DEBUG_STRSIZE]; TUNABLE_STR(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, sizeof(pmc_debugstr)); SYSCTL_PROC(_kern_hwpmc, OID_AUTO, debugflags, - CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_TUN, + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, 0, 0, pmc_debugflags_sysctl_handler, "A", "debug flags"); #endif @@ -254,8 +253,7 @@ SYSCTL_PROC(_kern_hwpmc, OID_AUTO, debugflags, */ static int pmc_hashsize = PMC_HASH_SIZE; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "hashsize", &pmc_hashsize); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, hashsize, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, hashsize, CTLFLAG_RDTUN, &pmc_hashsize, 0, "rows in hash tables"); /* @@ -263,8 +261,7 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, hashsize, CTLFLAG_TUN|CTLFLAG_RD, */ static int pmc_nsamples = PMC_NSAMPLES; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nsamples", &pmc_nsamples); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, nsamples, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, nsamples, CTLFLAG_RDTUN, &pmc_nsamples, 0, "number of PC samples per CPU"); @@ -273,8 +270,7 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, nsamples, CTLFLAG_TUN|CTLFLAG_RD, */ static int pmc_mtxpool_size = PMC_MTXPOOL_SIZE; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "mtxpoolsize", &pmc_mtxpool_size); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, mtxpoolsize, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, mtxpoolsize, CTLFLAG_RDTUN, &pmc_mtxpool_size, 0, "size of spin mutex pool"); @@ -288,8 +284,7 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, mtxpoolsize, CTLFLAG_TUN|CTLFLAG_RD, */ static int pmc_unprivileged_syspmcs = 0; -TUNABLE_INT("security.bsd.unprivileged_syspmcs", &pmc_unprivileged_syspmcs); -SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_syspmcs, CTLFLAG_RW, +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_syspmcs, CTLFLAG_RWTUN, &pmc_unprivileged_syspmcs, 0, "allow unprivileged process to allocate system PMCs"); diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c index 2b5e4d0..a22dd79 100644 --- a/sys/dev/iscsi/icl.c +++ b/sys/dev/iscsi/icl.c @@ -61,24 +61,19 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD, 0, "iSCSI Common Layer"); static int debug = 1; -TUNABLE_INT("kern.icl.debug", &debug); SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 0, "Enable debug messages"); static int coalesce = 1; -TUNABLE_INT("kern.icl.coalesce", &coalesce); SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 0, "Try to coalesce PDUs before sending"); static int partial_receive_len = 128 * 1024; -TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 0, "Minimum read size for partially received " "data segment"); static int sendspace = 1048576; -TUNABLE_INT("kern.icl.sendspace", &sendspace); SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, &sendspace, 0, "Default send socket buffer size"); static int recvspace = 1048576; -TUNABLE_INT("kern.icl.recvspace", &recvspace); SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 0, "Default receive socket buffer size"); diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index ad9ec7a..22f8462 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -78,27 +78,21 @@ static struct iscsi_softc *sc; SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLFLAG_RD, 0, "iSCSI initiator"); static int debug = 1; -TUNABLE_INT("kern.iscsi.debug", &debug); SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 0, "Enable debug messages"); static int ping_timeout = 5; -TUNABLE_INT("kern.iscsi.ping_timeout", &ping_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 0, "Timeout for ping (NOP-Out) requests, in seconds"); static int iscsid_timeout = 60; -TUNABLE_INT("kern.iscsi.iscsid_timeout", &iscsid_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RWTUN, &iscsid_timeout, 0, "Time to wait for iscsid(8) to handle reconnection, in seconds"); static int login_timeout = 60; -TUNABLE_INT("kern.iscsi.login_timeout", &login_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 0, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); static int maxtags = 255; -TUNABLE_INT("kern.iscsi.maxtags", &maxtags); SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, 0, "Max number of IO requests queued"); static int fail_on_disconnection = 0; -TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection); SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, &fail_on_disconnection, 0, "Destroy CAM SIM on connection failure"); diff --git a/sys/dev/iscsi_initiator/iscsi.c b/sys/dev/iscsi_initiator/iscsi.c index cd66a36..049c111 100644 --- a/sys/dev/iscsi_initiator/iscsi.c +++ b/sys/dev/iscsi_initiator/iscsi.c @@ -77,11 +77,11 @@ struct mtx iscsi_dbg_mtx; #endif static int max_sessions = MAX_SESSIONS; -SYSCTL_INT(_net, OID_AUTO, iscsi_initiator_max_sessions, CTLFLAG_RDTUN, &max_sessions, MAX_SESSIONS, - "Max sessions allowed"); +SYSCTL_INT(_net, OID_AUTO, iscsi_initiator_max_sessions, CTLFLAG_RDTUN, + &max_sessions, 0, "Max sessions allowed"); static int max_pdus = MAX_PDUS; -SYSCTL_INT(_net, OID_AUTO, iscsi_initiator_max_pdus, CTLFLAG_RDTUN, &max_pdus, MAX_PDUS, - "Max pdu pool"); +SYSCTL_INT(_net, OID_AUTO, iscsi_initiator_max_pdus, CTLFLAG_RDTUN, + &max_pdus, 0, "Max PDU pool"); static char isid[6+1] = { 0x80, @@ -711,9 +711,6 @@ iscsi_start(void) { debug_called(8); - TUNABLE_INT_FETCH("net.iscsi_initiator.max_sessions", &max_sessions); - TUNABLE_INT_FETCH("net.iscsi_initiator.max_pdus", &max_pdus); - isc = malloc(sizeof(struct isc_softc), M_ISCSI, M_ZERO|M_WAITOK); mtx_init(&isc->isc_mtx, "iscsi-isc", NULL, MTX_DEF); diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index fb0daa1..0eb334a 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -244,18 +244,15 @@ static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD, 0, ** traffic for that interrupt vector */ static int ixgbe_enable_aim = TRUE; -TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); -SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0, +SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RWTUN, &ixgbe_enable_aim, 0, "Enable adaptive interrupt moderation"); static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); -TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second"); /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, &ixgbe_rx_process_limit, 0, "Maximum number of received packets to process at a time," @@ -263,7 +260,6 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, /* How many packets txeof tries to clean at a time */ static int ixgbe_tx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, &ixgbe_tx_process_limit, 0, "Maximum number of sent packets to process at a time," @@ -283,7 +279,6 @@ static int ixgbe_smart_speed = ixgbe_smart_speed_on; * but this allows it to be forced off for testing. */ static int ixgbe_enable_msix = 1; -TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, "Enable MSI-X interrupts"); @@ -294,7 +289,6 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, * can be overriden manually here. */ static int ixgbe_num_queues = 0; -TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, "Number of queues to configure, 0 indicates autoconfigure"); @@ -304,13 +298,11 @@ SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, ** the better performing choice. */ static int ixgbe_txd = PERFORM_TXD; -TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, "Number of receive descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; -TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0, "Number of receive descriptors per queue"); diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index db8f61d..1e879ba 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -65,27 +65,22 @@ SYSCTL_NODE(_hw, OID_AUTO, malo, CTLFLAG_RD, 0, "Marvell 88w8335 driver parameters"); static int malo_txcoalesce = 8; /* # tx pkts to q before poking f/w*/ -SYSCTL_INT(_hw_malo, OID_AUTO, txcoalesce, CTLFLAG_RW, &malo_txcoalesce, +SYSCTL_INT(_hw_malo, OID_AUTO, txcoalesce, CTLFLAG_RWTUN, &malo_txcoalesce, 0, "tx buffers to send at once"); -TUNABLE_INT("hw.malo.txcoalesce", &malo_txcoalesce); static int malo_rxbuf = MALO_RXBUF; /* # rx buffers to allocate */ -SYSCTL_INT(_hw_malo, OID_AUTO, rxbuf, CTLFLAG_RW, &malo_rxbuf, +SYSCTL_INT(_hw_malo, OID_AUTO, rxbuf, CTLFLAG_RWTUN, &malo_rxbuf, 0, "rx buffers allocated"); -TUNABLE_INT("hw.malo.rxbuf", &malo_rxbuf); static int malo_rxquota = MALO_RXBUF; /* # max buffers to process */ -SYSCTL_INT(_hw_malo, OID_AUTO, rxquota, CTLFLAG_RW, &malo_rxquota, +SYSCTL_INT(_hw_malo, OID_AUTO, rxquota, CTLFLAG_RWTUN, &malo_rxquota, 0, "max rx buffers to process per interrupt"); -TUNABLE_INT("hw.malo.rxquota", &malo_rxquota); static int malo_txbuf = MALO_TXBUF; /* # tx buffers to allocate */ -SYSCTL_INT(_hw_malo, OID_AUTO, txbuf, CTLFLAG_RW, &malo_txbuf, +SYSCTL_INT(_hw_malo, OID_AUTO, txbuf, CTLFLAG_RWTUN, &malo_txbuf, 0, "tx buffers allocated"); -TUNABLE_INT("hw.malo.txbuf", &malo_txbuf); #ifdef MALO_DEBUG static int malo_debug = 0; -SYSCTL_INT(_hw_malo, OID_AUTO, debug, CTLFLAG_RW, &malo_debug, +SYSCTL_INT(_hw_malo, OID_AUTO, debug, CTLFLAG_RWTUN, &malo_debug, 0, "control debugging printfs"); -TUNABLE_INT("hw.malo.debug", &malo_debug); enum { MALO_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ MALO_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ diff --git a/sys/dev/malo/if_malo_pci.c b/sys/dev/malo/if_malo_pci.c index 71ba3c0..c9e6b20 100644 --- a/sys/dev/malo/if_malo_pci.c +++ b/sys/dev/malo/if_malo_pci.c @@ -86,9 +86,8 @@ static SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, "Marvell 88W8335 driver PCI parameters"); static int msi_disable = 0; /* MSI disabled */ -SYSCTL_INT(_hw_malo_pci, OID_AUTO, msi_disable, CTLFLAG_RW, &msi_disable, +SYSCTL_INT(_hw_malo_pci, OID_AUTO, msi_disable, CTLFLAG_RWTUN, &msi_disable, 0, "MSI disabled"); -TUNABLE_INT("hw.malo.pci.msi_disable", &msi_disable); /* * Devices supported by this driver. diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index 1a618ce..5ec813e 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -132,33 +132,27 @@ static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm); SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; -TUNABLE_INT("hw.mfi.event_locale", &mfi_event_locale); SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RWTUN, &mfi_event_locale, 0, "event message locale"); static int mfi_event_class = MFI_EVT_CLASS_INFO; -TUNABLE_INT("hw.mfi.event_class", &mfi_event_class); SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RWTUN, &mfi_event_class, 0, "event message class"); static int mfi_max_cmds = 128; -TUNABLE_INT("hw.mfi.max_cmds", &mfi_max_cmds); SYSCTL_INT(_hw_mfi, OID_AUTO, max_cmds, CTLFLAG_RDTUN, &mfi_max_cmds, 0, "Max commands limit (-1 = controller limit)"); static int mfi_detect_jbod_change = 1; -TUNABLE_INT("hw.mfi.detect_jbod_change", &mfi_detect_jbod_change); SYSCTL_INT(_hw_mfi, OID_AUTO, detect_jbod_change, CTLFLAG_RWTUN, &mfi_detect_jbod_change, 0, "Detect a change to a JBOD"); int mfi_polled_cmd_timeout = MFI_POLL_TIMEOUT_SECS; -TUNABLE_INT("hw.mfi.polled_cmd_timeout", &mfi_polled_cmd_timeout); SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd_timeout, CTLFLAG_RWTUN, &mfi_polled_cmd_timeout, 0, "Polled command timeout - used for firmware flash etc (in seconds)"); static int mfi_cmd_timeout = MFI_CMD_TIMEOUT; -TUNABLE_INT("hw.mfi.cmd_timeout", &mfi_cmd_timeout); SYSCTL_INT(_hw_mfi, OID_AUTO, cmd_timeout, CTLFLAG_RWTUN, &mfi_cmd_timeout, 0, "Command timeout (in seconds)"); diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c index 4fd6198..87f854c 100644 --- a/sys/dev/mfi/mfi_cam.c +++ b/sys/dev/mfi/mfi_cam.c @@ -90,8 +90,7 @@ static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); static int mfi_allow_disks = 0; -TUNABLE_INT("hw.mfi.allow_cam_disk_passthrough", &mfi_allow_disks); -SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RD, +SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RDTUN, &mfi_allow_disks, 0, "event message locale"); static devclass_t mfip_devclass; diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c index 803584e..80d655c 100644 --- a/sys/dev/mfi/mfi_pci.c +++ b/sys/dev/mfi/mfi_pci.c @@ -108,12 +108,10 @@ DRIVER_MODULE(mfi, pci, mfi_pci_driver, mfi_devclass, 0, 0); MODULE_VERSION(mfi, 1); static int mfi_msi = 1; -TUNABLE_INT("hw.mfi.msi", &mfi_msi); SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFLAG_RDTUN, &mfi_msi, 0, "Enable use of MSI interrupts"); -static int mfi_mrsas_enable = 0; -TUNABLE_INT("hw.mfi.mrsas_enable", &mfi_mrsas_enable); +static int mfi_mrsas_enable; SYSCTL_INT(_hw_mfi, OID_AUTO, mrsas_enable, CTLFLAG_RDTUN, &mfi_mrsas_enable, 0, "Allow mrasas to take newer cards"); @@ -186,7 +184,6 @@ mfi_pci_probe(device_t dev) device_set_desc(dev, id->desc); /* give priority to mrsas if tunable set */ - TUNABLE_INT_FETCH("hw.mfi.mrsas_enable", &mfi_mrsas_enable); if ((id->flags & MFI_FLAGS_MRSAS) && mfi_mrsas_enable) return (BUS_PROBE_LOW_PRIORITY); else diff --git a/sys/dev/mfi/mfi_tbolt.c b/sys/dev/mfi/mfi_tbolt.c index 2d27534..984c355 100644 --- a/sys/dev/mfi/mfi_tbolt.c +++ b/sys/dev/mfi/mfi_tbolt.c @@ -86,7 +86,6 @@ static void mfi_queue_map_sync(struct mfi_softc *sc); extern int mfi_polled_cmd_timeout; static int mfi_fw_reset_test = 0; #ifdef MFI_DEBUG -TUNABLE_INT("hw.mfi.fw_reset_test", &mfi_fw_reset_test); SYSCTL_INT(_hw_mfi, OID_AUTO, fw_reset_test, CTLFLAG_RWTUN, &mfi_fw_reset_test, 0, "Force a firmware reset condition"); #endif diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index b50e1a9..b5bd9bd 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -188,31 +188,25 @@ static int mwl_rxdesc = MWL_RXDESC; /* # rx desc's to allocate */ SYSCTL_INT(_hw_mwl, OID_AUTO, rxdesc, CTLFLAG_RW, &mwl_rxdesc, 0, "rx descriptors allocated"); static int mwl_rxbuf = MWL_RXBUF; /* # rx buffers to allocate */ -SYSCTL_INT(_hw_mwl, OID_AUTO, rxbuf, CTLFLAG_RW, &mwl_rxbuf, +SYSCTL_INT(_hw_mwl, OID_AUTO, rxbuf, CTLFLAG_RWTUN, &mwl_rxbuf, 0, "rx buffers allocated"); -TUNABLE_INT("hw.mwl.rxbuf", &mwl_rxbuf); static int mwl_txbuf = MWL_TXBUF; /* # tx buffers to allocate */ -SYSCTL_INT(_hw_mwl, OID_AUTO, txbuf, CTLFLAG_RW, &mwl_txbuf, +SYSCTL_INT(_hw_mwl, OID_AUTO, txbuf, CTLFLAG_RWTUN, &mwl_txbuf, 0, "tx buffers allocated"); -TUNABLE_INT("hw.mwl.txbuf", &mwl_txbuf); static int mwl_txcoalesce = 8; /* # tx packets to q before poking f/w*/ -SYSCTL_INT(_hw_mwl, OID_AUTO, txcoalesce, CTLFLAG_RW, &mwl_txcoalesce, +SYSCTL_INT(_hw_mwl, OID_AUTO, txcoalesce, CTLFLAG_RWTUN, &mwl_txcoalesce, 0, "tx buffers to send at once"); -TUNABLE_INT("hw.mwl.txcoalesce", &mwl_txcoalesce); static int mwl_rxquota = MWL_RXBUF; /* # max buffers to process */ -SYSCTL_INT(_hw_mwl, OID_AUTO, rxquota, CTLFLAG_RW, &mwl_rxquota, +SYSCTL_INT(_hw_mwl, OID_AUTO, rxquota, CTLFLAG_RWTUN, &mwl_rxquota, 0, "max rx buffers to process per interrupt"); -TUNABLE_INT("hw.mwl.rxquota", &mwl_rxquota); static int mwl_rxdmalow = 3; /* # min buffers for wakeup */ -SYSCTL_INT(_hw_mwl, OID_AUTO, rxdmalow, CTLFLAG_RW, &mwl_rxdmalow, +SYSCTL_INT(_hw_mwl, OID_AUTO, rxdmalow, CTLFLAG_RWTUN, &mwl_rxdmalow, 0, "min free rx buffers before restarting traffic"); -TUNABLE_INT("hw.mwl.rxdmalow", &mwl_rxdmalow); #ifdef MWL_DEBUG static int mwl_debug = 0; -SYSCTL_INT(_hw_mwl, OID_AUTO, debug, CTLFLAG_RW, &mwl_debug, +SYSCTL_INT(_hw_mwl, OID_AUTO, debug, CTLFLAG_RWTUN, &mwl_debug, 0, "control debugging printfs"); -TUNABLE_INT("hw.mwl.debug", &mwl_debug); enum { MWL_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ MWL_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ diff --git a/sys/dev/nand/nand.c b/sys/dev/nand/nand.c index fb83e67..113953e 100644 --- a/sys/dev/nand/nand.c +++ b/sys/dev/nand/nand.c @@ -65,18 +65,9 @@ __FBSDID("$FreeBSD$"); #define SOFTECC_BYTES 3 int nand_debug_flag = 0; -SYSCTL_INT(_debug, OID_AUTO, nand_debug, CTLFLAG_RW, &nand_debug_flag, 0, +SYSCTL_INT(_debug, OID_AUTO, nand_debug, CTLFLAG_RWTUN, &nand_debug_flag, 0, "NAND subsystem debug flag"); -static void -nand_tunable_init(void *arg) -{ - - TUNABLE_INT_FETCH("debug.nand", &nand_debug_flag); -} - -SYSINIT(nand_tunables, SI_SUB_VFS, SI_ORDER_ANY, nand_tunable_init, NULL); - MALLOC_DEFINE(M_NAND, "NAND", "NAND dynamic data"); static void calculate_ecc(const uint8_t *, uint8_t *); diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index 0c49d2f..87ab53a 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -62,14 +62,12 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); int pccard_debug = 0; -TUNABLE_INT("hw.pccard.debug", &pccard_debug); -SYSCTL_INT(_hw_pccard, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_pccard, OID_AUTO, debug, CTLFLAG_RWTUN, &pccard_debug, 0, "pccard debug"); int pccard_cis_debug = 0; -TUNABLE_INT("hw.pccard.cis_debug", &pccard_cis_debug); -SYSCTL_INT(_hw_pccard, OID_AUTO, cis_debug, CTLFLAG_RW, +SYSCTL_INT(_hw_pccard, OID_AUTO, cis_debug, CTLFLAG_RWTUN, &pccard_cis_debug, 0, "pccard CIS debug"); #ifdef PCCARDDEBUG diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 092d3ef..b724d05 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -134,26 +134,22 @@ static SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); /* There's no way to say TUNEABLE_LONG to get the right types */ u_long cbb_start_mem = CBB_START_MEM; -TUNABLE_ULONG("hw.cbb.start_memory", &cbb_start_mem); -SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_memory, CTLFLAG_RW, +SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_memory, CTLFLAG_RWTUN, &cbb_start_mem, CBB_START_MEM, "Starting address for memory allocations"); u_long cbb_start_16_io = CBB_START_16_IO; -TUNABLE_ULONG("hw.cbb.start_16_io", &cbb_start_16_io); -SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_16_io, CTLFLAG_RW, +SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_16_io, CTLFLAG_RWTUN, &cbb_start_16_io, CBB_START_16_IO, "Starting ioport for 16-bit cards"); u_long cbb_start_32_io = CBB_START_32_IO; -TUNABLE_ULONG("hw.cbb.start_32_io", &cbb_start_32_io); -SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_32_io, CTLFLAG_RW, +SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_32_io, CTLFLAG_RWTUN, &cbb_start_32_io, CBB_START_32_IO, "Starting ioport for 32-bit cards"); int cbb_debug = 0; -TUNABLE_INT("hw.cbb.debug", &cbb_debug); -SYSCTL_INT(_hw_cbb, OID_AUTO, debug, CTLFLAG_RW, &cbb_debug, 0, +SYSCTL_INT(_hw_cbb, OID_AUTO, debug, CTLFLAG_RWTUN, &cbb_debug, 0, "Verbose cardbus bridge debugging"); static void cbb_insert(struct cbb_softc *sc); diff --git a/sys/dev/pccbb/pccbb_isa.c b/sys/dev/pccbb/pccbb_isa.c index 1d0a698..c511062 100644 --- a/sys/dev/pccbb/pccbb_isa.c +++ b/sys/dev/pccbb/pccbb_isa.c @@ -74,8 +74,7 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; -TUNABLE_INT("hw.cbb.intr_mask", &isa_intr_mask); -SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RD, &isa_intr_mask, 0, +SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, "Mask of allowable interrupts for this laptop. The default is generally\n\ correct, but some laptops do not route all the IRQ pins to the bridge to\n\ save wires. Sometimes you need a more restrictive mask because some of the\n\ @@ -89,7 +88,6 @@ allocated."); * 2: 6729's method */ int pcic_pd6722_vsense = 1; -TUNABLE_INT("hw.pcic.pd6722_vsense", &pcic_pd6722_vsense); SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_RDTUN, &pcic_pd6722_vsense, 1, "Select CL-PD6722's VSENSE method. VSENSE is used to determine the\n\ diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index b2b5ff8..9733841 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -282,22 +282,20 @@ static int pcie_chipset, pcix_chipset; SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bus tuning parameters"); static int pci_enable_io_modes = 1; -TUNABLE_INT("hw.pci.enable_io_modes", &pci_enable_io_modes); -SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RW, +SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RWTUN, &pci_enable_io_modes, 1, "Enable I/O and memory bits in the config register. Some BIOSes do not\n\ enable these bits correctly. We'd like to do this all the time, but there\n\ are some peripherals that this causes problems with."); static int pci_do_realloc_bars = 0; -TUNABLE_INT("hw.pci.realloc_bars", &pci_do_realloc_bars); -SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW, +SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RWTUN, &pci_do_realloc_bars, 0, - "Attempt to allocate a new range for any BARs whose original firmware-assigned ranges fail to allocate during the initial device scan."); + "Attempt to allocate a new range for any BARs whose original " + "firmware-assigned ranges fail to allocate during the initial device scan."); static int pci_do_power_nodriver = 0; -TUNABLE_INT("hw.pci.do_power_nodriver", &pci_do_power_nodriver); -SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RW, +SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RWTUN, &pci_do_power_nodriver, 0, "Place a function into D3 state when no driver attaches to it. 0 means\n\ disable. 1 means conservatively place devices into D3 state. 2 means\n\ @@ -305,30 +303,25 @@ agressively place devices into D3 state. 3 means put absolutely everything\n\ in D3 state."); int pci_do_power_resume = 1; -TUNABLE_INT("hw.pci.do_power_resume", &pci_do_power_resume); -SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RW, +SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RWTUN, &pci_do_power_resume, 1, "Transition from D3 -> D0 on resume."); int pci_do_power_suspend = 1; -TUNABLE_INT("hw.pci.do_power_suspend", &pci_do_power_suspend); -SYSCTL_INT(_hw_pci, OID_AUTO, do_power_suspend, CTLFLAG_RW, +SYSCTL_INT(_hw_pci, OID_AUTO, do_power_suspend, CTLFLAG_RWTUN, &pci_do_power_suspend, 1, "Transition from D0 -> D3 on suspend."); static int pci_do_msi = 1; -TUNABLE_INT("hw.pci.enable_msi", &pci_do_msi); -SYSCTL_INT(_hw_pci, OID_AUTO, enable_msi, CTLFLAG_RW, &pci_do_msi, 1, +SYSCTL_INT(_hw_pci, OID_AUTO, enable_msi, CTLFLAG_RWTUN, &pci_do_msi, 1, "Enable support for MSI interrupts"); static int pci_do_msix = 1; -TUNABLE_INT("hw.pci.enable_msix", &pci_do_msix); -SYSCTL_INT(_hw_pci, OID_AUTO, enable_msix, CTLFLAG_RW, &pci_do_msix, 1, +SYSCTL_INT(_hw_pci, OID_AUTO, enable_msix, CTLFLAG_RWTUN, &pci_do_msix, 1, "Enable support for MSI-X interrupts"); static int pci_honor_msi_blacklist = 1; -TUNABLE_INT("hw.pci.honor_msi_blacklist", &pci_honor_msi_blacklist); -SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RD, +SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RDTUN, &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI/MSI-X"); #if defined(__i386__) || defined(__amd64__) @@ -336,26 +329,22 @@ static int pci_usb_takeover = 1; #else static int pci_usb_takeover = 0; #endif -TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover); SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); static int pci_clear_bars; -TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, "Ignore firmware-assigned resources for BARs."); #if defined(NEW_PCIB) && defined(PCI_RES_BUS) static int pci_clear_buses; -TUNABLE_INT("hw.pci.clear_buses", &pci_clear_buses); SYSCTL_INT(_hw_pci, OID_AUTO, clear_buses, CTLFLAG_RDTUN, &pci_clear_buses, 0, "Ignore firmware-assigned bus numbers."); #endif static int pci_enable_ari = 1; -TUNABLE_INT("hw.pci.enable_ari", &pci_enable_ari); SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, 0, "Enable support for PCIe Alternative RID Interpretation"); diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 8b50219..3c5842b 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -117,7 +117,6 @@ DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); SYSCTL_DECL(_hw_pci); static int pci_clear_pcib; -TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index 6e733f5..46f3250 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -71,7 +71,6 @@ static int vga_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int vga_pci_default_unit = -1; -TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit); SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN, &vga_pci_default_unit, -1, "Default VGA-compatible display"); diff --git a/sys/dev/puc/puc_pci.c b/sys/dev/puc/puc_pci.c index d6d5509..618a3ae 100644 --- a/sys/dev/puc/puc_pci.c +++ b/sys/dev/puc/puc_pci.c @@ -80,8 +80,7 @@ __FBSDID("$FreeBSD$"); #include <dev/puc/puc_bfe.h> static int puc_msi_disable; -TUNABLE_INT("hw.puc.msi_disable", &puc_msi_disable); -SYSCTL_INT(_hw_puc, OID_AUTO, msi_disable, CTLFLAG_RD | CTLFLAG_TUN, +SYSCTL_INT(_hw_puc, OID_AUTO, msi_disable, CTLFLAG_RDTUN, &puc_msi_disable, 0, "Disable use of MSI interrupts by puc(9)"); static const struct puc_cfg * diff --git a/sys/dev/rt/if_rt.c b/sys/dev/rt/if_rt.c index 5f62fec..aaf84f3 100644 --- a/sys/dev/rt/if_rt.c +++ b/sys/dev/rt/if_rt.c @@ -140,9 +140,8 @@ static void rt_ifmedia_sts(struct ifnet *, struct ifmediareq *); static SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); #ifdef IF_RT_DEBUG static int rt_debug = 0; -SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLFLAG_RW, &rt_debug, 0, +SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLFLAG_RWTUN, &rt_debug, 0, "RT debug level"); -TUNABLE_INT("hw.rt.debug", &rt_debug); #endif static int diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index b8e03be..18fbf1e 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -67,8 +67,7 @@ struct sdhci_softc { static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); int sdhci_debug = 0; -TUNABLE_INT("hw.sdhci.debug", &sdhci_debug); -SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RW, &sdhci_debug, 0, "Debug level"); +SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, "Debug level"); #define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) #define RD2(slot, off) SDHCI_READ_2((slot)->bus, (slot), (off)) diff --git a/sys/dev/sdhci/sdhci_pci.c b/sys/dev/sdhci/sdhci_pci.c index b8d8530..9e7e471 100644 --- a/sys/dev/sdhci/sdhci_pci.c +++ b/sys/dev/sdhci/sdhci_pci.c @@ -124,8 +124,7 @@ struct sdhci_pci_softc { static SYSCTL_NODE(_hw, OID_AUTO, sdhci_pci, CTLFLAG_RD, 0, "sdhci PCI driver"); int sdhci_pci_debug; -TUNABLE_INT("hw.sdhci_pci.debug", &sdhci_pci_debug); -SYSCTL_INT(_hw_sdhci_pci, OID_AUTO, debug, CTLFLAG_RW, &sdhci_pci_debug, 0, "Debug level"); +SYSCTL_INT(_hw_sdhci_pci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_pci_debug, 0, "Debug level"); static uint8_t sdhci_pci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index c9d1c83..de3eadf 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -119,8 +119,7 @@ static int si_Nports; static int si_Nmodules; static int si_debug; -SYSCTL_INT(_machdep, OID_AUTO, si_debug, CTLFLAG_RW, &si_debug, 0, ""); -TUNABLE_INT("machdep.si_debug", &si_debug); +SYSCTL_INT(_machdep, OID_AUTO, si_debug, CTLFLAG_RWTUN, &si_debug, 0, ""); static int si_numunits; diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index d187a2b..324a80b 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -372,7 +372,7 @@ sysctl_machdep_comdefaultrate(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, 0, 0, sysctl_machdep_comdefaultrate, "I", ""); TUNABLE_INT("machdep.conspeed", __DEVOLATILE(int *, &comdefaultrate)); diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c index 09e2242..4a95af6 100644 --- a/sys/dev/sis/if_sis.c +++ b/sys/dev/sis/if_sis.c @@ -2361,7 +2361,6 @@ sis_add_sysctls(struct sis_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; - char tn[32]; int unit; ctx = device_get_sysctl_ctx(sc->sis_dev); @@ -2376,10 +2375,8 @@ sis_add_sysctls(struct sis_softc *sc) * because it will consume extra CPU cycles for short frames. */ sc->sis_manual_pad = 0; - snprintf(tn, sizeof(tn), "dev.sis.%d.manual_pad", unit); - TUNABLE_INT_FETCH(tn, &sc->sis_manual_pad); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "manual_pad", - CTLFLAG_RW, &sc->sis_manual_pad, 0, "Manually pad short frames"); + CTLFLAG_RWTUN, &sc->sis_manual_pad, 0, "Manually pad short frames"); } static device_method_t sis_methods[] = { diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 75b02d0..41fbee2 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -119,8 +119,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RW, #endif static int chn_vpc_autoreset = 1; -TUNABLE_INT("hw.snd.vpc_autoreset", &chn_vpc_autoreset); -SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RWTUN, &chn_vpc_autoreset, 0, "automatically reset channels volume to 0db"); static int chn_vol_0db_pcm = SND_VOL_0DB_PCM; diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 92a1cf5..a647269 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -125,8 +125,7 @@ static uint32_t *feeder_chain_formats[FEEDER_CHAIN_LAST] = { static int feeder_chain_mode = FEEDER_CHAIN_DEFAULT; #if defined(_KERNEL) && defined(SND_DEBUG) && defined(SND_FEEDER_FULL_MULTIFORMAT) -TUNABLE_INT("hw.snd.feeder_chain_mode", &feeder_chain_mode); -SYSCTL_INT(_hw_snd, OID_AUTO, feeder_chain_mode, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, feeder_chain_mode, CTLFLAG_RWTUN, &feeder_chain_mode, 0, "feeder chain mode " "(0=lean, 1=16bit, 2=32bit, 3=multiformat, 4=fullmultiformat)"); diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index dee38a3..b4a92c9 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -97,8 +97,7 @@ static char feeder_eq_presets[] = FEEDER_EQ_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD, &feeder_eq_presets, 0, "compile-time eq presets"); -TUNABLE_INT("hw.snd.feeder_eq_exact_rate", &feeder_eq_exact_rate); -SYSCTL_INT(_hw_snd, OID_AUTO, feeder_eq_exact_rate, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, feeder_eq_exact_rate, CTLFLAG_RWTUN, &feeder_eq_exact_rate, 0, "force exact rate validation"); #endif diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index cb30dd9..d521fd1 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -168,8 +168,7 @@ TUNABLE_INT("hw.snd.feeder_rate_max", &feeder_rate_max); TUNABLE_INT("hw.snd.feeder_rate_round", &feeder_rate_round); TUNABLE_INT("hw.snd.feeder_rate_quality", &feeder_rate_quality); -TUNABLE_INT("hw.snd.feeder_rate_polyphase_max", &feeder_rate_polyphase_max); -SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RWTUN, &feeder_rate_polyphase_max, 0, "maximum allowable polyphase entries"); static int diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 8f9a5fb..42ddd11 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -40,8 +40,7 @@ SND_DECLARE_FILE("$FreeBSD$"); static MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); static int mixer_bypass = 1; -TUNABLE_INT("hw.snd.vpc_mixer_bypass", &mixer_bypass); -SYSCTL_INT(_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RWTUN, &mixer_bypass, 0, "control channel pcm/rec volume, bypassing real mixer device"); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index a7edad5..8b43879 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -52,8 +52,7 @@ int snd_unit = -1; TUNABLE_INT("hw.snd.default_unit", &snd_unit); static int snd_unit_auto = -1; -TUNABLE_INT("hw.snd.default_auto", &snd_unit_auto); -SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN, &snd_unit_auto, 0, "assign default unit to a newly attached device"); int snd_maxautovchans = 16; diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 1af8cb2..6c798cc 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -103,17 +103,11 @@ static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW, &uaudio_debug, 0, "uaudio debug level"); - -TUNABLE_INT("hw.usb.uaudio.default_rate", &uaudio_default_rate); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RWTUN, &uaudio_default_rate, 0, "uaudio default sample rate"); - -TUNABLE_INT("hw.usb.uaudio.default_bits", &uaudio_default_bits); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RWTUN, &uaudio_default_bits, 0, "uaudio default sample bits"); - -TUNABLE_INT("hw.usb.uaudio.default_channels", &uaudio_default_channels); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, &uaudio_default_channels, 0, "uaudio default sample channels"); #endif diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 35b3ca8..6a19523 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -154,8 +154,7 @@ SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_reboot, CTLFLAG_RW|CTLFLAG_SECURE, &enable SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_debug, CTLFLAG_RW|CTLFLAG_SECURE, &enable_kdbkey, 0, "enable keyboard debug"); #endif -TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch); -SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW, +SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RWTUN, &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) #include "font.h" diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 773cb44..89f7840 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -55,9 +55,8 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_RCLK 1843200 static int broken_txfifo = 0; -SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RWTUN, &broken_txfifo, 0, "UART FIFO has QEMU emulation bug"); -TUNABLE_INT("hw.broken_txfifo", &broken_txfifo); /* * Clear pending interrupts. THRE is cleared by reading IIR. Data diff --git a/sys/dev/usb/controller/dwc_otg.c b/sys/dev/usb/controller/dwc_otg.c index ed88caa..b90fbf5 100644 --- a/sys/dev/usb/controller/dwc_otg.c +++ b/sys/dev/usb/controller/dwc_otg.c @@ -112,14 +112,13 @@ static int dwc_otg_use_hsic; static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); -SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RDTUN, &dwc_otg_use_hsic, 0, "DWC OTG uses HSIC interface"); -TUNABLE_INT("hw.usb.dwc_otg.use_hsic", &dwc_otg_use_hsic); #ifdef USB_DEBUG static int dwc_otg_debug; -SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, debug, CTLFLAG_RWTUN, &dwc_otg_debug, 0, "DWC OTG debug level"); #endif diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c index ad3a3fc..7d0d5ab 100644 --- a/sys/dev/usb/controller/ehci.c +++ b/sys/dev/usb/controller/ehci.c @@ -98,19 +98,14 @@ static int ehciiaadbug = 0; static int ehcilostintrbug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RWTUN, &ehcidebug, 0, "Debug level"); -TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RWTUN, &ehcinohighspeed, 0, "Disable High Speed USB"); -TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RWTUN, &ehciiaadbug, 0, "Enable doorbell bug workaround"); -TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RWTUN, &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); -TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug); - static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c index 86fca1e..206c753 100644 --- a/sys/dev/usb/controller/ohci.c +++ b/sys/dev/usb/controller/ohci.c @@ -84,9 +84,8 @@ static int ohcidebug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); -SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RWTUN, &ohcidebug, 0, "ohci debug level"); -TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); static void ohci_dumpregs(ohci_softc_t *); static void ohci_dump_tds(ohci_td_t *); diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c index 134a447..0077615 100644 --- a/sys/dev/usb/controller/uhci.c +++ b/sys/dev/usb/controller/uhci.c @@ -89,12 +89,10 @@ static int uhcidebug = 0; static int uhcinoloop = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RWTUN, &uhcidebug, 0, "uhci debug level"); -TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RWTUN, &uhcinoloop, 0, "uhci noloop"); -TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); static void uhci_dumpregs(uhci_softc_t *sc); static void uhci_dump_tds(uhci_td_t *td); diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index c2cafec..dd75ba7 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -90,19 +90,16 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RW, &usb_ctrl_debug, 0, #if USB_HAVE_ROOT_MOUNT_HOLD static int usb_no_boot_wait = 0; -TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RD|CTLFLAG_TUN, &usb_no_boot_wait, 0, +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); #endif static int usb_no_suspend_wait = 0; -TUNABLE_INT("hw.usb.no_suspend_wait", &usb_no_suspend_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_suspend_wait, CTLFLAG_RW|CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, no_suspend_wait, CTLFLAG_RWTUN, &usb_no_suspend_wait, 0, "No USB device waiting at system suspend."); static int usb_no_shutdown_wait = 0; -TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RWTUN, &usb_no_shutdown_wait, 0, "No USB device waiting at system shutdown."); static devclass_t usb_devclass; diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 4570ad2..cdfa7d4 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -90,24 +90,20 @@ static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); static int xhcistreams; -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RWTUN, &xhcistreams, 0, "Set to enable streams mode support"); -TUNABLE_INT("hw.usb.xhci.streams", &xhcistreams); #ifdef USB_DEBUG static int xhcidebug; static int xhciroute; static int xhcipolling; -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RWTUN, &xhcidebug, 0, "Debug level"); -TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RWTUN, &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); -TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RWTUN, &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); -TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); #else #define xhciroute 0 #endif diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index ede27f7..0e56d96 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -95,15 +95,12 @@ static int ukbd_no_leds = 0; static int ukbd_pollrate = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB keyboard"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RWTUN, &ukbd_debug, 0, "Debug level"); -TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, &ukbd_no_leds, 0, "Disables setting of keyboard leds"); -TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, pollrate, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, pollrate, CTLFLAG_RWTUN, &ukbd_pollrate, 0, "Force this polling rate, 1-1000Hz"); -TUNABLE_INT("hw.usb.ukbd.pollrate", &ukbd_pollrate); #endif #define UKBD_EMULATE_ATSCANCODE 1 diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index 25da9b8..74e11dd 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -932,7 +932,6 @@ static const struct jtag_by_name { * creation of tty devices for jtag interfaces. Enabled by default. */ static int skip_jtag_interfaces = 1; -TUNABLE_INT("hw.usb.uftdi.skip_jtag_interfaces", &skip_jtag_interfaces); SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, skip_jtag_interfaces, CTLFLAG_RWTUN, &skip_jtag_interfaces, 1, "Skip creating tty devices for jtag interfaces"); diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index 2945415..53c0594 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -119,14 +119,11 @@ static int ucom_cons_subunit = 0; static int ucom_cons_baud = 9600; static struct ucom_softc *ucom_cons_softc = NULL; -TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RWTUN, &ucom_cons_unit, 0, "console unit number"); -TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RWTUN, &ucom_cons_subunit, 0, "console subunit number"); -TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RWTUN, &ucom_cons_baud, 0, "console baud rate"); static usb_proc_callback_t ucom_cfg_start_transfers; diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index f3a51b3..e169abb 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -167,12 +167,10 @@ static int umass_debug; static int umass_throttle; static SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); -SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RWTUN, &umass_debug, 0, "umass debug level"); -TUNABLE_INT("hw.usb.umass.debug", &umass_debug); -SYSCTL_INT(_hw_usb_umass, OID_AUTO, throttle, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_umass, OID_AUTO, throttle, CTLFLAG_RWTUN, &umass_throttle, 0, "Forced delay between commands in milliseconds"); -TUNABLE_INT("hw.usb.umass.throttle", &umass_throttle); #else #define DIF(...) do { } while (0) #define DPRINTF(...) do { } while (0) diff --git a/sys/dev/usb/usb_debug.c b/sys/dev/usb/usb_debug.c index 3382988..9c7fa6e 100644 --- a/sys/dev/usb/usb_debug.c +++ b/sys/dev/usb/usb_debug.c @@ -67,9 +67,8 @@ int usb_debug = 0; SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_RW, 0, "USB debugging"); -SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RWTUN, &usb_debug, 0, "Debug level"); -TUNABLE_INT("hw.usb.debug", &usb_debug); #ifdef USB_DEBUG /* @@ -78,44 +77,34 @@ TUNABLE_INT("hw.usb.debug", &usb_debug); static SYSCTL_NODE(_hw_usb, OID_AUTO, timings, CTLFLAG_RW, 0, "Timings"); static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS); -TUNABLE_INT("hw.usb.timings.port_reset_delay", (int *)&usb_port_reset_delay); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_delay, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_port_reset_delay, sizeof(usb_port_reset_delay), usb_timings_sysctl_handler, "IU", "Port Reset Delay"); -TUNABLE_INT("hw.usb.timings.port_root_reset_delay", (int *)&usb_port_root_reset_delay); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_root_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_root_reset_delay, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_port_root_reset_delay, sizeof(usb_port_root_reset_delay), usb_timings_sysctl_handler, "IU", "Root Port Reset Delay"); -TUNABLE_INT("hw.usb.timings.port_reset_recovery", (int *)&usb_port_reset_recovery); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_recovery, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_port_reset_recovery, sizeof(usb_port_reset_recovery), usb_timings_sysctl_handler, "IU", "Port Reset Recovery"); -TUNABLE_INT("hw.usb.timings.port_powerup_delay", (int *)&usb_port_powerup_delay); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_powerup_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_powerup_delay, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_port_powerup_delay, sizeof(usb_port_powerup_delay), usb_timings_sysctl_handler, "IU", "Port PowerUp Delay"); -TUNABLE_INT("hw.usb.timings.port_resume_delay", (int *)&usb_port_resume_delay); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_resume_delay, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_port_resume_delay, sizeof(usb_port_resume_delay), usb_timings_sysctl_handler, "IU", "Port Resume Delay"); -TUNABLE_INT("hw.usb.timings.set_address_settle", (int *)&usb_set_address_settle); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, set_address_settle, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, set_address_settle, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_set_address_settle, sizeof(usb_set_address_settle), usb_timings_sysctl_handler, "IU", "Set Address Settle"); -TUNABLE_INT("hw.usb.timings.resume_delay", (int *)&usb_resume_delay); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_delay, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_resume_delay, sizeof(usb_resume_delay), usb_timings_sysctl_handler, "IU", "Resume Delay"); -TUNABLE_INT("hw.usb.timings.resume_wait", (int *)&usb_resume_wait); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_wait, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_wait, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_resume_wait, sizeof(usb_resume_wait), usb_timings_sysctl_handler, "IU", "Resume Wait"); -TUNABLE_INT("hw.usb.timings.resume_recovery", (int *)&usb_resume_recovery); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_recovery, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_resume_recovery, sizeof(usb_resume_recovery), usb_timings_sysctl_handler, "IU", "Resume Recovery"); -TUNABLE_INT("hw.usb.timings.extra_power_up_time", (int *)&usb_extra_power_up_time); -SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RWTUN, &usb_extra_power_up_time, sizeof(usb_extra_power_up_time), usb_timings_sysctl_handler, "IU", "Extra PowerUp Time"); #endif diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 6ad02a7..3960673 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -86,9 +86,8 @@ static int usb_fifo_debug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); -SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RWTUN, &usb_fifo_debug, 0, "Debug Level"); -TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif #if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \ diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 7acb5cb..1acfd1e 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -118,8 +118,7 @@ int usb_template = USB_TEMPLATE; int usb_template; #endif -TUNABLE_INT("hw.usb.usb_template", &usb_template); -SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RWTUN, &usb_template, 0, "Selected USB device side template"); /* English is default language */ @@ -127,12 +126,10 @@ SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, static int usb_lang_id = 0x0009; static int usb_lang_mask = 0x00FF; -TUNABLE_INT("hw.usb.usb_lang_id", &usb_lang_id); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RWTUN, &usb_lang_id, 0, "Preferred USB language ID"); -TUNABLE_INT("hw.usb.usb_lang_mask", &usb_lang_mask); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RWTUN, &usb_lang_mask, 0, "Preferred USB language mask"); static const char* statestr[USB_STATE_MAX] = { diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c index 4ebd557..96dfe8b 100644 --- a/sys/dev/usb/usb_generic.c +++ b/sys/dev/usb/usb_generic.c @@ -131,9 +131,8 @@ struct usb_fifo_methods usb_ugen_methods = { static int ugen_debug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); -SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ugen_debug, +SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RWTUN, &ugen_debug, 0, "Debug level"); -TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index e9c9a42..8e0d557 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -86,9 +86,8 @@ enum { static int uhub_debug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); -SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhub_debug, 0, +SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RWTUN, &uhub_debug, 0, "Debug level"); -TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif #if USB_HAVE_POWERD diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c index e70166c..683c700 100644 --- a/sys/dev/usb/usb_process.c +++ b/sys/dev/usb/usb_process.c @@ -90,9 +90,8 @@ static int usb_pcount; static int usb_proc_debug; static SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); -SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_proc_debug, 0, +SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RWTUN, &usb_proc_debug, 0, "Debug level"); -TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif /*------------------------------------------------------------------------* diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 9db1e04..b8e8863 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -115,18 +115,16 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw_usb, OID_AUTO, uath, CTLFLAG_RW, 0, "USB Atheros"); static int uath_countrycode = CTRY_DEFAULT; /* country code */ -SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW | CTLFLAG_TUN, &uath_countrycode, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RWTUN, &uath_countrycode, 0, "country code"); -TUNABLE_INT("hw.usb.uath.countrycode", &uath_countrycode); static int uath_regdomain = 0; /* regulatory domain */ SYSCTL_INT(_hw_usb_uath, OID_AUTO, regdomain, CTLFLAG_RD, &uath_regdomain, 0, "regulatory domain"); #ifdef UATH_DEBUG int uath_debug = 0; -SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uath_debug, 0, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RWTUN, &uath_debug, 0, "uath debug level"); -TUNABLE_INT("hw.usb.uath.debug", &uath_debug); enum { UATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ UATH_DEBUG_XMIT_DUMP = 0x00000002, /* xmit dump */ diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index a860a2b..51f4ed9 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -76,9 +76,8 @@ static SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG_RD, 0, #ifdef UPGT_DEBUG int upgt_debug = 0; -SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &upgt_debug, +SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RWTUN, &upgt_debug, 0, "control debugging printfs"); -TUNABLE_INT("hw.upgt.debug", &upgt_debug); enum { UPGT_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ UPGT_DEBUG_RECV = 0x00000002, /* basic recv operation */ diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index a5516339..d283732 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -65,9 +65,8 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); #ifdef URTW_DEBUG int urtw_debug = 0; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &urtw_debug, 0, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RWTUN, &urtw_debug, 0, "control debugging printfs"); -TUNABLE_INT("hw.usb.urtw.debug", &urtw_debug); enum { URTW_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ URTW_DEBUG_RECV = 0x00000002, /* basic recv operation */ @@ -90,9 +89,8 @@ enum { } while (0) #endif static int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RWTUN, &urtw_preamble_mode, 0, "set the preable mode (long or short)"); -TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode); /* recognized device vendors/products */ #define urtw_lookup(v, p) \ diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h index b216499..cd6aa5b 100644 --- a/sys/dev/vt/vt.h +++ b/sys/dev/vt/vt.h @@ -84,9 +84,8 @@ #define VT_SYSCTL_INT(_name, _default, _descr) \ static int vt_##_name = _default; \ -SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RW, &vt_##_name, _default,\ - _descr); \ -TUNABLE_INT("kern.vt." #_name, &vt_##_name); +SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, _default,\ + _descr); struct vt_driver; diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index efbcb29..6e4428b 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -130,9 +130,8 @@ enum { WPI_DEBUG_ANY = 0xffffffff }; -static int wpi_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, wpi, CTLFLAG_RW, &wpi_debug, 0, "wpi debug level"); -TUNABLE_INT("debug.wpi", &wpi_debug); +static int wpi_debug; +SYSCTL_INT(_debug, OID_AUTO, wpi, CTLFLAG_RWTUN, &wpi_debug, 0, "wpi debug level"); #else #define DPRINTF(x) diff --git a/sys/gdb/gdb_cons.c b/sys/gdb/gdb_cons.c index ff74665..47f453f 100644 --- a/sys/gdb/gdb_cons.c +++ b/sys/gdb/gdb_cons.c @@ -58,9 +58,8 @@ struct gdbcons { static struct gdbcons state = { -1 }; static int gdbcons_enable = 0; -SYSCTL_INT(_debug, OID_AUTO, gdbcons, CTLFLAG_RW, &gdbcons_enable, - 0, "copy console messages to gdb"); -TUNABLE_INT("debug.gdbcons", &gdbcons_enable); +SYSCTL_INT(_debug, OID_AUTO, gdbcons, CTLFLAG_RWTUN, &gdbcons_enable, + 0, "copy console messages to GDB"); static void gdb_cnprobe(struct consdev *cp) diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c index 2efc1b5..4627ff9 100644 --- a/sys/geom/concat/g_concat.c +++ b/sys/geom/concat/g_concat.c @@ -48,8 +48,7 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, concat, CTLFLAG_RW, 0, "GEOM_CONCAT stuff"); static u_int g_concat_debug = 0; -TUNABLE_INT("kern.geom.concat.debug", &g_concat_debug); -SYSCTL_UINT(_kern_geom_concat, OID_AUTO, debug, CTLFLAG_RW, &g_concat_debug, 0, +SYSCTL_UINT(_kern_geom_concat, OID_AUTO, debug, CTLFLAG_RWTUN, &g_concat_debug, 0, "Debug level"); static int g_concat_destroy(struct g_concat_softc *sc, boolean_t force); diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index d1f3cd2..2c4dc2c 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -63,29 +63,23 @@ static int g_eli_version = G_ELI_VERSION; SYSCTL_INT(_kern_geom_eli, OID_AUTO, version, CTLFLAG_RD, &g_eli_version, 0, "GELI version"); int g_eli_debug = 0; -TUNABLE_INT("kern.geom.eli.debug", &g_eli_debug); -SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0, +SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RWTUN, &g_eli_debug, 0, "Debug level"); static u_int g_eli_tries = 3; -TUNABLE_INT("kern.geom.eli.tries", &g_eli_tries); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, tries, CTLFLAG_RW, &g_eli_tries, 0, +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, tries, CTLFLAG_RWTUN, &g_eli_tries, 0, "Number of tries for entering the passphrase"); static u_int g_eli_visible_passphrase = GETS_NOECHO; -TUNABLE_INT("kern.geom.eli.visible_passphrase", &g_eli_visible_passphrase); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RWTUN, &g_eli_visible_passphrase, 0, "Visibility of passphrase prompt (0 = invisible, 1 = visible, 2 = asterisk)"); u_int g_eli_overwrites = G_ELI_OVERWRITES; -TUNABLE_INT("kern.geom.eli.overwrites", &g_eli_overwrites); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RW, &g_eli_overwrites, +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RWTUN, &g_eli_overwrites, 0, "Number of times on-disk keys should be overwritten when destroying them"); static u_int g_eli_threads = 0; -TUNABLE_INT("kern.geom.eli.threads", &g_eli_threads); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RW, &g_eli_threads, 0, +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RWTUN, &g_eli_threads, 0, "Number of threads doing crypto work"); u_int g_eli_batch = 0; -TUNABLE_INT("kern.geom.eli.batch", &g_eli_batch); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RW, &g_eli_batch, 0, +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RWTUN, &g_eli_batch, 0, "Use crypto operations batching"); static eventhandler_tag g_eli_pre_sync = NULL; diff --git a/sys/geom/eli/g_eli_key_cache.c b/sys/geom/eli/g_eli_key_cache.c index 9530495..cb86716 100644 --- a/sys/geom/eli/g_eli_key_cache.c +++ b/sys/geom/eli/g_eli_key_cache.c @@ -47,7 +47,6 @@ SYSCTL_DECL(_kern_geom_eli); * provider with 512 bytes sectors and will take around 1MB of memory. */ static u_int g_eli_key_cache_limit = 8192; -TUNABLE_INT("kern.geom.eli.key_cache_limit", &g_eli_key_cache_limit); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, key_cache_limit, CTLFLAG_RDTUN, &g_eli_key_cache_limit, 0, "Maximum number of encryption keys to cache"); static uint64_t g_eli_key_cache_hits; diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c index eed4abb..ae0d7b0 100644 --- a/sys/geom/gate/g_gate.c +++ b/sys/geom/gate/g_gate.c @@ -62,11 +62,9 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0, "GEOM_GATE configuration"); static int g_gate_debug = 0; -TUNABLE_INT("kern.geom.gate.debug", &g_gate_debug); -SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, +SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RWTUN, &g_gate_debug, 0, "Debug level"); static u_int g_gate_maxunits = 256; -TUNABLE_INT("kern.geom.gate.maxunits", &g_gate_maxunits); SYSCTL_UINT(_kern_geom_gate, OID_AUTO, maxunits, CTLFLAG_RDTUN, &g_gate_maxunits, 0, "Maximum number of ggate devices"); diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index eb72597..5cfdaf0 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -561,12 +561,9 @@ g_disk_create(void *arg, int flag) SYSCTL_STATIC_CHILDREN(_kern_geom_disk), OID_AUTO, gp->name, CTLFLAG_RD, 0, tmpstr); if (sc->sysctl_tree != NULL) { - snprintf(tmpstr, sizeof(tmpstr), - "kern.geom.disk.%s.led", gp->name); - TUNABLE_STR_FETCH(tmpstr, sc->led, sizeof(sc->led)); SYSCTL_ADD_STRING(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "led", - CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led), + CTLFLAG_RWTUN, sc->led, sizeof(sc->led), "LED name"); } pp->private = sc; diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 79afb14..3559daf 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -212,8 +212,7 @@ SYSCTL_PROC(_kern_geom, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RD, 0, 0, sysctl_kern_geom_conftxt, "", "Dump the GEOM config in txt"); -TUNABLE_INT("kern.geom.debugflags", &g_debugflags); -SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW, +SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RWTUN, &g_debugflags, 0, "Set various trace levels for GEOM debugging"); SYSCTL_INT(_kern_geom, OID_AUTO, notaste, CTLFLAG_RW, diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 3908478..52dbc36 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -84,7 +84,6 @@ const struct g_journal_desc *g_journal_filesystems[] = { SYSCTL_DECL(_kern_geom); int g_journal_debug = 0; -TUNABLE_INT("kern.geom.journal.debug", &g_journal_debug); static u_int g_journal_switch_time = 10; static u_int g_journal_force_switch = 70; static u_int g_journal_parallel_flushes = 16; @@ -95,7 +94,7 @@ static u_int g_journal_do_optimize = 1; static SYSCTL_NODE(_kern_geom, OID_AUTO, journal, CTLFLAG_RW, 0, "GEOM_JOURNAL stuff"); -SYSCTL_INT(_kern_geom_journal, OID_AUTO, debug, CTLFLAG_RW, &g_journal_debug, 0, +SYSCTL_INT(_kern_geom_journal, OID_AUTO, debug, CTLFLAG_RWTUN, &g_journal_debug, 0, "Debug level"); SYSCTL_UINT(_kern_geom_journal, OID_AUTO, switch_time, CTLFLAG_RW, &g_journal_switch_time, 0, "Switch journals every N seconds"); @@ -133,9 +132,7 @@ SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW, static u_int g_journal_cache_used = 0; static u_int g_journal_cache_limit = 64 * 1024 * 1024; -TUNABLE_INT("kern.geom.journal.cache.limit", &g_journal_cache_limit); static u_int g_journal_cache_divisor = 2; -TUNABLE_INT("kern.geom.journal.cache.divisor", &g_journal_cache_divisor); static u_int g_journal_cache_switch = 90; static u_int g_journal_cache_misses = 0; static u_int g_journal_cache_alloc_failures = 0; @@ -160,7 +157,7 @@ g_journal_cache_limit_sysctl(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_kern_geom_journal_cache, OID_AUTO, limit, - CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, g_journal_cache_limit_sysctl, "I", + CTLTYPE_UINT | CTLFLAG_RWTUN, NULL, 0, g_journal_cache_limit_sysctl, "I", "Maximum number of allocated bytes"); SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, divisor, CTLFLAG_RDTUN, &g_journal_cache_divisor, 0, diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index ce1376e..36498e1 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -50,8 +50,7 @@ FEATURE(geom_label, "GEOM labeling support"); SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, label, CTLFLAG_RW, 0, "GEOM_LABEL stuff"); u_int g_label_debug = 0; -TUNABLE_INT("kern.geom.label.debug", &g_label_debug); -SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RW, &g_label_debug, 0, +SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RWTUN, &g_label_debug, 0, "Debug level"); static int g_label_destroy_geom(struct gctl_req *req, struct g_class *mp, diff --git a/sys/geom/label/g_label.h b/sys/geom/label/g_label.h index eca3126..66b762c 100644 --- a/sys/geom/label/g_label.h +++ b/sys/geom/label/g_label.h @@ -65,9 +65,7 @@ SYSCTL_DECL(_kern_geom_label); SYSCTL_NODE(_kern_geom_label, OID_AUTO, kind, CTLFLAG_RD, \ NULL, ""); \ SYSCTL_INT(_kern_geom_label_##kind, OID_AUTO, enable, \ - CTLFLAG_RW, &label.ld_enabled, 1, descr); \ - TUNABLE_INT("kern.geom.label." __XSTRING(kind) ".enable", \ - &label.ld_enabled) + CTLFLAG_RWTUN, &label.ld_enabled, 1, descr) typedef void g_label_taste_t (struct g_consumer *cp, char *label, size_t size); diff --git a/sys/geom/linux_lvm/g_linux_lvm.c b/sys/geom/linux_lvm/g_linux_lvm.c index 2ac19e0..bf2f1e7 100644 --- a/sys/geom/linux_lvm/g_linux_lvm.c +++ b/sys/geom/linux_lvm/g_linux_lvm.c @@ -79,8 +79,7 @@ SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, linux_lvm, CTLFLAG_RW, 0, "GEOM_LINUX_LVM stuff"); static u_int g_llvm_debug = 0; -TUNABLE_INT("kern.geom.linux_lvm.debug", &g_llvm_debug); -SYSCTL_UINT(_kern_geom_linux_lvm, OID_AUTO, debug, CTLFLAG_RW, &g_llvm_debug, 0, +SYSCTL_UINT(_kern_geom_linux_lvm, OID_AUTO, debug, CTLFLAG_RWTUN, &g_llvm_debug, 0, "Debug level"); LIST_HEAD(, g_llvm_vg) vg_list; diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index e4dffdc..2fae439 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -54,24 +54,18 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, mirror, CTLFLAG_RW, 0, "GEOM_MIRROR stuff"); u_int g_mirror_debug = 0; -TUNABLE_INT("kern.geom.mirror.debug", &g_mirror_debug); -SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RW, &g_mirror_debug, 0, +SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RWTUN, &g_mirror_debug, 0, "Debug level"); static u_int g_mirror_timeout = 4; -TUNABLE_INT("kern.geom.mirror.timeout", &g_mirror_timeout); -SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, timeout, CTLFLAG_RW, &g_mirror_timeout, +SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, timeout, CTLFLAG_RWTUN, &g_mirror_timeout, 0, "Time to wait on all mirror components"); static u_int g_mirror_idletime = 5; -TUNABLE_INT("kern.geom.mirror.idletime", &g_mirror_idletime); -SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, idletime, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, idletime, CTLFLAG_RWTUN, &g_mirror_idletime, 0, "Mark components as clean when idling"); static u_int g_mirror_disconnect_on_failure = 1; -TUNABLE_INT("kern.geom.mirror.disconnect_on_failure", - &g_mirror_disconnect_on_failure); -SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, disconnect_on_failure, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN, &g_mirror_disconnect_on_failure, 0, "Disconnect component on I/O failure."); static u_int g_mirror_syncreqs = 2; -TUNABLE_INT("kern.geom.mirror.sync_requests", &g_mirror_syncreqs); SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, sync_requests, CTLFLAG_RDTUN, &g_mirror_syncreqs, 0, "Parallel synchronization I/O requests."); diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 8429fa0..2a04ba3 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -123,9 +123,8 @@ SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); static u_int check_integrity = 1; -TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RW | CTLFLAG_TUN, &check_integrity, 1, + CTLFLAG_RWTUN, &check_integrity, 1, "Enable integrity checking"); /* diff --git a/sys/geom/part/g_part_ldm.c b/sys/geom/part/g_part_ldm.c index 40c2eb8..82bf76d 100644 --- a/sys/geom/part/g_part_ldm.c +++ b/sys/geom/part/g_part_ldm.c @@ -55,18 +55,16 @@ static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ldm, CTLFLAG_RW, 0, "GEOM_PART_LDM Logical Disk Manager"); static u_int ldm_debug = 0; -TUNABLE_INT("kern.geom.part.ldm.debug", &ldm_debug); SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, - CTLFLAG_RW | CTLFLAG_TUN, &ldm_debug, 0, "Debug level"); + CTLFLAG_RWTUN, &ldm_debug, 0, "Debug level"); /* * This allows access to mirrored LDM volumes. Since we do not * doing mirroring here, it is not enabled by default. */ static u_int show_mirrors = 0; -TUNABLE_INT("kern.geom.part.ldm.show_mirrors", &show_mirrors); SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, - CTLFLAG_RW | CTLFLAG_TUN, &show_mirrors, 0, "Show mirrored volumes"); + CTLFLAG_RWTUN, &show_mirrors, 0, "Show mirrored volumes"); #define LDM_DEBUG(lvl, fmt, ...) do { \ if (ldm_debug >= (lvl)) { \ diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c index 858cf4c..db9cf44 100644 --- a/sys/geom/raid/g_raid.c +++ b/sys/geom/raid/g_raid.c @@ -53,49 +53,38 @@ static MALLOC_DEFINE(M_RAID, "raid_data", "GEOM_RAID Data"); SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); int g_raid_enable = 1; -TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable); -SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RWTUN, &g_raid_enable, 0, "Enable on-disk metadata taste"); u_int g_raid_aggressive_spare = 0; -TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RWTUN, &g_raid_aggressive_spare, 0, "Use disks without metadata as spare"); u_int g_raid_debug = 0; -TUNABLE_INT("kern.geom.raid.debug", &g_raid_debug); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RW, &g_raid_debug, 0, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RWTUN, &g_raid_debug, 0, "Debug level"); int g_raid_read_err_thresh = 10; -TUNABLE_INT("kern.geom.raid.read_err_thresh", &g_raid_read_err_thresh); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, read_err_thresh, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, read_err_thresh, CTLFLAG_RWTUN, &g_raid_read_err_thresh, 0, "Number of read errors equated to disk failure"); u_int g_raid_start_timeout = 30; -TUNABLE_INT("kern.geom.raid.start_timeout", &g_raid_start_timeout); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, start_timeout, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, start_timeout, CTLFLAG_RWTUN, &g_raid_start_timeout, 0, "Time to wait for all array components"); static u_int g_raid_clean_time = 5; -TUNABLE_INT("kern.geom.raid.clean_time", &g_raid_clean_time); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, clean_time, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, clean_time, CTLFLAG_RWTUN, &g_raid_clean_time, 0, "Mark volume as clean when idling"); static u_int g_raid_disconnect_on_failure = 1; -TUNABLE_INT("kern.geom.raid.disconnect_on_failure", - &g_raid_disconnect_on_failure); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, disconnect_on_failure, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN, &g_raid_disconnect_on_failure, 0, "Disconnect component on I/O failure."); static u_int g_raid_name_format = 0; -TUNABLE_INT("kern.geom.raid.name_format", &g_raid_name_format); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, name_format, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, name_format, CTLFLAG_RWTUN, &g_raid_name_format, 0, "Providers name format."); static u_int g_raid_idle_threshold = 1000000; -TUNABLE_INT("kern.geom.raid.idle_threshold", &g_raid_idle_threshold); -SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RWTUN, &g_raid_idle_threshold, 1000000, "Time in microseconds to consider a volume idle."); static u_int ar_legacy_aliases = 1; -SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RW, +SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN, &ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style."); -TUNABLE_INT("kern.geom_raid.legacy_aliases", &ar_legacy_aliases); #define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \ diff --git a/sys/geom/raid/g_raid.h b/sys/geom/raid/g_raid.h index 8a96fa9..f6aa6db 100644 --- a/sys/geom/raid/g_raid.h +++ b/sys/geom/raid/g_raid.h @@ -364,10 +364,8 @@ int g_raid_md_modevent(module_t, int, void *); SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ NULL, label " metadata module"); \ SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ - CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \ - "Enable " label " metadata format taste"); \ - TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ - &g_raid_md_##name##_class.mdc_enable) + CTLFLAG_RWTUN, &g_raid_md_##name##_class.mdc_enable, 0, \ + "Enable " label " metadata format taste") /* * KOBJ parent class of data transformation modules. @@ -403,10 +401,8 @@ int g_raid_tr_modevent(module_t, int, void *); SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ NULL, label " transformation module"); \ SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ - CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \ - "Enable " label " transformation module taste"); \ - TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ - &g_raid_tr_##name##_class.trc_enable) + CTLFLAG_RWTUN, &g_raid_tr_##name##_class.trc_enable, 0, \ + "Enable " label " transformation module taste") const char * g_raid_volume_level2str(int level, int qual); int g_raid_volume_str2level(const char *str, int *level, int *qual); diff --git a/sys/geom/raid/tr_raid1.c b/sys/geom/raid/tr_raid1.c index 833655b..17c7a25 100644 --- a/sys/geom/raid/tr_raid1.c +++ b/sys/geom/raid/tr_raid1.c @@ -46,33 +46,25 @@ SYSCTL_DECL(_kern_geom_raid_raid1); #define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB; -TUNABLE_INT("kern.geom.raid.raid1.rebuild_slab_size", - &g_raid1_rebuild_slab); -SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_slab_size, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_slab_size, CTLFLAG_RWTUN, &g_raid1_rebuild_slab, 0, "Amount of the disk to rebuild each read/write cycle of the rebuild."); #define RAID1_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */ static int g_raid1_rebuild_fair_io = RAID1_REBUILD_FAIR_IO; -TUNABLE_INT("kern.geom.raid.raid1.rebuild_fair_io", - &g_raid1_rebuild_fair_io); -SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_fair_io, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_fair_io, CTLFLAG_RWTUN, &g_raid1_rebuild_fair_io, 0, "Fraction of the I/O bandwidth to use when disk busy for rebuild."); #define RAID1_REBUILD_CLUSTER_IDLE 100 static int g_raid1_rebuild_cluster_idle = RAID1_REBUILD_CLUSTER_IDLE; -TUNABLE_INT("kern.geom.raid.raid1.rebuild_cluster_idle", - &g_raid1_rebuild_cluster_idle); -SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RWTUN, &g_raid1_rebuild_cluster_idle, 0, "Number of slabs to do each time we trigger a rebuild cycle"); #define RAID1_REBUILD_META_UPDATE 1024 /* update meta data every 1GB or so */ static int g_raid1_rebuild_meta_update = RAID1_REBUILD_META_UPDATE; -TUNABLE_INT("kern.geom.raid.raid1.rebuild_meta_update", - &g_raid1_rebuild_meta_update); -SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_meta_update, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_meta_update, CTLFLAG_RWTUN, &g_raid1_rebuild_meta_update, 0, "When to update the meta data."); diff --git a/sys/geom/raid/tr_raid1e.c b/sys/geom/raid/tr_raid1e.c index 404b9e6..b357742 100644 --- a/sys/geom/raid/tr_raid1e.c +++ b/sys/geom/raid/tr_raid1e.c @@ -48,33 +48,25 @@ SYSCTL_DECL(_kern_geom_raid_raid1e); #define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB; -TUNABLE_INT("kern.geom.raid.raid1e.rebuild_slab_size", - &g_raid1e_rebuild_slab); -SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_slab_size, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_slab_size, CTLFLAG_RWTUN, &g_raid1e_rebuild_slab, 0, "Amount of the disk to rebuild each read/write cycle of the rebuild."); #define RAID1E_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */ static int g_raid1e_rebuild_fair_io = RAID1E_REBUILD_FAIR_IO; -TUNABLE_INT("kern.geom.raid.raid1e.rebuild_fair_io", - &g_raid1e_rebuild_fair_io); -SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_fair_io, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_fair_io, CTLFLAG_RWTUN, &g_raid1e_rebuild_fair_io, 0, "Fraction of the I/O bandwidth to use when disk busy for rebuild."); #define RAID1E_REBUILD_CLUSTER_IDLE 100 static int g_raid1e_rebuild_cluster_idle = RAID1E_REBUILD_CLUSTER_IDLE; -TUNABLE_INT("kern.geom.raid.raid1e.rebuild_cluster_idle", - &g_raid1e_rebuild_cluster_idle); -SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RWTUN, &g_raid1e_rebuild_cluster_idle, 0, "Number of slabs to do each time we trigger a rebuild cycle"); #define RAID1E_REBUILD_META_UPDATE 1024 /* update meta data every 1GB or so */ static int g_raid1e_rebuild_meta_update = RAID1E_REBUILD_META_UPDATE; -TUNABLE_INT("kern.geom.raid.raid1e.rebuild_meta_update", - &g_raid1e_rebuild_meta_update); -SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_meta_update, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_meta_update, CTLFLAG_RWTUN, &g_raid1e_rebuild_meta_update, 0, "When to update the meta data."); diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 927cb31..f935f78 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -54,42 +54,32 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, raid3, CTLFLAG_RW, 0, "GEOM_RAID3 stuff"); u_int g_raid3_debug = 0; -TUNABLE_INT("kern.geom.raid3.debug", &g_raid3_debug); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, debug, CTLFLAG_RW, &g_raid3_debug, 0, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, debug, CTLFLAG_RWTUN, &g_raid3_debug, 0, "Debug level"); static u_int g_raid3_timeout = 4; -TUNABLE_INT("kern.geom.raid3.timeout", &g_raid3_timeout); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, timeout, CTLFLAG_RW, &g_raid3_timeout, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, timeout, CTLFLAG_RWTUN, &g_raid3_timeout, 0, "Time to wait on all raid3 components"); static u_int g_raid3_idletime = 5; -TUNABLE_INT("kern.geom.raid3.idletime", &g_raid3_idletime); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, idletime, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, idletime, CTLFLAG_RWTUN, &g_raid3_idletime, 0, "Mark components as clean when idling"); static u_int g_raid3_disconnect_on_failure = 1; -TUNABLE_INT("kern.geom.raid3.disconnect_on_failure", - &g_raid3_disconnect_on_failure); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, disconnect_on_failure, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN, &g_raid3_disconnect_on_failure, 0, "Disconnect component on I/O failure."); static u_int g_raid3_syncreqs = 2; -TUNABLE_INT("kern.geom.raid3.sync_requests", &g_raid3_syncreqs); SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, sync_requests, CTLFLAG_RDTUN, &g_raid3_syncreqs, 0, "Parallel synchronization I/O requests."); static u_int g_raid3_use_malloc = 0; -TUNABLE_INT("kern.geom.raid3.use_malloc", &g_raid3_use_malloc); SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, use_malloc, CTLFLAG_RDTUN, &g_raid3_use_malloc, 0, "Use malloc(9) instead of uma(9)."); static u_int g_raid3_n64k = 50; -TUNABLE_INT("kern.geom.raid3.n64k", &g_raid3_n64k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n64k, CTLFLAG_RD, &g_raid3_n64k, 0, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n64k, CTLFLAG_RDTUN, &g_raid3_n64k, 0, "Maximum number of 64kB allocations"); static u_int g_raid3_n16k = 200; -TUNABLE_INT("kern.geom.raid3.n16k", &g_raid3_n16k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n16k, CTLFLAG_RD, &g_raid3_n16k, 0, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n16k, CTLFLAG_RDTUN, &g_raid3_n16k, 0, "Maximum number of 16kB allocations"); static u_int g_raid3_n4k = 1200; -TUNABLE_INT("kern.geom.raid3.n4k", &g_raid3_n4k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RD, &g_raid3_n4k, 0, +SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RDTUN, &g_raid3_n4k, 0, "Maximum number of 4kB allocations"); static SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, CTLFLAG_RW, 0, diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c index 9f8723f..bfdc8fd 100644 --- a/sys/geom/shsec/g_shsec.c +++ b/sys/geom/shsec/g_shsec.c @@ -71,12 +71,10 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, shsec, CTLFLAG_RW, 0, "GEOM_SHSEC stuff"); static u_int g_shsec_debug = 0; -TUNABLE_INT("kern.geom.shsec.debug", &g_shsec_debug); -SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, debug, CTLFLAG_RW, &g_shsec_debug, 0, +SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, debug, CTLFLAG_RWTUN, &g_shsec_debug, 0, "Debug level"); static u_int g_shsec_maxmem = MAXPHYS * 100; -TUNABLE_INT("kern.geom.shsec.maxmem", &g_shsec_maxmem); -SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, maxmem, CTLFLAG_RD, &g_shsec_maxmem, +SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, maxmem, CTLFLAG_RDTUN, &g_shsec_maxmem, 0, "Maximum memory that can be allocated for I/O (in bytes)"); static u_int g_shsec_alloc_failed = 0; SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, alloc_failed, CTLFLAG_RD, diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index 474d888..1e88e6d 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -71,11 +71,9 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW, 0, "GEOM_STRIPE stuff"); static u_int g_stripe_debug = 0; -TUNABLE_INT("kern.geom.stripe.debug", &g_stripe_debug); -SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RW, &g_stripe_debug, 0, +SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RWTUN, &g_stripe_debug, 0, "Debug level"); static int g_stripe_fast = 0; -TUNABLE_INT("kern.geom.stripe.fast", &g_stripe_fast); static int g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS) { @@ -87,11 +85,10 @@ g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS) g_stripe_fast = fast; return (error); } -SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RWTUN, NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode"); static u_int g_stripe_maxmem = MAXPHYS * 100; -TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem); -SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem, +SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RDTUN, &g_stripe_maxmem, 0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)"); static u_int g_stripe_fast_failed = 0; SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, fast_failed, CTLFLAG_RD, diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c index 15a62a1..84d10a5 100644 --- a/sys/geom/vinum/geom_vinum.c +++ b/sys/geom/vinum/geom_vinum.c @@ -50,8 +50,7 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW, 0, "GEOM_VINUM stuff"); u_int g_vinum_debug = 0; -TUNABLE_INT("kern.geom.vinum.debug", &g_vinum_debug); -SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RW, &g_vinum_debug, 0, +SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RWTUN, &g_vinum_debug, 0, "Debug level"); static int gv_create(struct g_geom *, struct gctl_req *); diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index 40e25d1..a1774a9 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -84,20 +84,16 @@ static SYSCTL_NODE(_kern_geom, OID_AUTO, virstor, CTLFLAG_RW, 0, "GEOM_GVIRSTOR information"); static u_int g_virstor_debug = 2; /* XXX: lower to 2 when released to public */ -TUNABLE_INT("kern.geom.virstor.debug", &g_virstor_debug); -SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, debug, CTLFLAG_RW, &g_virstor_debug, +SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, debug, CTLFLAG_RWTUN, &g_virstor_debug, 0, "Debug level (2=production, 5=normal, 15=excessive)"); static u_int g_virstor_chunk_watermark = 100; -TUNABLE_INT("kern.geom.virstor.chunk_watermark", &g_virstor_chunk_watermark); -SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, chunk_watermark, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, chunk_watermark, CTLFLAG_RWTUN, &g_virstor_chunk_watermark, 0, "Minimum number of free chunks before issuing administrative warning"); static u_int g_virstor_component_watermark = 1; -TUNABLE_INT("kern.geom.virstor.component_watermark", - &g_virstor_component_watermark); -SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, component_watermark, CTLFLAG_RW, +SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, component_watermark, CTLFLAG_RWTUN, &g_virstor_component_watermark, 0, "Minimum number of free components before issuing administrative warning"); diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index a244e73..049354b 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); #include <machine/nexusvar.h> uint32_t acpi_resume_beep; -TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); -SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, +SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RWTUN, &acpi_resume_beep, 0, "Beep the PC speaker when resuming"); uint32_t acpi_reset_video; diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index bf5071f..a4d3bd7 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -134,8 +134,7 @@ SYSCTL_INT(_machdep, OID_AUTO, apm_suspend_delay, CTLFLAG_RW, &apm_suspend_delay SYSCTL_INT(_machdep, OID_AUTO, apm_standby_delay, CTLFLAG_RW, &apm_standby_delay, 1, ""); SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, ""); -TUNABLE_INT("machdep.apm_swab_batt_minutes", &apm_swab_batt_minutes); -SYSCTL_INT(_machdep, OID_AUTO, apm_swab_batt_minutes, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, apm_swab_batt_minutes, CTLFLAG_RWTUN, &apm_swab_batt_minutes, 0, "Byte swap battery time value."); #ifdef PC98 diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index 84db1ec..2721cfb 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -65,7 +65,6 @@ static char *mem_owner_bios = "BIOS"; (((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK)) static int mtrrs_disabled; -TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled); SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN, &mtrrs_disabled, 0, "Disable i686 MTRRs."); diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 3d92e6e..ac41c27 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1231,8 +1231,7 @@ cpu_halt(void) void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ -TUNABLE_INT("machdep.idle_mwait", &idle_mwait); -SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait, 0, "Use MONITOR/MWAIT for short idle"); #define STATE_RUNNING 0x0 diff --git a/sys/i386/i386/mp_watchdog.c b/sys/i386/i386/mp_watchdog.c index b1799a2..b03d261 100644 --- a/sys/i386/i386/mp_watchdog.c +++ b/sys/i386/i386/mp_watchdog.c @@ -68,8 +68,7 @@ static int watchdog_dontfire = 1; static int watchdog_timer = -1; static int watchdog_nmi = 1; -TUNABLE_INT("debug.watchdog", &watchdog_cpu); -SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RW, &watchdog_nmi, 0, +SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RWTUN, &watchdog_nmi, 0, "IPI the boot processor with an NMI to enter the debugger"); static struct callout watchdog_callout; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index af8c9ff..3085157 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -225,8 +225,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, "Is page attribute table fully functional?"); static int pg_ps_enabled = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, - "Are large page mappings enabled?"); +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pg_ps_enabled, 0, "Are large page mappings enabled?"); #define PAT_INDEX_SIZE 8 static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 97254f2..6e4aba2 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -158,14 +158,12 @@ extern int has_f00f_bug; #ifdef KDB static int kdb_on_nmi = 1; -SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN, &kdb_on_nmi, 0, "Go to KDB on NMI"); -TUNABLE_INT("machdep.kdb_on_nmi", &kdb_on_nmi); #endif static int panic_on_nmi = 1; -SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW, +SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, &panic_on_nmi, 0, "Panic on NMI"); -TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi); static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index cce4981..5d57e89 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -86,7 +86,6 @@ static int cfgmech; static int devmax; static struct mtx pcicfg_mtx; static int mcfg_enable = 1; -TUNABLE_INT("hw.pci.mcfg", &mcfg_enable); SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0, "Enable support for PCI-e memory mapped config access"); diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index c275de0..0d64cab 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -117,7 +117,6 @@ SYSCTL_DECL(_hw_pci); #endif static uint32_t pci_irq_override_mask = PCI_IRQ_OVERRIDE_MASK; -TUNABLE_INT("hw.pci.irq_override_mask", &pci_irq_override_mask); SYSCTL_INT(_hw_pci, OID_AUTO, irq_override_mask, CTLFLAG_RDTUN, &pci_irq_override_mask, PCI_IRQ_OVERRIDE_MASK, "Mask of allowed irqs to try to route when it has no good clue about\n" diff --git a/sys/ia64/ia64/dump_machdep.c b/sys/ia64/ia64/dump_machdep.c index 9a058bb..d6d9d04 100644 --- a/sys/ia64/ia64/dump_machdep.c +++ b/sys/ia64/ia64/dump_machdep.c @@ -57,8 +57,7 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); #define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) static int minidump = 0; -TUNABLE_INT("debug.minidump", &minidump); -SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &minidump, 0, +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &minidump, 0, "Enable mini crash dumps"); static struct kerneldumpheader kdh; diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index 9f64297..1ed35c3 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -240,9 +240,8 @@ int pmap_vhpt_nbuckets; SYSCTL_INT(_machdep_vhpt, OID_AUTO, nbuckets, CTLFLAG_RD, &pmap_vhpt_nbuckets, 0, ""); -int pmap_vhpt_log2size = 0; -TUNABLE_INT("machdep.vhpt.log2size", &pmap_vhpt_log2size); -SYSCTL_INT(_machdep_vhpt, OID_AUTO, log2size, CTLFLAG_RD, +int pmap_vhpt_log2size; +SYSCTL_INT(_machdep_vhpt, OID_AUTO, log2size, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pmap_vhpt_log2size, 0, ""); static int pmap_vhpt_inserts; diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 591094e..b085a70 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -112,10 +112,8 @@ static int compress_core(gzFile, char *, char *, unsigned int, int __elfN(fallback_brand) = -1; SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, - fallback_brand, CTLFLAG_RW, &__elfN(fallback_brand), 0, + fallback_brand, CTLFLAG_RWTUN, &__elfN(fallback_brand), 0, __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) " brand of last resort"); -TUNABLE_INT("kern.elf" __XSTRING(__ELF_WORD_SIZE) ".fallback_brand", - &__elfN(fallback_brand)); static int elf_legacy_coredump = 0; SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW, diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index ae64c61..092c818 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -96,23 +96,21 @@ static sbintime_t statperiod; /* statclock() events period. */ static sbintime_t profperiod; /* profclock() events period. */ static sbintime_t nexttick; /* Next global timer tick time. */ static u_int busy = 1; /* Reconfiguration is in progress. */ -static int profiling = 0; /* Profiling events enabled. */ +static int profiling; /* Profiling events enabled. */ static char timername[32]; /* Wanted timer. */ TUNABLE_STR("kern.eventtimer.timer", timername, sizeof(timername)); -static int singlemul = 0; /* Multiplier for periodic mode. */ -TUNABLE_INT("kern.eventtimer.singlemul", &singlemul); -SYSCTL_INT(_kern_eventtimer, OID_AUTO, singlemul, CTLFLAG_RW, &singlemul, +static int singlemul; /* Multiplier for periodic mode. */ +SYSCTL_INT(_kern_eventtimer, OID_AUTO, singlemul, CTLFLAG_RWTUN, &singlemul, 0, "Multiplier for periodic mode"); -static u_int idletick = 0; /* Run periodic events when idle. */ -TUNABLE_INT("kern.eventtimer.idletick", &idletick); -SYSCTL_UINT(_kern_eventtimer, OID_AUTO, idletick, CTLFLAG_RW, &idletick, +static u_int idletick; /* Run periodic events when idle. */ +SYSCTL_UINT(_kern_eventtimer, OID_AUTO, idletick, CTLFLAG_RWTUN, &idletick, 0, "Run periodic events when idle"); -static int periodic = 0; /* Periodic or one-shot mode. */ -static int want_periodic = 0; /* What mode to prefer. */ +static int periodic; /* Periodic or one-shot mode. */ +static int want_periodic; /* What mode to prefer. */ TUNABLE_INT("kern.eventtimer.periodic", &want_periodic); struct pcpu_state { diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 8d23bef..1d5ac0e 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -652,9 +652,9 @@ sysbeep(int pitch __unused, int period __unused) /* * Temporary support for sc(4) to vt(4) transition. */ -static char vty_name[16] = ""; -SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN, vty_name, 0, - "Console vty driver"); +static char vty_name[16]; +SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name, + 0, "Console vty driver"); int vty_enabled(unsigned vty) diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index 7206c38..293b940 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -133,13 +133,11 @@ DRIVER_MODULE(cpufreq, cpu, cpufreq_driver, cpufreq_dc, 0, 0); static int cf_lowest_freq; static int cf_verbose; -TUNABLE_INT("debug.cpufreq.lowest", &cf_lowest_freq); -TUNABLE_INT("debug.cpufreq.verbose", &cf_verbose); static SYSCTL_NODE(_debug, OID_AUTO, cpufreq, CTLFLAG_RD, NULL, "cpufreq debugging"); -SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RW, &cf_lowest_freq, 1, +SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RWTUN, &cf_lowest_freq, 1, "Don't provide levels below this frequency."); -SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RW, &cf_verbose, 1, +SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RWTUN, &cf_verbose, 1, "Print verbose debugging messages"); static int diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 078cd38..7d3bad9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -127,8 +127,7 @@ SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW, "Disallow execution of binaries built for higher version of the world"); static int map_at_zero = 0; -TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero); -SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0, +SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RWTUN, &map_at_zero, 0, "Permit processes to map an object at virtual address 0."); static int diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 5555d68..25032f2 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -89,8 +89,7 @@ struct proc *intrproc; static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); static int intr_storm_threshold = 1000; -TUNABLE_INT("hw.intr_storm_threshold", &intr_storm_threshold); -SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RW, +SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, &intr_storm_threshold, 0, "Number of consecutive interrupts before storm protection is enabled"); static TAILQ_HEAD(, intr_event) event_list = diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index e302ae2..c377f36 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -104,33 +104,17 @@ struct ktr_entry *ktr_buf = ktr_buf_init; cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); static char ktr_cpumask_str[CPUSETBUFSIZ]; -TUNABLE_INT("debug.ktr.mask", &ktr_mask); - -TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str)); - static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options"); +SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RDTUN, + &ktr_mask, 0, "KTR mask"); + SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0, "Version of the KTR interface"); SYSCTL_UINT(_debug_ktr, OID_AUTO, compile, CTLFLAG_RD, &ktr_compile, 0, "Bitmask of KTR event classes compiled into the kernel"); -static void -ktr_cpumask_initializer(void *dummy __unused) -{ - - /* - * TUNABLE_STR() runs with SI_ORDER_MIDDLE priority, thus it must be - * already set, if necessary. - */ - if (ktr_cpumask_str[0] != '\0' && - cpusetobj_strscan(&ktr_cpumask, ktr_cpumask_str) == -1) - CPU_FILL(&ktr_cpumask); -} -SYSINIT(ktr_cpumask_initializer, SI_SUB_TUNABLES, SI_ORDER_ANY, - ktr_cpumask_initializer, NULL); - static int sysctl_debug_ktr_cpumask(SYSCTL_HANDLER_ARGS) { @@ -150,7 +134,7 @@ sysctl_debug_ktr_cpumask(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_debug_ktr, OID_AUTO, cpumask, - CTLFLAG_RW | CTLFLAG_MPSAFE | CTLTYPE_STRING, NULL, 0, + CTLFLAG_RWTUN | CTLFLAG_MPSAFE | CTLTYPE_STRING, NULL, 0, sysctl_debug_ktr_cpumask, "S", "Bitmask of CPUs on which KTR logging is enabled"); diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index b74d48e..367610b3 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -133,8 +133,7 @@ static u_int ktr_requestpool = KTRACE_REQUEST_POOL; TUNABLE_INT("kern.ktrace.request_pool", &ktr_requestpool); static u_int ktr_geniosize = PAGE_SIZE; -TUNABLE_INT("kern.ktrace.genio_size", &ktr_geniosize); -SYSCTL_UINT(_kern_ktrace, OID_AUTO, genio_size, CTLFLAG_RW, &ktr_geniosize, +SYSCTL_UINT(_kern_ktrace, OID_AUTO, genio_size, CTLFLAG_RWTUN, &ktr_geniosize, 0, "Maximum size of genio event payload"); static int print_message = 1; diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index e379f5f..dbc0fb3 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -66,9 +66,8 @@ __FBSDID("$FreeBSD$"); #ifdef KLD_DEBUG int kld_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, kld_debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug, OID_AUTO, kld_debug, CTLFLAG_RWTUN, &kld_debug, 0, "Set various levels of KLD debug"); -TUNABLE_INT("debug.kld_debug", &kld_debug); #endif /* @@ -1643,7 +1642,7 @@ SYSINIT(preload, SI_SUB_KLD, SI_ORDER_MIDDLE, linker_preload, 0); static char linker_hintfile[] = "linker.hints"; static char linker_path[MAXPATHLEN] = "/boot/kernel;/boot/modules"; -SYSCTL_STRING(_kern, OID_AUTO, module_path, CTLFLAG_RW, linker_path, +SYSCTL_STRING(_kern, OID_AUTO, module_path, CTLFLAG_RWTUN, linker_path, sizeof(linker_path), "module load search path"); TUNABLE_STR("module_path", linker_path, sizeof(linker_path)); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 658908c..f16d4d5 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -191,7 +191,7 @@ static u_long vm_kmem_size_max; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, &vm_kmem_size_max, 0, "Maximum size of kernel memory"); -static u_int vm_kmem_size_scale; +static u_int vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); @@ -236,9 +236,8 @@ static SYSCTL_NODE(_debug, OID_AUTO, malloc, CTLFLAG_RD, 0, static int malloc_failure_rate; static int malloc_nowait_count; static int malloc_failure_count; -SYSCTL_INT(_debug_malloc, OID_AUTO, failure_rate, CTLFLAG_RW, +SYSCTL_INT(_debug_malloc, OID_AUTO, failure_rate, CTLFLAG_RWTUN, &malloc_failure_rate, 0, "Every (n) mallocs with M_NOWAIT will fail"); -TUNABLE_INT("debug.malloc.failure_rate", &malloc_failure_rate); SYSCTL_INT(_debug_malloc, OID_AUTO, failure_count, CTLFLAG_RD, &malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures"); #endif @@ -280,7 +279,7 @@ tunable_set_numzones(void) numzones = MALLOC_DEBUG_MAXZONES; } SYSINIT(numzones, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_set_numzones, NULL); -SYSCTL_INT(_debug_malloc, OID_AUTO, numzones, CTLFLAG_RDTUN, +SYSCTL_INT(_debug_malloc, OID_AUTO, numzones, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &numzones, 0, "Number of malloc uma subzones"); /* @@ -693,8 +692,21 @@ CTASSERT(VM_KMEM_SIZE_SCALE >= 1); void kmeminit(void) { - u_long mem_size, tmp; + u_long mem_size; + u_long tmp; +#ifdef VM_KMEM_SIZE + if (vm_kmem_size == 0) + vm_kmem_size = VM_KMEM_SIZE; +#endif +#ifdef VM_KMEM_SIZE_MIN + if (vm_kmem_size_min == 0) + vm_kmem_size_min = VM_KMEM_SIZE_MIN; +#endif +#ifdef VM_KMEM_SIZE_MAX + if (vm_kmem_size_max == 0) + vm_kmem_size_max = VM_KMEM_SIZE_MAX; +#endif /* * Calculate the amount of kernel virtual address (KVA) space that is * preallocated to the kmem arena. In order to support a wide range @@ -713,38 +725,29 @@ kmeminit(void) */ mem_size = vm_cnt.v_page_count; - vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; - TUNABLE_INT_FETCH("vm.kmem_size_scale", &vm_kmem_size_scale); if (vm_kmem_size_scale < 1) vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; - vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; - -#if defined(VM_KMEM_SIZE_MIN) - vm_kmem_size_min = VM_KMEM_SIZE_MIN; -#endif - TUNABLE_ULONG_FETCH("vm.kmem_size_min", &vm_kmem_size_min); - if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) - vm_kmem_size = vm_kmem_size_min; + /* + * Check if we should use defaults for the "vm_kmem_size" + * variable: + */ + if (vm_kmem_size == 0) { + vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; -#if defined(VM_KMEM_SIZE_MAX) - vm_kmem_size_max = VM_KMEM_SIZE_MAX; -#endif - TUNABLE_ULONG_FETCH("vm.kmem_size_max", &vm_kmem_size_max); - if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) - vm_kmem_size = vm_kmem_size_max; + if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) + vm_kmem_size = vm_kmem_size_min; + if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) + vm_kmem_size = vm_kmem_size_max; + } /* - * Alternatively, the amount of KVA space that is preallocated to the + * The amount of KVA space that is preallocated to the * kmem arena can be set statically at compile-time or manually * through the kernel environment. However, it is still limited to * twice the physical memory size, which has been sufficient to handle * the most severe cases of external fragmentation in the kmem arena. */ -#if defined(VM_KMEM_SIZE) - vm_kmem_size = VM_KMEM_SIZE; -#endif - TUNABLE_ULONG_FETCH("vm.kmem_size", &vm_kmem_size); if (vm_kmem_size / 2 / PAGE_SIZE > mem_size) vm_kmem_size = 2 * mem_size * PAGE_SIZE; @@ -811,7 +814,7 @@ mallocinit(void *dummy) } } -SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, mallocinit, NULL); +SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_SECOND, mallocinit, NULL); void malloc_init(void *data) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 119e4b8..63d5d55 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -105,7 +105,7 @@ int nmbjumbo16; /* limits number of 16k jumbo clusters */ static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ -SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN, &maxmbufmem, 0, +SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxmbufmem, 0, "Maximum real memory allocatable to various mbuf types"); /* diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 213482b..9d3153b 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -55,35 +55,35 @@ __FBSDID("$FreeBSD$"); #include <sys/sx.h> #include <sys/unistd.h> -SYSCTL_NODE(, 0, sysctl, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(0, sysctl, CTLFLAG_RW, 0, "Sysctl internal magic"); -SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, +SYSCTL_ROOT_NODE(CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, "High kernel, proc, limits &c"); -SYSCTL_NODE(, CTL_VM, vm, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_VM, vm, CTLFLAG_RW, 0, "Virtual memory"); -SYSCTL_NODE(, CTL_VFS, vfs, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_VFS, vfs, CTLFLAG_RW, 0, "File system"); -SYSCTL_NODE(, CTL_NET, net, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_NET, net, CTLFLAG_RW, 0, "Network, (see socket.h)"); -SYSCTL_NODE(, CTL_DEBUG, debug, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_DEBUG, debug, CTLFLAG_RW, 0, "Debugging"); SYSCTL_NODE(_debug, OID_AUTO, sizeof, CTLFLAG_RW, 0, "Sizeof various things"); -SYSCTL_NODE(, CTL_HW, hw, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_HW, hw, CTLFLAG_RW, 0, "hardware"); -SYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_MACHDEP, machdep, CTLFLAG_RW, 0, "machine dependent"); -SYSCTL_NODE(, CTL_USER, user, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_USER, user, CTLFLAG_RW, 0, "user-level"); -SYSCTL_NODE(, CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, "p1003_1b, (see p1003_1b.h)"); -SYSCTL_NODE(, OID_AUTO, compat, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, compat, CTLFLAG_RW, 0, "Compatibility code"); -SYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, security, CTLFLAG_RW, 0, "Security"); #ifdef REGRESSION -SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW, 0, "Regression test MIB"); #endif @@ -112,13 +112,13 @@ SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD|CTLFLAG_CAPRD, &osreldate, 0, "Kernel release date"); -SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN, +SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); SYSCTL_INT(_kern, KERN_MAXPROCPERUID, maxprocperuid, CTLFLAG_RW, &maxprocperuid, 0, "Maximum processes allowed per userid"); -SYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN, +SYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxusers, 0, "Hint for kernel tuning"); SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD|CTLFLAG_CAPRD, @@ -127,8 +127,8 @@ SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD|CTLFLAG_CAPRD, SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD|CTLFLAG_CAPRD, 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); -SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RDTUN|CTLFLAG_CAPRD, - &ngroups_max, 0, +SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RDTUN | + CTLFLAG_NOFETCH | CTLFLAG_CAPRD, &ngroups_max, 0, "Maximum number of supplemental groups a user can belong to"); SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD|CTLFLAG_CAPRD, @@ -526,9 +526,9 @@ sysctl_kern_pid_max(SYSCTL_HANDLER_ARGS) sx_xunlock(&proctree_lock); return (error); } -SYSCTL_PROC(_kern, OID_AUTO, pid_max, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN | - CTLFLAG_MPSAFE, 0, 0, sysctl_kern_pid_max, "I", - "Maximum allowed pid"); +SYSCTL_PROC(_kern, OID_AUTO, pid_max, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, + 0, 0, sysctl_kern_pid_max, "I", "Maximum allowed pid"); #include <sys/bio.h> #include <sys/buf.h> diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 7c95575..638cd53 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -1025,18 +1025,20 @@ sysctl_resettodr_period(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); if (error || !req->newptr) return (error); + if (cold) + goto done; if (resettodr_period == 0) callout_stop(&resettodr_callout); else callout_reset(&resettodr_callout, resettodr_period * hz, periodic_resettodr, NULL); +done: return (0); } -SYSCTL_PROC(_machdep, OID_AUTO, rtc_save_period, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, rtc_save_period, CTLTYPE_INT|CTLFLAG_RWTUN, &resettodr_period, 1800, sysctl_resettodr_period, "I", "Save system time to RTC with this period (in seconds)"); -TUNABLE_INT("machdep.rtc_save_period", &resettodr_period); static void start_periodic_resettodr(void *arg __unused) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 184c4f0..cc9bed1 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data"); static int osd_debug = 0; -TUNABLE_INT("debug.osd", &osd_debug); -SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RW, &osd_debug, 0, "OSD debug level"); +SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RWTUN, &osd_debug, 0, "OSD debug level"); #define OSD_DEBUG(...) do { \ if (osd_debug) { \ diff --git a/sys/kern/kern_pmc.c b/sys/kern/kern_pmc.c index 2b50be0..09dc6ed 100644 --- a/sys/kern/kern_pmc.c +++ b/sys/kern/kern_pmc.c @@ -96,8 +96,7 @@ struct trapframe pmc_tf[MAXCPU]; SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0, "HWPMC parameters"); static int pmc_softevents = 16; -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "softevents", &pmc_softevents); -SYSCTL_INT(_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_TUN|CTLFLAG_RD, +SYSCTL_INT(_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_RDTUN, &pmc_softevents, 0, "maximum number of soft events"); struct mtx pmc_softs_mtx; diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c index 2daa5c2..4b9a444 100644 --- a/sys/kern/kern_priv.c +++ b/sys/kern/kern_priv.c @@ -53,14 +53,12 @@ __FBSDID("$FreeBSD$"); * the consequences. */ static int suser_enabled = 1; -SYSCTL_INT(_security_bsd, OID_AUTO, suser_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_bsd, OID_AUTO, suser_enabled, CTLFLAG_RWTUN, &suser_enabled, 0, "processes with uid 0 have privilege"); -TUNABLE_INT("security.bsd.suser_enabled", &suser_enabled); static int unprivileged_mlock = 1; -SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_mlock, CTLFLAG_RW|CTLFLAG_TUN, +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_mlock, CTLFLAG_RWTUN, &unprivileged_mlock, 0, "Allow non-root users to call mlock(2)"); -TUNABLE_INT("security.bsd.unprivileged_mlock", &unprivileged_mlock); SDT_PROVIDER_DEFINE(priv); SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int"); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 4700e68..dba6a43 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -90,10 +90,9 @@ __FBSDID("$FreeBSD$"); #define PANIC_REBOOT_WAIT_TIME 15 /* default to 15 seconds */ #endif static int panic_reboot_wait_time = PANIC_REBOOT_WAIT_TIME; -SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CTLFLAG_RWTUN, &panic_reboot_wait_time, 0, "Seconds to wait before rebooting after a panic"); -TUNABLE_INT("kern.panic_reboot_wait_time", &panic_reboot_wait_time); /* * Note that stdarg.h and the ANSI style va_start macro is used for both @@ -108,9 +107,8 @@ int debugger_on_panic = 0; int debugger_on_panic = 1; #endif SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, - CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_TUN, + CTLFLAG_RWTUN | CTLFLAG_SECURE, &debugger_on_panic, 0, "Run debugger on kernel panic"); -TUNABLE_INT("debug.debugger_on_panic", &debugger_on_panic); #ifdef KDB_TRACE static int trace_on_panic = 1; @@ -118,15 +116,13 @@ static int trace_on_panic = 1; static int trace_on_panic = 0; #endif SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, - CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_TUN, + CTLFLAG_RWTUN | CTLFLAG_SECURE, &trace_on_panic, 0, "Print stack trace on kernel panic"); -TUNABLE_INT("debug.trace_on_panic", &trace_on_panic); #endif /* KDB */ static int sync_on_panic = 0; -SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RWTUN, &sync_on_panic, 0, "Do a sync before rebooting from a panic"); -TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); @@ -559,43 +555,35 @@ static int kassert_warnings = 0; SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options"); -SYSCTL_INT(_debug_kassert, OID_AUTO, warn_only, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, warn_only, CTLFLAG_RWTUN, &kassert_warn_only, 0, "KASSERT triggers a panic (1) or just a warning (0)"); -TUNABLE_INT("debug.kassert.warn_only", &kassert_warn_only); #ifdef KDB -SYSCTL_INT(_debug_kassert, OID_AUTO, do_kdb, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, do_kdb, CTLFLAG_RWTUN, &kassert_do_kdb, 0, "KASSERT will enter the debugger"); -TUNABLE_INT("debug.kassert.do_kdb", &kassert_do_kdb); #endif #ifdef KTR -SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RWTUN, &kassert_do_ktr, 0, "KASSERT does a KTR, set this to the KTRMASK you want"); -TUNABLE_INT("debug.kassert.do_ktr", &kassert_do_ktr); #endif -SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, CTLFLAG_RWTUN, &kassert_do_log, 0, "KASSERT triggers a panic (1) or just a warning (0)"); -TUNABLE_INT("debug.kassert.do_log", &kassert_do_log); -SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, CTLFLAG_RWTUN, &kassert_warnings, 0, "number of KASSERTs that have been triggered"); -TUNABLE_INT("debug.kassert.warnings", &kassert_warnings); -SYSCTL_INT(_debug_kassert, OID_AUTO, log_panic_at, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, log_panic_at, CTLFLAG_RWTUN, &kassert_log_panic_at, 0, "max number of KASSERTS before we will panic"); -TUNABLE_INT("debug.kassert.log_panic_at", &kassert_log_panic_at); -SYSCTL_INT(_debug_kassert, OID_AUTO, log_pps_limit, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, log_pps_limit, CTLFLAG_RWTUN, &kassert_log_pps_limit, 0, "limit number of log messages per second"); -TUNABLE_INT("debug.kassert.log_pps_limit", &kassert_log_pps_limit); -SYSCTL_INT(_debug_kassert, OID_AUTO, log_mute_at, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, log_mute_at, CTLFLAG_RWTUN, &kassert_log_mute_at, 0, "max number of KASSERTS to log"); -TUNABLE_INT("debug.kassert.log_mute_at", &kassert_log_mute_at); static int kassert_sysctl_kassert(SYSCTL_HANDLER_ARGS); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b405779..67845a2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -136,8 +136,7 @@ SYSCTL_INT(_kern_sigqueue, OID_AUTO, max_pending_per_proc, CTLFLAG_RW, &max_pending_per_proc, 0, "Max pending signals per proc"); static int preallocate_siginfo = 1024; -TUNABLE_INT("kern.sigqueue.preallocate", &preallocate_siginfo); -SYSCTL_INT(_kern_sigqueue, OID_AUTO, preallocate, CTLFLAG_RD, +SYSCTL_INT(_kern_sigqueue, OID_AUTO, preallocate, CTLFLAG_RDTUN, &preallocate_siginfo, 0, "Preallocated signal memory size"); static int signal_overflow = 0; @@ -163,13 +162,11 @@ SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDER_FIRST+3, sigqueue_start, NULL); (cr1)->cr_uid == (cr2)->cr_uid) static int sugid_coredump; -TUNABLE_INT("kern.sugid_coredump", &sugid_coredump); -SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, +SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RWTUN, &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); static int capmode_coredump; -TUNABLE_INT("kern.capmode_coredump", &capmode_coredump); -SYSCTL_INT(_kern, OID_AUTO, capmode_coredump, CTLFLAG_RW, +SYSCTL_INT(_kern, OID_AUTO, capmode_coredump, CTLFLAG_RWTUN, &capmode_coredump, 0, "Allow processes in capability mode to dump core"); static int do_coredump = 1; @@ -3052,8 +3049,7 @@ SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_gzlevel, CTLFLAG_RW, #endif static char corefilename[MAXPATHLEN] = {"%N.core"}; -TUNABLE_STR("kern.corefile", corefilename, sizeof(corefilename)); -SYSCTL_STRING(_kern, OID_AUTO, corefile, CTLFLAG_RW, corefilename, +SYSCTL_STRING(_kern, OID_AUTO, corefile, CTLFLAG_RWTUN, corefilename, sizeof(corefilename), "Process corefile name format string"); /* diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index fec4aea..cb5a266 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -98,10 +98,13 @@ static struct sx sysctlmemlock; static int sysctl_root(SYSCTL_HANDLER_ARGS); -struct sysctl_oid_list sysctl__children; /* root list */ +/* Root list */ +struct sysctl_oid_list sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children); static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); +static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); +static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); static struct sysctl_oid * sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) @@ -136,6 +139,118 @@ sysctl_unlock(void) SYSCTL_XUNLOCK(); } +static int +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intptr_t arg2, + struct sysctl_req *req) +{ + int error; + + oid->oid_running++; + SYSCTL_XUNLOCK(); + + if (!(oid->oid_kind & CTLFLAG_MPSAFE)) + mtx_lock(&Giant); + error = oid->oid_handler(oid, arg1, arg2, req); + if (!(oid->oid_kind & CTLFLAG_MPSAFE)) + mtx_unlock(&Giant); + + SYSCTL_XLOCK(); + oid->oid_running--; + if (oid->oid_running == 0 && (oid->oid_kind & CTLFLAG_DYING) != 0) + wakeup(&oid->oid_running); + + return (error); +} + +static void +sysctl_load_tunable_by_oid_locked(struct sysctl_oid *oidp) +{ + struct sysctl_req req; + struct sysctl_oid *curr; + char *penv; + char path[64]; + ssize_t rem = sizeof(path); + ssize_t len; + int val_int; + long val_long; + int64_t val_64; + int error; + + path[--rem] = 0; + + for (curr = oidp; curr != NULL; curr = SYSCTL_PARENT(curr)) { + len = strlen(curr->oid_name); + rem -= len; + if (curr != oidp) + rem -= 1; + if (rem < 0) { + printf("OID path exceeds %d bytes\n", (int)sizeof(path)); + return; + } + memcpy(path + rem, curr->oid_name, len); + if (curr != oidp) + path[rem + len] = '.'; + } + + penv = getenv(path + rem); + if (penv == NULL) + return; + + memset(&req, 0, sizeof(req)); + + req.td = curthread; + req.oldfunc = sysctl_old_kernel; + req.newfunc = sysctl_new_kernel; + req.lock = REQ_UNWIRED; + + switch (oidp->oid_kind & CTLTYPE) { + case CTLTYPE_INT: + val_int = strtoq(penv, NULL, 0); + req.newlen = sizeof(val_int); + req.newptr = &val_int; + break; + case CTLTYPE_UINT: + val_int = strtouq(penv, NULL, 0); + req.newlen = sizeof(val_int); + req.newptr = &val_int; + break; + case CTLTYPE_LONG: + val_long = strtoq(penv, NULL, 0); + req.newlen = sizeof(val_long); + req.newptr = &val_long; + break; + case CTLTYPE_ULONG: + val_long = strtouq(penv, NULL, 0); + req.newlen = sizeof(val_long); + req.newptr = &val_long; + break; + case CTLTYPE_S64: + val_64 = strtoq(penv, NULL, 0); + req.newlen = sizeof(val_64); + req.newptr = &val_64; + break; + case CTLTYPE_U64: + val_64 = strtouq(penv, NULL, 0); + req.newlen = sizeof(val_64); + req.newptr = &val_64; + break; + case CTLTYPE_STRING: + req.newlen = strlen(penv); + req.newptr = penv; + break; + default: + freeenv(penv); + return; + } + error = sysctl_root_handler_locked(oidp, oidp->oid_arg1, + oidp->oid_arg2, &req); + if (error != 0) { + printf("Setting sysctl '%s' to '%s' failed: %d\n", + path, penv, error); + } + freeenv(penv); +} + void sysctl_register_oid(struct sysctl_oid *oidp) { @@ -192,6 +307,15 @@ sysctl_register_oid(struct sysctl_oid *oidp) SLIST_INSERT_AFTER(q, oidp, oid_link); else SLIST_INSERT_HEAD(parent, oidp, oid_link); + + if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE && +#ifdef VIMAGE + (oidp->oid_kind & CTLFLAG_VNET) == 0 && +#endif + (oidp->oid_kind & CTLFLAG_TUN) != 0 && + (oidp->oid_kind & CTLFLAG_NOFETCH) == 0) { + sysctl_load_tunable_by_oid_locked(oidp); + } } void @@ -423,8 +547,6 @@ sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse) if (error) return (error); } - if (del) - free(SYSCTL_CHILDREN(oidp), M_SYSCTLOID); } } if (oidp->oid_refcnt > 1 ) { @@ -489,24 +611,16 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, } oidp = malloc(sizeof(struct sysctl_oid), M_SYSCTLOID, M_WAITOK|M_ZERO); oidp->oid_parent = parent; - SLIST_NEXT(oidp, oid_link) = NULL; + SLIST_INIT(&oidp->oid_children); oidp->oid_number = number; oidp->oid_refcnt = 1; oidp->oid_name = strdup(name, M_SYSCTLOID); oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; - if ((kind & CTLTYPE) == CTLTYPE_NODE) { - /* Allocate space for children */ - SYSCTL_CHILDREN_SET(oidp, malloc(sizeof(struct sysctl_oid_list), - M_SYSCTLOID, M_WAITOK)); - SLIST_INIT(SYSCTL_CHILDREN(oidp)); - oidp->oid_arg2 = arg2; - } else { - oidp->oid_arg1 = arg1; - oidp->oid_arg2 = arg2; - } + oidp->oid_arg1 = arg1; + oidp->oid_arg2 = arg2; oidp->oid_fmt = fmt; - if (descr) + if (descr != NULL) oidp->oid_descr = strdup(descr, M_SYSCTLOID); /* Update the context, if used */ if (clist != NULL) @@ -577,7 +691,7 @@ sysctl_register_all(void *arg) sysctl_register_oid(*oidp); SYSCTL_XUNLOCK(); } -SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_all, 0); +SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); /* * "Staff-functions" @@ -625,7 +739,7 @@ sysctl_sysctl_debug_dump_node(struct sysctl_oid_list *l, int i) printf(" Node\n"); if (!oidp->oid_handler) { sysctl_sysctl_debug_dump_node( - oidp->oid_arg1, i+2); + SYSCTL_CHILDREN(oidp), i + 2); } break; case CTLTYPE_INT: printf(" Int\n"); break; @@ -1093,26 +1207,28 @@ sysctl_handle_64(SYSCTL_HANDLER_ARGS) int sysctl_handle_string(SYSCTL_HANDLER_ARGS) { - int error=0; - char *tmparg; size_t outlen; + int error = 0; - /* - * Attempt to get a coherent snapshot by copying to a - * temporary kernel buffer. - */ -retry: - outlen = strlen((char *)arg1)+1; - tmparg = malloc(outlen, M_SYSCTLTMP, M_WAITOK); + /* check for zero-length buffer */ + if (arg2 == 0) + return (ENOMEM); - if (strlcpy(tmparg, (char *)arg1, outlen) >= outlen) { - free(tmparg, M_SYSCTLTMP); - goto retry; - } + if (req->oldptr != NULL) { + char *tmparg; + + /* try to make a coherent snapshot of the string */ + tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK); + memcpy(tmparg, arg1, arg2); - error = SYSCTL_OUT(req, tmparg, outlen); - free(tmparg, M_SYSCTLTMP); + outlen = strnlen(tmparg, arg2 - 1) + 1; + error = SYSCTL_OUT(req, tmparg, outlen); + free(tmparg, M_SYSCTLTMP); + } else { + outlen = strnlen((char *)arg1, arg2 - 1) + 1; + error = SYSCTL_OUT(req, NULL, outlen); + } if (error || !req->newptr) return (error); @@ -1123,7 +1239,6 @@ retry: error = SYSCTL_IN(req, arg1, arg2); ((char *)arg1)[arg2] = '\0'; } - return (error); } @@ -1489,24 +1604,14 @@ sysctl_root(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); #endif - oid->oid_running++; - SYSCTL_XUNLOCK(); #ifdef VIMAGE if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL) arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); #endif - if (!(oid->oid_kind & CTLFLAG_MPSAFE)) - mtx_lock(&Giant); - error = oid->oid_handler(oid, arg1, arg2, req); - if (!(oid->oid_kind & CTLFLAG_MPSAFE)) - mtx_unlock(&Giant); + error = sysctl_root_handler_locked(oid, arg1, arg2, req); KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); - SYSCTL_XLOCK(); - oid->oid_running--; - if (oid->oid_running == 0 && (oid->oid_kind & CTLFLAG_DYING) != 0) - wakeup(&oid->oid_running); return (error); } diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 9fe7ebe..78ceff2 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -128,10 +128,9 @@ struct bintime tc_tick_bt; sbintime_t tc_tick_sbt; int tc_precexp; int tc_timepercentage = TC_DEFAULTPERC; -TUNABLE_INT("kern.timecounter.alloweddeviation", &tc_timepercentage); static int sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_kern_timecounter, OID_AUTO, alloweddeviation, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_timecounter_adjprecision, "I", "Allowed time interval deviation in percents"); @@ -1794,7 +1793,10 @@ sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); tc_timepercentage = val; + if (cold) + goto done; tc_adjprecision(); +done: return (0); } diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index eee5474..905e24a 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -101,15 +101,15 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpcalls_dir, CTLFLAG_RD, &avg_mpcalls_dir, #endif static int ncallout; -SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, +SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &ncallout, 0, "Number of entries in callwheel and size of timeout() preallocation"); static int pin_default_swi = 0; static int pin_pcpu_swi = 0; -SYSCTL_INT(_kern, OID_AUTO, pin_default_swi, CTLFLAG_RDTUN, &pin_default_swi, +SYSCTL_INT(_kern, OID_AUTO, pin_default_swi, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pin_default_swi, 0, "Pin the default (non-per-cpu) swi (shared with PCPU 0 swi)"); -SYSCTL_INT(_kern, OID_AUTO, pin_pcpu_swi, CTLFLAG_RDTUN, &pin_pcpu_swi, +SYSCTL_INT(_kern, OID_AUTO, pin_pcpu_swi, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pin_pcpu_swi, 0, "Pin the per-CPU swis (except PCPU 0, which is also default"); /* diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 53b10ec..eb54445 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include <vm/uma.h> SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL); -SYSCTL_NODE(, OID_AUTO, dev, CTLFLAG_RW, NULL, NULL); +SYSCTL_ROOT_NODE(OID_AUTO, dev, CTLFLAG_RW, NULL, NULL); /* * Used to attach drivers to devclasses. @@ -149,9 +149,8 @@ static MALLOC_DEFINE(M_BUS_SC, "bus-sc", "Bus data structures, softc"); #ifdef BUS_DEBUG static int bus_debug = 1; -TUNABLE_INT("bus.debug", &bus_debug); -SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RW, &bus_debug, 0, - "Debug bus code"); +SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RWTUN, &bus_debug, 0, + "Bus debug level"); #define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a; printf("\n");} #define DEVICENAME(d) ((d)? device_get_name(d): "no device") @@ -357,16 +356,14 @@ device_sysctl_fini(device_t dev) /* Deprecated way to adjust queue length */ static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); -/* XXX Need to support old-style tunable hw.bus.devctl_disable" */ -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); #define DEVCTL_DEFAULT_QUEUE_LEN 1000 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; -TUNABLE_INT("hw.bus.devctl_queue", &devctl_queue_length); -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW | +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); static d_open_t devopen; @@ -791,11 +788,12 @@ sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) struct dev_event_info *n1; int dis, error; - dis = devctl_queue_length == 0; + dis = (devctl_queue_length == 0); error = sysctl_handle_int(oidp, &dis, 0, req); if (error || !req->newptr) return (error); - mtx_lock(&devsoftc.mtx); + if (mtx_initialized(&devsoftc.mtx)) + mtx_lock(&devsoftc.mtx); if (dis) { while (!TAILQ_EMPTY(&devsoftc.devq)) { n1 = TAILQ_FIRST(&devsoftc.devq); @@ -808,7 +806,8 @@ sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) } else { devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; } - mtx_unlock(&devsoftc.mtx); + if (mtx_initialized(&devsoftc.mtx)) + mtx_unlock(&devsoftc.mtx); return (0); } @@ -824,7 +823,8 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) return (error); if (q < 0) return (EINVAL); - mtx_lock(&devsoftc.mtx); + if (mtx_initialized(&devsoftc.mtx)) + mtx_lock(&devsoftc.mtx); devctl_queue_length = q; while (devsoftc.queued > devctl_queue_length) { n1 = TAILQ_FIRST(&devsoftc.devq); @@ -833,7 +833,8 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) free(n1, M_BUS); devsoftc.queued--; } - mtx_unlock(&devsoftc.mtx); + if (mtx_initialized(&devsoftc.mtx)) + mtx_unlock(&devsoftc.mtx); return (0); } diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index a7ed944..c26d271 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -108,14 +108,12 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN | CTLFLAG_SECURE, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_SECURE, &kdb_break_to_debugger, 0, "Enable break to debugger"); -TUNABLE_INT("debug.kdb.break_to_debugger", &kdb_break_to_debugger); SYSCTL_INT(_debug_kdb, OID_AUTO, alt_break_to_debugger, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN | CTLFLAG_SECURE, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_SECURE, &kdb_alt_break_to_debugger, 0, "Enable alternative break to debugger"); -TUNABLE_INT("debug.kdb.alt_break_to_debugger", &kdb_alt_break_to_debugger); /* * Flag to indicate to debuggers why the debugger was entered. diff --git a/sys/kern/subr_msgbuf.c b/sys/kern/subr_msgbuf.c index ecdbe72..fa23c91 100644 --- a/sys/kern/subr_msgbuf.c +++ b/sys/kern/subr_msgbuf.c @@ -53,9 +53,8 @@ static u_int msgbuf_cksum(struct msgbuf *mbp); * or other actions occured. */ static int msgbuf_show_timestamp = 0; -SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RWTUN, &msgbuf_show_timestamp, 0, "Show timestamp in msgbuf"); -TUNABLE_INT("kern.msgbuf_show_timestamp", &msgbuf_show_timestamp); /* * Initialize a message buffer of the specified size at the specified diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index afd3eac..f589097 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -107,32 +107,32 @@ u_long dflssiz; /* initial stack size limit */ u_long maxssiz; /* max stack size */ u_long sgrowsiz; /* amount to grow stack */ -SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, +SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &hz, 0, "Number of clock ticks per second"); -SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, +SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &nbuf, 0, "Number of buffers in the buffer cache"); -SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, +SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &nswbuf, 0, "Number of swap buffers"); -SYSCTL_INT(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN, &msgbufsize, 0, +SYSCTL_INT(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &msgbufsize, 0, "Size of the kernel message buffer"); -SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0, +SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxswzone, 0, "Maximum memory for swap metadata"); -SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, +SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxbcache, 0, "Maximum value of vfs.maxbufspace"); -SYSCTL_INT(_kern, OID_AUTO, bio_transient_maxcnt, CTLFLAG_RDTUN, +SYSCTL_INT(_kern, OID_AUTO, bio_transient_maxcnt, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &bio_transient_maxcnt, 0, "Maximum number of transient BIOs mappings"); -SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RW | CTLFLAG_TUN, &maxtsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxtsiz, 0, "Maximum text size"); -SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RW | CTLFLAG_TUN, &dfldsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &dfldsiz, 0, "Initial data size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RW | CTLFLAG_TUN, &maxdsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxdsiz, 0, "Maximum data size"); -SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RW | CTLFLAG_TUN, &dflssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &dflssiz, 0, "Initial stack size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RW | CTLFLAG_TUN, &maxssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &maxssiz, 0, "Maximum stack size"); -SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RW | CTLFLAG_TUN, &sgrowsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &sgrowsiz, 0, "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 28e33a4..814e57f 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -102,23 +102,20 @@ static void snprintf_func(int ch, void *arg); static int msgbufmapped; /* Set when safe to use msgbuf */ int msgbuftrigger; -static int log_console_output = 1; -TUNABLE_INT("kern.log_console_output", &log_console_output); -SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RW, - &log_console_output, 0, "Duplicate console output to the syslog."); +static int log_console_output = 1; +SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RWTUN, + &log_console_output, 0, "Duplicate console output to the syslog"); /* * See the comment in log_console() below for more explanation of this. */ -static int log_console_add_linefeed = 0; -TUNABLE_INT("kern.log_console_add_linefeed", &log_console_add_linefeed); -SYSCTL_INT(_kern, OID_AUTO, log_console_add_linefeed, CTLFLAG_RW, - &log_console_add_linefeed, 0, "log_console() adds extra newlines."); - -static int always_console_output = 0; -TUNABLE_INT("kern.always_console_output", &always_console_output); -SYSCTL_INT(_kern, OID_AUTO, always_console_output, CTLFLAG_RW, - &always_console_output, 0, "Always output to console despite TIOCCONS."); +static int log_console_add_linefeed; +SYSCTL_INT(_kern, OID_AUTO, log_console_add_linefeed, CTLFLAG_RWTUN, + &log_console_add_linefeed, 0, "log_console() adds extra newlines"); + +static int always_console_output; +SYSCTL_INT(_kern, OID_AUTO, always_console_output, CTLFLAG_RWTUN, + &always_console_output, 0, "Always output to console despite TIOCCONS"); /* * Warn that a system table is full. diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index c466b44..53480bf 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -100,8 +100,7 @@ struct resource_i { }; static int rman_debug = 0; -TUNABLE_INT("debug.rman_debug", &rman_debug); -SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RWTUN, &rman_debug, 0, "rman debug"); #define DPRINTF(params) if (rman_debug) printf params diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 122fc4c..90bbc5f 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -87,16 +87,14 @@ SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD | CTLTYPE_INT, NULL, 0, int smp_disabled = 0; /* has smp been disabled? */ SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, &smp_disabled, 0, "SMP has been disabled from the loader"); -TUNABLE_INT("kern.smp.disabled", &smp_disabled); int smp_cpus = 1; /* how many cpu's running */ SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online"); int smp_topology = 0; /* Which topology we're using. */ -SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RD, &smp_topology, 0, +SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, "Topology override setting; 0 is default provided by hardware."); -TUNABLE_INT("kern.smp.topology", &smp_topology); #ifdef SMP /* Enable forwarding of a signal to a process running on a different CPU */ diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 86e1b16..4ba4cf1 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -380,8 +380,7 @@ static SYSCTL_NODE(_debug, OID_AUTO, witness, CTLFLAG_RW, NULL, * completely disabled. */ static int witness_watch = 1; -TUNABLE_INT("debug.witness.watch", &witness_watch); -SYSCTL_PROC(_debug_witness, OID_AUTO, watch, CTLFLAG_RW | CTLTYPE_INT, NULL, 0, +SYSCTL_PROC(_debug_witness, OID_AUTO, watch, CTLFLAG_RWTUN | CTLTYPE_INT, NULL, 0, sysctl_debug_witness_watch, "I", "witness is watching lock operations"); #ifdef KDB @@ -396,8 +395,7 @@ int witness_kdb = 1; #else int witness_kdb = 0; #endif -TUNABLE_INT("debug.witness.kdb", &witness_kdb); -SYSCTL_INT(_debug_witness, OID_AUTO, kdb, CTLFLAG_RW, &witness_kdb, 0, ""); +SYSCTL_INT(_debug_witness, OID_AUTO, kdb, CTLFLAG_RWTUN, &witness_kdb, 0, ""); /* * When KDB is enabled and witness_trace is 1, it will cause the system @@ -406,8 +404,7 @@ SYSCTL_INT(_debug_witness, OID_AUTO, kdb, CTLFLAG_RW, &witness_kdb, 0, ""); * - locks are held when going to sleep. */ int witness_trace = 1; -TUNABLE_INT("debug.witness.trace", &witness_trace); -SYSCTL_INT(_debug_witness, OID_AUTO, trace, CTLFLAG_RW, &witness_trace, 0, ""); +SYSCTL_INT(_debug_witness, OID_AUTO, trace, CTLFLAG_RWTUN, &witness_trace, 0, ""); #endif /* KDB */ #ifdef WITNESS_SKIPSPIN @@ -415,9 +412,7 @@ int witness_skipspin = 1; #else int witness_skipspin = 0; #endif -TUNABLE_INT("debug.witness.skipspin", &witness_skipspin); -SYSCTL_INT(_debug_witness, OID_AUTO, skipspin, CTLFLAG_RDTUN, &witness_skipspin, - 0, ""); +SYSCTL_INT(_debug_witness, OID_AUTO, skipspin, CTLFLAG_RDTUN, &witness_skipspin, 0, ""); /* * Call this to print out the relations between locks. diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f3c3c0e..01cfeb9 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -205,7 +205,7 @@ static int pipeallocfail; static int piperesizefail; static int piperesizeallowed = 1; -SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN, +SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxpipekva, 0, "Pipe KVA limit"); SYSCTL_LONG(_kern_ipc, OID_AUTO, pipekva, CTLFLAG_RD, &amountpipekva, 0, "Pipe KVA usage"); diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index d58cb7e..a572a0e 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -196,13 +196,7 @@ msginit() { int i, error; - TUNABLE_INT_FETCH("kern.ipc.msgseg", &msginfo.msgseg); - TUNABLE_INT_FETCH("kern.ipc.msgssz", &msginfo.msgssz); msginfo.msgmax = msginfo.msgseg * msginfo.msgssz; - TUNABLE_INT_FETCH("kern.ipc.msgmni", &msginfo.msgmni); - TUNABLE_INT_FETCH("kern.ipc.msgmnb", &msginfo.msgmnb); - TUNABLE_INT_FETCH("kern.ipc.msgtql", &msginfo.msgtql); - msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK); msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK); msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index f9ff217..c632902 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -196,7 +196,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semmns, CTLFLAG_RDTUN, &seminfo.semmns, 0, "Maximum number of semaphores in the system"); SYSCTL_INT(_kern_ipc, OID_AUTO, semmnu, CTLFLAG_RDTUN, &seminfo.semmnu, 0, "Maximum number of undo structures in the system"); -SYSCTL_INT(_kern_ipc, OID_AUTO, semmsl, CTLFLAG_RW, &seminfo.semmsl, 0, +SYSCTL_INT(_kern_ipc, OID_AUTO, semmsl, CTLFLAG_RWTUN, &seminfo.semmsl, 0, "Max semaphores per id"); SYSCTL_INT(_kern_ipc, OID_AUTO, semopm, CTLFLAG_RDTUN, &seminfo.semopm, 0, "Max operations per semop call"); @@ -204,9 +204,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semume, CTLFLAG_RDTUN, &seminfo.semume, 0, "Max undo entries per process"); SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RDTUN, &seminfo.semusz, 0, "Size in bytes of undo structure"); -SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RW, &seminfo.semvmx, 0, +SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RWTUN, &seminfo.semvmx, 0, "Semaphore maximum value"); -SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RW, &seminfo.semaem, 0, +SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RWTUN, &seminfo.semaem, 0, "Adjust on exit max value"); SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_sema, "", "Semaphore id pool"); @@ -249,16 +249,6 @@ seminit(void) { int i, error; - TUNABLE_INT_FETCH("kern.ipc.semmni", &seminfo.semmni); - TUNABLE_INT_FETCH("kern.ipc.semmns", &seminfo.semmns); - TUNABLE_INT_FETCH("kern.ipc.semmnu", &seminfo.semmnu); - TUNABLE_INT_FETCH("kern.ipc.semmsl", &seminfo.semmsl); - TUNABLE_INT_FETCH("kern.ipc.semopm", &seminfo.semopm); - TUNABLE_INT_FETCH("kern.ipc.semume", &seminfo.semume); - TUNABLE_INT_FETCH("kern.ipc.semusz", &seminfo.semusz); - TUNABLE_INT_FETCH("kern.ipc.semvmx", &seminfo.semvmx); - TUNABLE_INT_FETCH("kern.ipc.semaem", &seminfo.semaem); - sem = malloc(sizeof(struct sem) * seminfo.semmns, M_SEM, M_WAITOK); sema = malloc(sizeof(struct semid_kernel) * seminfo.semmni, M_SEM, M_WAITOK); diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 4144d94..a7a7c16 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -156,29 +156,29 @@ static int sysctl_shmsegs(SYSCTL_HANDLER_ARGS); #endif struct shminfo shminfo = { - SHMMAX, - SHMMIN, - SHMMNI, - SHMSEG, - SHMALL + .shmmax = SHMMAX, + .shmmin = SHMMIN, + .shmmni = SHMMNI, + .shmseg = SHMSEG, + .shmall = SHMALL }; static int shm_use_phys; static int shm_allow_removed; -SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmmax, CTLFLAG_RW, &shminfo.shmmax, 0, +SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmmax, CTLFLAG_RWTUN, &shminfo.shmmax, 0, "Maximum shared memory segment size"); -SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmmin, CTLFLAG_RW, &shminfo.shmmin, 0, +SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmmin, CTLFLAG_RWTUN, &shminfo.shmmin, 0, "Minimum shared memory segment size"); SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmmni, CTLFLAG_RDTUN, &shminfo.shmmni, 0, "Number of shared memory identifiers"); SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmseg, CTLFLAG_RDTUN, &shminfo.shmseg, 0, "Number of segments per process"); -SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmall, CTLFLAG_RW, &shminfo.shmall, 0, +SYSCTL_ULONG(_kern_ipc, OID_AUTO, shmall, CTLFLAG_RWTUN, &shminfo.shmall, 0, "Maximum number of pages available for shared memory"); -SYSCTL_INT(_kern_ipc, OID_AUTO, shm_use_phys, CTLFLAG_RW, +SYSCTL_INT(_kern_ipc, OID_AUTO, shm_use_phys, CTLFLAG_RWTUN, &shm_use_phys, 0, "Enable/Disable locking of shared memory pages in core"); -SYSCTL_INT(_kern_ipc, OID_AUTO, shm_allow_removed, CTLFLAG_RW, +SYSCTL_INT(_kern_ipc, OID_AUTO, shm_allow_removed, CTLFLAG_RWTUN, &shm_allow_removed, 0, "Enable/Disable attachment to attached segments marked for removal"); SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLTYPE_OPAQUE | CTLFLAG_RD, @@ -887,20 +887,14 @@ shminit() if (TUNABLE_ULONG_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall) != 0) printf("kern.ipc.shmmaxpgs is now called kern.ipc.shmall!\n"); #endif - TUNABLE_ULONG_FETCH("kern.ipc.shmall", &shminfo.shmall); - if (!TUNABLE_ULONG_FETCH("kern.ipc.shmmax", &shminfo.shmmax)) { + if (shminfo.shmmax == SHMMAX) { /* Initialize shmmax dealing with possible overflow. */ - for (i = PAGE_SIZE; i > 0; i--) { + for (i = PAGE_SIZE; i != 0; i--) { shminfo.shmmax = shminfo.shmall * i; - if (shminfo.shmmax >= shminfo.shmall) + if ((shminfo.shmmax / shminfo.shmall) == (u_long)i) break; } } - TUNABLE_ULONG_FETCH("kern.ipc.shmmin", &shminfo.shmmin); - TUNABLE_ULONG_FETCH("kern.ipc.shmmni", &shminfo.shmmni); - TUNABLE_ULONG_FETCH("kern.ipc.shmseg", &shminfo.shmseg); - TUNABLE_INT_FETCH("kern.ipc.shm_use_phys", &shm_use_phys); - shmalloced = shminfo.shmmni; shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK); for (i = 0; i < shmalloced; i++) { diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index eab48fb..66a6b00 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -72,7 +72,6 @@ struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf); * changing for file systems that use vfc_typenum in their fsid. */ static int vfs_typenumhash = 1; -TUNABLE_INT("vfs.typenumhash", &vfs_typenumhash); SYSCTL_INT(_vfs, OID_AUTO, typenumhash, CTLFLAG_RDTUN, &vfs_typenumhash, 0, "Set vfc_typenum using a hash calculation on vfc_name, so that it does not" "change when file systems are loaded in a different order."); @@ -213,7 +212,7 @@ vfs_register(struct vfsconf *vfc) * number. */ sysctl_lock(); - SLIST_FOREACH(oidp, &sysctl__vfs_children, oid_link) + SLIST_FOREACH(oidp, SYSCTL_CHILDREN(&sysctl___vfs), oid_link) if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { sysctl_unregister_oid(oidp); oidp->oid_number = vfc->vfc_typenum; diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 00dd496..f466ca4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -96,9 +96,8 @@ nameiinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL); static int lookup_shared = 1; -SYSCTL_INT(_vfs, OID_AUTO, lookup_shared, CTLFLAG_RW, &lookup_shared, 0, +SYSCTL_INT(_vfs, OID_AUTO, lookup_shared, CTLFLAG_RWTUN, &lookup_shared, 0, "Enables/Disables shared locks for path name translation"); -TUNABLE_INT("vfs.lookup_shared", &lookup_shared); /* * Convert a pathname into a pointer to a locked vnode. diff --git a/sys/mips/cavium/usb/octusb.c b/sys/mips/cavium/usb/octusb.c index cad3ef5..c4d4ac7 100644 --- a/sys/mips/cavium/usb/octusb.c +++ b/sys/mips/cavium/usb/octusb.c @@ -82,11 +82,8 @@ __FBSDID("$FreeBSD$"); static int octusbdebug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, octusb, CTLFLAG_RW, 0, "OCTUSB"); -SYSCTL_INT(_hw_usb_octusb, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_octusb, OID_AUTO, debug, CTLFLAG_RWTUN, &octusbdebug, 0, "OCTUSB debug level"); - -TUNABLE_INT("hw.usb.octusb.debug", &octusbdebug); - #endif struct octusb_std_temp { diff --git a/sys/mips/mips/dump_machdep.c b/sys/mips/mips/dump_machdep.c index bf8c4a3..54224f2 100644 --- a/sys/mips/mips/dump_machdep.c +++ b/sys/mips/mips/dump_machdep.c @@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; -TUNABLE_INT("debug.minidump", &do_minidump); -SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, "Enable mini crash dumps"); /* diff --git a/sys/mips/rt305x/uart_dev_rt305x.c b/sys/mips/rt305x/uart_dev_rt305x.c index 3154cb9..d4f2319 100644 --- a/sys/mips/rt305x/uart_dev_rt305x.c +++ b/sys/mips/rt305x/uart_dev_rt305x.c @@ -73,13 +73,9 @@ static struct uart_ops uart_rt305x_uart_ops = { }; static int uart_output = 1; -TUNABLE_INT("kern.uart_output", &uart_output); -SYSCTL_INT(_kern, OID_AUTO, uart_output, CTLFLAG_RW, +SYSCTL_INT(_kern, OID_AUTO, uart_output, CTLFLAG_RWTUN, &uart_output, 0, "UART output enabled."); - - - static int rt305x_uart_probe(struct uart_bas *bas) { diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index aa38efa..12cc721 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -192,9 +192,8 @@ static void lacp_dprintf(const struct lacp_port *, const char *, ...) static int lacp_debug = 0; SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad"); -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN, &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); -TUNABLE_INT("net.link.lagg.lacp.debug", &lacp_debug); #define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; } #define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } diff --git a/sys/net/if.c b/sys/net/if.c index 47b5b9d..5a05c97 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -106,7 +106,6 @@ struct ifindex_entry { SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); -TUNABLE_INT("net.link.ifqmaxlen", &ifqmaxlen); SYSCTL_INT(_net_link, OID_AUTO, ifqmaxlen, CTLFLAG_RDTUN, &ifqmaxlen, 0, "max send queue size"); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 4e08573..59d63ee 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -359,27 +359,20 @@ static int pfil_local_phys = 0; /* run pfil hooks on the physical interface for locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ -TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RWTUN, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); -TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); -SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RWTUN, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); -TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RWTUN, &pfil_bridge, 0, "Packet filter on the bridge interface"); -TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RWTUN, &pfil_member, 0, "Packet filter on the member interface"); -TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RWTUN, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); -TUNABLE_INT("net.link.bridge.log_stp", &log_stp); -SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RWTUN, &log_stp, 0, "Log STP state changes"); -TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); -SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, +SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RWTUN, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 1bab4f9..ec868e1 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -180,13 +180,11 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW, &lagg_failover_rx_all, 0, "Accept input from any interface in a failover lagg"); static int def_use_flowid = 1; /* Default value for using M_FLOWID */ -TUNABLE_INT("net.link.lagg.default_use_flowid", &def_use_flowid); -SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RW, +SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, &def_use_flowid, 0, "Default setting for using flow id for load sharing"); static int def_flowid_shift = 16; /* Default value for using M_FLOWID */ -TUNABLE_INT("net.link.lagg.default_flowid_shift", &def_flowid_shift); -SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RW, +SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN, &def_flowid_shift, 0, "Default setting for flowid shift for load sharing"); diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 28888ed..8578818 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -129,8 +129,7 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, route_cache, CTLFLAG_RW, &stf_route_cache, 0, "Caching of IPv4 routes for 6to4 Output"); static int stf_permit_rfc1918 = 0; -TUNABLE_INT("net.link.stf.permit_rfc1918", &stf_permit_rfc1918); -SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CTLFLAG_RWTUN, &stf_permit_rfc1918, 0, "Permit the use of private IPv4 addresses"); #define STFUNIT 0 diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index d788635..89cac22 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -170,12 +170,10 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, user_open, CTLFLAG_RW, &tapuopen, 0, "Allow user to open /dev/tap (based on node permissions)"); SYSCTL_INT(_net_link_tap, OID_AUTO, up_on_open, CTLFLAG_RW, &tapuponopen, 0, "Bring interface up when /dev/tap is opened"); -SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTLFLAG_RW, &tapdclone, 0, +SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tapdclone, 0, "Enably legacy devfs interface creation"); SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); -TUNABLE_INT("net.link.tap.devfs_cloning", &tapdclone); - DEV_MODULE(if_tap, tapmodevent, NULL); static int diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 504bab0..e4bc2af 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -116,11 +116,9 @@ SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, "IP tunnel software network interface."); -SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTLFLAG_RW, &tundclone, 0, +SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tundclone, 0, "Enable legacy devfs interface creation."); -TUNABLE_INT("net.link.tun.devfs_cloning", &tundclone); - static void tunclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev); static void tuncreate(const char *name, struct cdev *dev); diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 7974cc8..049bbf1 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -149,8 +149,8 @@ static SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr"); #define NETISR_DISPATCH_POLICY_MAXSTR 20 /* Used for temporary buffers. */ static u_int netisr_dispatch_policy = NETISR_DISPATCH_POLICY_DEFAULT; static int sysctl_netisr_dispatch_policy(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_net_isr, OID_AUTO, dispatch, CTLTYPE_STRING | CTLFLAG_RW | - CTLFLAG_TUN, 0, 0, sysctl_netisr_dispatch_policy, "A", +SYSCTL_PROC(_net_isr, OID_AUTO, dispatch, CTLTYPE_STRING | CTLFLAG_RWTUN, + 0, 0, sysctl_netisr_dispatch_policy, "A", "netisr dispatch policy"); /* @@ -160,13 +160,11 @@ SYSCTL_PROC(_net_isr, OID_AUTO, dispatch, CTLTYPE_STRING | CTLFLAG_RW | * We will create at most one thread per CPU. */ static int netisr_maxthreads = -1; /* Max number of threads. */ -TUNABLE_INT("net.isr.maxthreads", &netisr_maxthreads); SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RDTUN, &netisr_maxthreads, 0, "Use at most this many CPUs for netisr processing"); static int netisr_bindthreads = 0; /* Bind threads to CPUs. */ -TUNABLE_INT("net.isr.bindthreads", &netisr_bindthreads); SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RDTUN, &netisr_bindthreads, 0, "Bind netisr threads to CPUs."); @@ -177,7 +175,6 @@ SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RDTUN, */ #define NETISR_DEFAULT_MAXQLIMIT 10240 static u_int netisr_maxqlimit = NETISR_DEFAULT_MAXQLIMIT; -TUNABLE_INT("net.isr.maxqlimit", &netisr_maxqlimit); SYSCTL_UINT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RDTUN, &netisr_maxqlimit, 0, "Maximum netisr per-protocol, per-CPU queue depth."); @@ -189,7 +186,6 @@ SYSCTL_UINT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RDTUN, */ #define NETISR_DEFAULT_DEFAULTQLIMIT 256 static u_int netisr_defaultqlimit = NETISR_DEFAULT_DEFAULTQLIMIT; -TUNABLE_INT("net.isr.defaultqlimit", &netisr_defaultqlimit); SYSCTL_UINT(_net_isr, OID_AUTO, defaultqlimit, CTLFLAG_RDTUN, &netisr_defaultqlimit, 0, "Default netisr per-protocol, per-CPU queue limit if not set by protocol"); @@ -1120,10 +1116,6 @@ netisr_start_swi(u_int cpuid, struct pcpu *pc) static void netisr_init(void *arg) { - char tmp[NETISR_DISPATCH_POLICY_MAXSTR]; - u_int dispatch_policy; - int error; - KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); NETISR_LOCK_INIT(); @@ -1152,20 +1144,6 @@ netisr_init(void *arg) netisr_bindthreads = 0; } #endif - - if (TUNABLE_STR_FETCH("net.isr.dispatch", tmp, sizeof(tmp))) { - error = netisr_dispatch_policy_from_str(tmp, - &dispatch_policy); - if (error == 0 && dispatch_policy == NETISR_DISPATCH_DEFAULT) - error = EINVAL; - if (error == 0) - netisr_dispatch_policy = dispatch_policy; - else - printf( - "%s: invalid dispatch policy %s, using default\n", - __func__, tmp); - } - netisr_start_swi(curcpu, pcpu_find(curcpu)); } SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL); diff --git a/sys/net/route.c b/sys/net/route.c index 83cc857..547418a 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -96,9 +96,7 @@ extern void sctp_addr_change(struct ifaddr *ifa, int cmd); /* This is read-only.. */ u_int rt_numfibs = RT_NUMFIBS; -SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, ""); -/* and this can be set too big but will be fixed before it is used */ -TUNABLE_INT("net.fibs", &rt_numfibs); +SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLAG_RDTUN, &rt_numfibs, 0, ""); /* * By default add routes to all fibs for new interfaces. @@ -111,9 +109,8 @@ TUNABLE_INT("net.fibs", &rt_numfibs); * from the network stack context. */ u_int rt_add_addr_allfibs = 1; -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW, +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN, &rt_add_addr_allfibs, 0, ""); -TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs); VNET_DEFINE(struct rtstat, rtstat); #define V_rtstat VNET(rtstat) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index e83967b..1970965 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -2954,13 +2954,10 @@ static int numthreads = 0; /* number of queue threads */ static int maxalloc = 4096;/* limit the damage of a leak */ static int maxdata = 512; /* limit the damage of a DoS */ -TUNABLE_INT("net.graph.threads", &numthreads); SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, 0, "Number of queue processing threads"); -TUNABLE_INT("net.graph.maxalloc", &maxalloc); SYSCTL_INT(_net_graph, OID_AUTO, maxalloc, CTLFLAG_RDTUN, &maxalloc, 0, "Maximum number of non-data queue items to allocate"); -TUNABLE_INT("net.graph.maxdata", &maxdata); SYSCTL_INT(_net_graph, OID_AUTO, maxdata, CTLFLAG_RDTUN, &maxdata, 0, "Maximum number of data queue items to allocate"); diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c index 14d44de..76f4c3b 100644 --- a/sys/netgraph/ng_mppc.c +++ b/sys/netgraph/ng_mppc.c @@ -111,18 +111,15 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "netgraph_mppc", "netgraph mppc node"); SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW, 0, "MPPE"); static int mppe_block_on_max_rekey = 0; -TUNABLE_INT("net.graph.mppe.block_on_max_rekey", &mppe_block_on_max_rekey); -SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RW, +SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RWTUN, &mppe_block_on_max_rekey, 0, "Block node on max MPPE key re-calculations"); static int mppe_log_max_rekey = 1; -TUNABLE_INT("net.graph.mppe.log_max_rekey", &mppe_log_max_rekey); -SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RW, +SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RWTUN, &mppe_log_max_rekey, 0, "Log max MPPE key re-calculations event"); static int mppe_max_rekey = MPPE_MAX_REKEY; -TUNABLE_INT("net.graph.mppe.max_rekey", &mppe_max_rekey); -SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RW, +SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RWTUN, &mppe_max_rekey, 0, "Maximum number of MPPE key re-calculations"); /* MPPC packet header bits */ diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index d996bd1..26d4e8e 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -166,20 +166,17 @@ static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mcast, CTLFLAG_RW, 0, static u_long in_mcast_maxgrpsrc = IP_MAX_GROUP_SRC_FILTER; SYSCTL_ULONG(_net_inet_ip_mcast, OID_AUTO, maxgrpsrc, - CTLFLAG_RW | CTLFLAG_TUN, &in_mcast_maxgrpsrc, 0, + CTLFLAG_RWTUN, &in_mcast_maxgrpsrc, 0, "Max source filters per group"); -TUNABLE_ULONG("net.inet.ip.mcast.maxgrpsrc", &in_mcast_maxgrpsrc); static u_long in_mcast_maxsocksrc = IP_MAX_SOCK_SRC_FILTER; SYSCTL_ULONG(_net_inet_ip_mcast, OID_AUTO, maxsocksrc, - CTLFLAG_RW | CTLFLAG_TUN, &in_mcast_maxsocksrc, 0, + CTLFLAG_RWTUN, &in_mcast_maxsocksrc, 0, "Max source filters per socket"); -TUNABLE_ULONG("net.inet.ip.mcast.maxsocksrc", &in_mcast_maxsocksrc); int in_mcast_loop = IP_DEFAULT_MULTICAST_LOOP; -SYSCTL_INT(_net_inet_ip_mcast, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_net_inet_ip_mcast, OID_AUTO, loop, CTLFLAG_RWTUN, &in_mcast_loop, 0, "Loopback multicast datagrams by default"); -TUNABLE_INT("net.inet.ip.mcast.loop", &in_mcast_loop); static SYSCTL_NODE(_net_inet_ip_mcast, OID_AUTO, filters, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip_mcast_filters, diff --git a/sys/netinet/in_rss.c b/sys/netinet/in_rss.c index 698373f..4e6a454 100644 --- a/sys/netinet/in_rss.c +++ b/sys/netinet/in_rss.c @@ -91,9 +91,8 @@ SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side steering"); * default. */ static u_int rss_hashalgo = RSS_HASH_TOEPLITZ; -SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RD, &rss_hashalgo, 0, +SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RDTUN, &rss_hashalgo, 0, "RSS hash algorithm"); -TUNABLE_INT("net.inet.rss.hashalgo", &rss_hashalgo); /* * Size of the indirection table; at most 128 entries per the RSS spec. We @@ -104,9 +103,8 @@ TUNABLE_INT("net.inet.rss.hashalgo", &rss_hashalgo); * XXXRW: buckets might be better to use for the tunable than bits. */ static u_int rss_bits; -SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RD, &rss_bits, 0, +SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RDTUN, &rss_bits, 0, "RSS bits"); -TUNABLE_INT("net.inet.rss.bits", &rss_bits); static u_int rss_mask; SYSCTL_INT(_net_inet_rss, OID_AUTO, mask, CTLFLAG_RD, &rss_mask, 0, diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fb2c415..ac0aad3 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -188,8 +188,8 @@ 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 = 0; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, +static int tcp_tcbhashsize; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); static int do_tcpdrain = 1; @@ -211,7 +211,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW, &VNET_NAME(tcp_isn_reseed_interval), 0, "Seconds between reseeding of ISN secret"); -static int tcp_soreceive_stream = 0; +static int tcp_soreceive_stream; SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets"); @@ -398,7 +398,6 @@ tcp_init(void) tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; - TUNABLE_INT_FETCH("net.inet.tcp.soreceive_stream", &tcp_soreceive_stream); if (tcp_soreceive_stream) { #ifdef INET tcp_usrreqs.pru_soreceive = soreceive_stream; diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index d259997..f9ff10a 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -158,21 +158,18 @@ static SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, static u_long in6_mcast_maxgrpsrc = IPV6_MAX_GROUP_SRC_FILTER; SYSCTL_ULONG(_net_inet6_ip6_mcast, OID_AUTO, maxgrpsrc, - CTLFLAG_RW | CTLFLAG_TUN, &in6_mcast_maxgrpsrc, 0, + CTLFLAG_RWTUN, &in6_mcast_maxgrpsrc, 0, "Max source filters per group"); -TUNABLE_ULONG("net.inet6.ip6.mcast.maxgrpsrc", &in6_mcast_maxgrpsrc); static u_long in6_mcast_maxsocksrc = IPV6_MAX_SOCK_SRC_FILTER; SYSCTL_ULONG(_net_inet6_ip6_mcast, OID_AUTO, maxsocksrc, - CTLFLAG_RW | CTLFLAG_TUN, &in6_mcast_maxsocksrc, 0, + CTLFLAG_RWTUN, &in6_mcast_maxsocksrc, 0, "Max source filters per socket"); -TUNABLE_ULONG("net.inet6.ip6.mcast.maxsocksrc", &in6_mcast_maxsocksrc); /* TODO Virtualize this switch. */ int in6_mcast_loop = IPV6_DEFAULT_MULTICAST_LOOP; -SYSCTL_INT(_net_inet6_ip6_mcast, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_net_inet6_ip6_mcast, OID_AUTO, loop, CTLFLAG_RWTUN, &in6_mcast_loop, 0, "Loopback multicast datagrams by default"); -TUNABLE_INT("net.inet6.ip6.mcast.loop", &in6_mcast_loop); static SYSCTL_NODE(_net_inet6_ip6_mcast, OID_AUTO, filters, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip6_mcast_filters, diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index c40ef9e..2e46208 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -238,14 +238,12 @@ static SYSCTL_NODE(_net_inet6_mld, OID_AUTO, ifinfo, "Per-interface MLDv2 state"); static int mld_v1enable = 1; -SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_RWTUN, &mld_v1enable, 0, "Enable fallback to MLDv1"); -TUNABLE_INT("net.inet6.mld.v1enable", &mld_v1enable); static int mld_use_allow = 1; -SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RW, +SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RWTUN, &mld_use_allow, 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); -TUNABLE_INT("net.inet6.mld.use_allow", &mld_use_allow); /* * Packed Router Alert option structure declaration. diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index ecb0f2d..9190091 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -181,7 +181,6 @@ SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, tables_max, SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, default_to_accept, CTLFLAG_RDTUN, &default_to_accept, 0, "Make the default rule accept all packets."); -TUNABLE_INT("net.inet.ip.fw.default_to_accept", &default_to_accept); TUNABLE_INT("net.inet.ip.fw.tables_max", (int *)&default_fw_tables); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, CTLFLAG_RD, &VNET_NAME(layer3_chain.n_rules), 0, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0945201..6c97151 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -743,10 +743,8 @@ pf_initialize() struct pf_srchash *sh; u_int i; - TUNABLE_ULONG_FETCH("net.pf.states_hashsize", &pf_hashsize); if (pf_hashsize == 0 || !powerof2(pf_hashsize)) pf_hashsize = PF_HASHSIZ; - TUNABLE_ULONG_FETCH("net.pf.source_nodes_hashsize", &pf_srchashsize); if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) pf_srchashsize = PF_HASHSIZ / 4; diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 754d4ad..d128658 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -704,7 +704,7 @@ sysctl_machdep_comdefaultrate(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NOFETCH, 0, 0, sysctl_machdep_comdefaultrate, "I", ""); TUNABLE_INT("machdep.conspeed", __DEVOLATILE(int *, &comdefaultrate)); diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index b9c6a4e..f7883c4 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -1113,8 +1113,7 @@ cpu_halt(void) } static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ -TUNABLE_INT("machdep.idle_mwait", &idle_mwait); -SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait, 0, "Use MONITOR/MWAIT for short idle"); #define STATE_RUNNING 0x0 diff --git a/sys/pc98/pc98/pc98_machdep.c b/sys/pc98/pc98/pc98_machdep.c index aed4eaa..9f9fbcc 100644 --- a/sys/pc98/pc98/pc98_machdep.c +++ b/sys/pc98/pc98/pc98_machdep.c @@ -49,8 +49,7 @@ static int ad_geom_method = AD_GEOM_ADJUST_COMPATIDE; -TUNABLE_INT("machdep.ad_geom_method", &ad_geom_method); -SYSCTL_INT(_machdep, OID_AUTO, ad_geom_method, CTLFLAG_RW, &ad_geom_method, 0, +SYSCTL_INT(_machdep, OID_AUTO, ad_geom_method, CTLFLAG_RWTUN, &ad_geom_method, 0, "IDE disk geometry conversion method"); /* diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 375b8a3..b5bf8c3 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -100,43 +100,36 @@ SYSCTL_INT(_security_mac_biba, OID_AUTO, label_size, CTLFLAG_RD, &biba_label_size, 0, "Size of struct mac_biba"); static int biba_enabled = 1; -SYSCTL_INT(_security_mac_biba, OID_AUTO, enabled, CTLFLAG_RW, &biba_enabled, +SYSCTL_INT(_security_mac_biba, OID_AUTO, enabled, CTLFLAG_RWTUN, &biba_enabled, 0, "Enforce MAC/Biba policy"); -TUNABLE_INT("security.mac.biba.enabled", &biba_enabled); static int destroyed_not_inited; SYSCTL_INT(_security_mac_biba, OID_AUTO, destroyed_not_inited, CTLFLAG_RD, &destroyed_not_inited, 0, "Count of labels destroyed but not inited"); static int trust_all_interfaces = 0; -SYSCTL_INT(_security_mac_biba, OID_AUTO, trust_all_interfaces, CTLFLAG_RD, +SYSCTL_INT(_security_mac_biba, OID_AUTO, trust_all_interfaces, CTLFLAG_RDTUN, &trust_all_interfaces, 0, "Consider all interfaces 'trusted' by MAC/Biba"); -TUNABLE_INT("security.mac.biba.trust_all_interfaces", &trust_all_interfaces); static char trusted_interfaces[128]; -SYSCTL_STRING(_security_mac_biba, OID_AUTO, trusted_interfaces, CTLFLAG_RD, +SYSCTL_STRING(_security_mac_biba, OID_AUTO, trusted_interfaces, CTLFLAG_RDTUN, trusted_interfaces, 0, "Interfaces considered 'trusted' by MAC/Biba"); -TUNABLE_STR("security.mac.biba.trusted_interfaces", trusted_interfaces, - sizeof(trusted_interfaces)); static int max_compartments = MAC_BIBA_MAX_COMPARTMENTS; SYSCTL_INT(_security_mac_biba, OID_AUTO, max_compartments, CTLFLAG_RD, &max_compartments, 0, "Maximum supported compartments"); static int ptys_equal = 0; -SYSCTL_INT(_security_mac_biba, OID_AUTO, ptys_equal, CTLFLAG_RW, &ptys_equal, +SYSCTL_INT(_security_mac_biba, OID_AUTO, ptys_equal, CTLFLAG_RWTUN, &ptys_equal, 0, "Label pty devices as biba/equal on create"); -TUNABLE_INT("security.mac.biba.ptys_equal", &ptys_equal); static int interfaces_equal = 1; -SYSCTL_INT(_security_mac_biba, OID_AUTO, interfaces_equal, CTLFLAG_RW, +SYSCTL_INT(_security_mac_biba, OID_AUTO, interfaces_equal, CTLFLAG_RWTUN, &interfaces_equal, 0, "Label network interfaces as biba/equal on create"); -TUNABLE_INT("security.mac.biba.interfaces_equal", &interfaces_equal); static int revocation_enabled = 0; -SYSCTL_INT(_security_mac_biba, OID_AUTO, revocation_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_biba, OID_AUTO, revocation_enabled, CTLFLAG_RWTUN, &revocation_enabled, 0, "Revoke access to objects on relabel"); -TUNABLE_INT("security.mac.biba.revocation_enabled", &revocation_enabled); static int biba_slot; #define SLOT(l) ((struct mac_biba *)mac_label_get((l), biba_slot)) diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c index ccbc525..377fd25 100644 --- a/sys/security/mac_bsdextended/mac_bsdextended.c +++ b/sys/security/mac_bsdextended/mac_bsdextended.c @@ -76,9 +76,8 @@ static SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, CTLFLAG_RW, 0, "TrustedBSD extended BSD MAC policy controls"); static int ugidfw_enabled = 1; -SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, enabled, CTLFLAG_RWTUN, &ugidfw_enabled, 0, "Enforce extended BSD policy"); -TUNABLE_INT("security.mac.bsdextended.enabled", &ugidfw_enabled); static MALLOC_DEFINE(M_MACBSDEXTENDED, "mac_bsdextended", "BSD Extended MAC rule"); diff --git a/sys/security/mac_ifoff/mac_ifoff.c b/sys/security/mac_ifoff/mac_ifoff.c index 7165f90..28097b5 100644 --- a/sys/security/mac_ifoff/mac_ifoff.c +++ b/sys/security/mac_ifoff/mac_ifoff.c @@ -66,25 +66,21 @@ static SYSCTL_NODE(_security_mac, OID_AUTO, ifoff, CTLFLAG_RW, 0, "TrustedBSD mac_ifoff policy controls"); static int ifoff_enabled = 1; -SYSCTL_INT(_security_mac_ifoff, OID_AUTO, enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_ifoff, OID_AUTO, enabled, CTLFLAG_RWTUN, &ifoff_enabled, 0, "Enforce ifoff policy"); -TUNABLE_INT("security.mac.ifoff.enabled", &ifoff_enabled); static int ifoff_lo_enabled = 1; -SYSCTL_INT(_security_mac_ifoff, OID_AUTO, lo_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_ifoff, OID_AUTO, lo_enabled, CTLFLAG_RWTUN, &ifoff_lo_enabled, 0, "Enable loopback interfaces"); -TUNABLE_INT("security.mac.ifoff.lo_enabled", &ifoff_lo_enabled); static int ifoff_other_enabled = 0; -SYSCTL_INT(_security_mac_ifoff, OID_AUTO, other_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_ifoff, OID_AUTO, other_enabled, CTLFLAG_RWTUN, &ifoff_other_enabled, 0, "Enable other interfaces"); -TUNABLE_INT("security.mac.ifoff.other_enabled", &ifoff_other_enabled); static int ifoff_bpfrecv_enabled = 0; -SYSCTL_INT(_security_mac_ifoff, OID_AUTO, bpfrecv_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_ifoff, OID_AUTO, bpfrecv_enabled, CTLFLAG_RWTUN, &ifoff_bpfrecv_enabled, 0, "Enable BPF reception even when interface " "is disabled"); -TUNABLE_INT("security.mac.ifoff.bpfrecv.enabled", &ifoff_bpfrecv_enabled); static int ifnet_check_outgoing(struct ifnet *ifp) diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index b2b9f74..cf66423 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -101,34 +101,28 @@ SYSCTL_INT(_security_mac_lomac, OID_AUTO, label_size, CTLFLAG_RD, &lomac_label_size, 0, "Size of struct mac_lomac"); static int lomac_enabled = 1; -SYSCTL_INT(_security_mac_lomac, OID_AUTO, enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_lomac, OID_AUTO, enabled, CTLFLAG_RWTUN, &lomac_enabled, 0, "Enforce MAC/LOMAC policy"); -TUNABLE_INT("security.mac.lomac.enabled", &lomac_enabled); static int destroyed_not_inited; SYSCTL_INT(_security_mac_lomac, OID_AUTO, destroyed_not_inited, CTLFLAG_RD, &destroyed_not_inited, 0, "Count of labels destroyed but not inited"); static int trust_all_interfaces = 0; -SYSCTL_INT(_security_mac_lomac, OID_AUTO, trust_all_interfaces, CTLFLAG_RD, +SYSCTL_INT(_security_mac_lomac, OID_AUTO, trust_all_interfaces, CTLFLAG_RDTUN, &trust_all_interfaces, 0, "Consider all interfaces 'trusted' by MAC/LOMAC"); -TUNABLE_INT("security.mac.lomac.trust_all_interfaces", &trust_all_interfaces); static char trusted_interfaces[128]; -SYSCTL_STRING(_security_mac_lomac, OID_AUTO, trusted_interfaces, CTLFLAG_RD, +SYSCTL_STRING(_security_mac_lomac, OID_AUTO, trusted_interfaces, CTLFLAG_RDTUN, trusted_interfaces, 0, "Interfaces considered 'trusted' by MAC/LOMAC"); -TUNABLE_STR("security.mac.lomac.trusted_interfaces", trusted_interfaces, - sizeof(trusted_interfaces)); static int ptys_equal = 0; -SYSCTL_INT(_security_mac_lomac, OID_AUTO, ptys_equal, CTLFLAG_RW, +SYSCTL_INT(_security_mac_lomac, OID_AUTO, ptys_equal, CTLFLAG_RWTUN, &ptys_equal, 0, "Label pty devices as lomac/equal on create"); -TUNABLE_INT("security.mac.lomac.ptys_equal", &ptys_equal); static int revocation_enabled = 1; -SYSCTL_INT(_security_mac_lomac, OID_AUTO, revocation_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_lomac, OID_AUTO, revocation_enabled, CTLFLAG_RWTUN, &revocation_enabled, 0, "Revoke access to objects on relabel"); -TUNABLE_INT("security.mac.lomac.revocation_enabled", &revocation_enabled); static int lomac_slot; #define SLOT(l) ((struct mac_lomac *)mac_label_get((l), lomac_slot)) diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index d7ca5a5..6a074d0 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -101,23 +101,20 @@ SYSCTL_INT(_security_mac_mls, OID_AUTO, label_size, CTLFLAG_RD, &mls_label_size, 0, "Size of struct mac_mls"); static int mls_enabled = 1; -SYSCTL_INT(_security_mac_mls, OID_AUTO, enabled, CTLFLAG_RW, &mls_enabled, 0, +SYSCTL_INT(_security_mac_mls, OID_AUTO, enabled, CTLFLAG_RWTUN, &mls_enabled, 0, "Enforce MAC/MLS policy"); -TUNABLE_INT("security.mac.mls.enabled", &mls_enabled); static int destroyed_not_inited; SYSCTL_INT(_security_mac_mls, OID_AUTO, destroyed_not_inited, CTLFLAG_RD, &destroyed_not_inited, 0, "Count of labels destroyed but not inited"); static int ptys_equal = 0; -SYSCTL_INT(_security_mac_mls, OID_AUTO, ptys_equal, CTLFLAG_RW, +SYSCTL_INT(_security_mac_mls, OID_AUTO, ptys_equal, CTLFLAG_RWTUN, &ptys_equal, 0, "Label pty devices as mls/equal on create"); -TUNABLE_INT("security.mac.mls.ptys_equal", &ptys_equal); static int revocation_enabled = 0; -SYSCTL_INT(_security_mac_mls, OID_AUTO, revocation_enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_mls, OID_AUTO, revocation_enabled, CTLFLAG_RWTUN, &revocation_enabled, 0, "Revoke access to objects on relabel"); -TUNABLE_INT("security.mac.mls.revocation_enabled", &revocation_enabled); static int max_compartments = MAC_MLS_MAX_COMPARTMENTS; SYSCTL_INT(_security_mac_mls, OID_AUTO, max_compartments, CTLFLAG_RD, diff --git a/sys/security/mac_portacl/mac_portacl.c b/sys/security/mac_portacl/mac_portacl.c index 1dbd199..17427ee 100644 --- a/sys/security/mac_portacl/mac_portacl.c +++ b/sys/security/mac_portacl/mac_portacl.c @@ -87,27 +87,21 @@ static SYSCTL_NODE(_security_mac, OID_AUTO, portacl, CTLFLAG_RW, 0, "TrustedBSD mac_portacl policy controls"); static int portacl_enabled = 1; -SYSCTL_INT(_security_mac_portacl, OID_AUTO, enabled, CTLFLAG_RW, +SYSCTL_INT(_security_mac_portacl, OID_AUTO, enabled, CTLFLAG_RWTUN, &portacl_enabled, 0, "Enforce portacl policy"); -TUNABLE_INT("security.mac.portacl.enabled", &portacl_enabled); static int portacl_suser_exempt = 1; -SYSCTL_INT(_security_mac_portacl, OID_AUTO, suser_exempt, CTLFLAG_RW, +SYSCTL_INT(_security_mac_portacl, OID_AUTO, suser_exempt, CTLFLAG_RWTUN, &portacl_suser_exempt, 0, "Privilege permits binding of any port"); -TUNABLE_INT("security.mac.portacl.suser_exempt", - &portacl_suser_exempt); static int portacl_autoport_exempt = 1; -SYSCTL_INT(_security_mac_portacl, OID_AUTO, autoport_exempt, CTLFLAG_RW, +SYSCTL_INT(_security_mac_portacl, OID_AUTO, autoport_exempt, CTLFLAG_RWTUN, &portacl_autoport_exempt, 0, "Allow automatic allocation through " "binding port 0 if not IP_PORTRANGELOW"); -TUNABLE_INT("security.mac.portacl.autoport_exempt", - &portacl_autoport_exempt); static int portacl_port_high = 1023; -SYSCTL_INT(_security_mac_portacl, OID_AUTO, port_high, CTLFLAG_RW, +SYSCTL_INT(_security_mac_portacl, OID_AUTO, port_high, CTLFLAG_RWTUN, &portacl_port_high, 0, "Highest port to enforce for"); -TUNABLE_INT("security.mac.portacl.port_high", &portacl_port_high); static MALLOC_DEFINE(M_PORTACL, "portacl_rule", "Rules for mac_portacl"); diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c index ec8d90f..57e0f48 100644 --- a/sys/sparc64/pci/psycho.c +++ b/sys/sparc64/pci/psycho.c @@ -167,7 +167,6 @@ EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, NULL, NULL, static SYSCTL_NODE(_hw, OID_AUTO, psycho, CTLFLAG_RD, 0, "psycho parameters"); static u_int psycho_powerfail = 1; -TUNABLE_INT("hw.psycho.powerfail", &psycho_powerfail); SYSCTL_UINT(_hw_psycho, OID_AUTO, powerfail, CTLFLAG_RDTUN, &psycho_powerfail, 0, "powerfail action (0: none, 1: shutdown (default), 2: debugger)"); diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 8f51606..dcb4290 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -134,7 +134,7 @@ struct malloc_type_header { struct malloc_type type[1] = { \ { NULL, M_MAGIC, shortdesc, NULL } \ }; \ - SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_SECOND, malloc_init, \ + SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_THIRD, malloc_init, \ type); \ SYSUNINIT(type##_uninit, SI_SUB_KMEM, SI_ORDER_ANY, \ malloc_uninit, type) diff --git a/sys/sys/param.h b/sys/sys/param.h index 4b487b3..ccbb70a 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100023 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100024 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 02faa93..0473eb7 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -83,7 +83,7 @@ struct ctlname { #define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */ #define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */ #define CTLMASK_SECURE 0x00F00000 /* Secure level */ -#define CTLFLAG_TUN 0x00080000 /* Tunable variable */ +#define CTLFLAG_TUN 0x00080000 /* Default value is loaded from getenv() */ #define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) #define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN) #define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ @@ -92,6 +92,7 @@ struct ctlname { #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ #define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ +#define CTLFLAG_NOFETCH 0x00001000 /* Don't fetch tunable from getenv() */ #define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) /* @@ -161,6 +162,7 @@ SLIST_HEAD(sysctl_oid_list, sysctl_oid); * be hidden behind it, expanded by the handler. */ struct sysctl_oid { + struct sysctl_oid_list oid_children; struct sysctl_oid_list *oid_parent; SLIST_ENTRY(sysctl_oid) oid_link; int oid_number; @@ -200,14 +202,16 @@ void sysctl_register_oid(struct sysctl_oid *oidp); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ -#define SYSCTL_DECL(name) \ - extern struct sysctl_oid_list sysctl_##name##_children +#define SYSCTL_DECL(name) \ + extern struct sysctl_oid sysctl__##name /* Hide these in macros. */ -#define SYSCTL_CHILDREN(oid_ptr) \ - (struct sysctl_oid_list *)(oid_ptr)->oid_arg1 -#define SYSCTL_CHILDREN_SET(oid_ptr, val) (oid_ptr)->oid_arg1 = (val) -#define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl_##oid_name##_children) +#define SYSCTL_CHILDREN(oid_ptr) (&(oid_ptr)->oid_children) +#define SYSCTL_PARENT(oid_ptr) \ + (((oid_ptr)->oid_parent != &sysctl__children) ? \ + __containerof((oid_ptr)->oid_parent, struct sysctl_oid, \ + oid_children) : (struct sysctl_oid *)NULL) +#define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl__##oid_name.oid_children) /* === Structs and macros related to context handling. === */ @@ -220,7 +224,7 @@ struct sysctl_ctx_entry { TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define SYSCTL_NODE_CHILDREN(parent, name) \ - sysctl_##parent##_##name##_children + sysctl__##parent##_##name.oid_children /* * These macros provide type safety for sysctls. SYSCTL_ALLOWED_TYPES() @@ -275,29 +279,47 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; ); #define __DESCR(d) "" #endif -/* This constructs a "raw" MIB oid. */ -#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\ - static struct sysctl_oid sysctl__##parent##_##name = { \ - .oid_parent = &sysctl_##parent##_children, \ +/* This macro is only for internal use */ +#define SYSCTL_OID_RAW(id, parent_child_head, nbr, name, kind, a1, a2, handler, fmt, descr) \ + struct sysctl_oid id = { \ + .oid_parent = (parent_child_head), \ + .oid_children = SLIST_HEAD_INITIALIZER(&id.oid_children), \ .oid_number = (nbr), \ .oid_kind = (kind), \ .oid_arg1 = (a1), \ .oid_arg2 = (a2), \ - .oid_name = #name, \ + .oid_name = (name), \ .oid_handler = (handler), \ .oid_fmt = (fmt), \ .oid_descr = __DESCR(descr) \ }; \ - DATA_SET(sysctl_set, sysctl__##parent##_##name) + DATA_SET(sysctl_set, id) + +/* This constructs a static "raw" MIB oid. */ +#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ + static SYSCTL_OID_RAW(sysctl__##parent##_##name, \ + SYSCTL_CHILDREN(&sysctl__##parent), \ + nbr, #name, kind, a1, a2, handler, fmt, descr) + +/* This constructs a global "raw" MIB oid. */ +#define SYSCTL_OID_GLOBAL(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ + SYSCTL_OID_RAW(sysctl__##parent##_##name, \ + SYSCTL_CHILDREN(&sysctl__##parent), \ + nbr, #name, kind, a1, a2, handler, fmt, descr) #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr)) +/* This constructs a root node from which other nodes can hang. */ +#define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \ + SYSCTL_OID_RAW(sysctl___##name, &sysctl__children, \ + nbr, #name, CTLTYPE_NODE|(access), NULL, 0, \ + handler, "N", descr) + /* This constructs a node from which other oids can hang. */ #define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \ - struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \ - (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr) + SYSCTL_OID_GLOBAL(parent, nbr, name, CTLTYPE_NODE|(access), \ + NULL, 0, handler, "N", descr) #define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \ diff --git a/sys/vm/memguard.c b/sys/vm/memguard.c index 1d3b412..d502ca5 100644 --- a/sys/vm/memguard.c +++ b/sys/vm/memguard.c @@ -67,7 +67,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, memguard, CTLFLAG_RW, NULL, "MemGuard data"); * reserved for MemGuard. */ static u_int vm_memguard_divisor; -SYSCTL_UINT(_vm_memguard, OID_AUTO, divisor, CTLFLAG_RDTUN, +SYSCTL_UINT(_vm_memguard, OID_AUTO, divisor, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &vm_memguard_divisor, 0, "(kmem_size/memguard_divisor) == memguard submap size"); @@ -132,8 +132,7 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, fail_pgs, CTLFLAG_RD, #define MG_GUARD_ALLLARGE 0x002 #define MG_GUARD_NOFREE 0x004 static int memguard_options = MG_GUARD_AROUND; -TUNABLE_INT("vm.memguard.options", &memguard_options); -SYSCTL_INT(_vm_memguard, OID_AUTO, options, CTLFLAG_RW, +SYSCTL_INT(_vm_memguard, OID_AUTO, options, CTLFLAG_RWTUN, &memguard_options, 0, "MemGuard options:\n" "\t0x001 - add guard pages around each allocation\n" @@ -149,8 +148,7 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, minsize_reject, CTLFLAG_RD, static u_int memguard_frequency; static u_long memguard_frequency_hits; -TUNABLE_INT("vm.memguard.frequency", &memguard_frequency); -SYSCTL_UINT(_vm_memguard, OID_AUTO, frequency, CTLFLAG_RW, +SYSCTL_UINT(_vm_memguard, OID_AUTO, frequency, CTLFLAG_RWTUN, &memguard_frequency, 0, "Times in 100000 that MemGuard will randomly run"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, frequency_hits, CTLFLAG_RD, &memguard_frequency_hits, 0, "# times MemGuard randomly chose"); diff --git a/sys/vm/redzone.c b/sys/vm/redzone.c index e4b5f6c..a66a793 100644 --- a/sys/vm/redzone.c +++ b/sys/vm/redzone.c @@ -41,8 +41,7 @@ static u_long redzone_extra_mem = 0; SYSCTL_ULONG(_vm_redzone, OID_AUTO, extra_mem, CTLFLAG_RD, &redzone_extra_mem, 0, "Extra memory allocated by redzone"); static int redzone_panic = 0; -TUNABLE_INT("vm.redzone.panic", &redzone_panic); -SYSCTL_INT(_vm_redzone, OID_AUTO, panic, CTLFLAG_RW, &redzone_panic, 0, +SYSCTL_INT(_vm_redzone, OID_AUTO, panic, CTLFLAG_RWTUN, &redzone_panic, 0, "Panic when buffer corruption is detected"); #define REDZONE_CHSIZE (16) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 62f4912..81b714a 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -281,8 +281,7 @@ SYSCTL_PROC(_vm, OID_AUTO, zone_stats, CTLFLAG_RD|CTLTYPE_STRUCT, 0, 0, sysctl_vm_zone_stats, "s,struct uma_type_header", "Zone Stats"); static int zone_warnings = 1; -TUNABLE_INT("vm.zone_warnings", &zone_warnings); -SYSCTL_INT(_vm, OID_AUTO, zone_warnings, CTLFLAG_RW, &zone_warnings, 0, +SYSCTL_INT(_vm, OID_AUTO, zone_warnings, CTLFLAG_RWTUN, &zone_warnings, 0, "Warn when UMA zones becomes full"); /* diff --git a/sys/vm/vm_init.c b/sys/vm/vm_init.c index 30faa5a..be10387 100644 --- a/sys/vm/vm_init.c +++ b/sys/vm/vm_init.c @@ -91,8 +91,7 @@ __FBSDID("$FreeBSD$"); long physmem; static int exec_map_entries = 16; -TUNABLE_INT("vm.exec_map_entries", &exec_map_entries); -SYSCTL_INT(_vm, OID_AUTO, exec_map_entries, CTLFLAG_RD, &exec_map_entries, 0, +SYSCTL_INT(_vm, OID_AUTO, exec_map_entries, CTLFLAG_RDTUN, &exec_map_entries, 0, "Maximum number of simultaneous execs"); /* diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 62eb393..b5108e2 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -3471,8 +3471,7 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, } static int stack_guard_page = 0; -TUNABLE_INT("security.bsd.stack_guard_page", &stack_guard_page); -SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RW, +SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RWTUN, &stack_guard_page, 0, "Insert stack guard page ahead of the growable segments."); diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index a524839..e94090c 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -92,9 +92,8 @@ __FBSDID("$FreeBSD$"); #endif int old_mlock = 0; -SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RW | CTLFLAG_TUN, &old_mlock, 0, +SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RWTUN, &old_mlock, 0, "Do not apply RLIMIT_MEMLOCK on mlockall"); -TUNABLE_INT("vm.old_mlock", &old_mlock); #ifdef MAP_32BIT #define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 49c3ede..4e30a3f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -134,8 +134,7 @@ long first_page; int vm_page_zero_count; static int boot_pages = UMA_BOOT_PAGES; -TUNABLE_INT("vm.boot_pages", &boot_pages); -SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, +SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); static int pa_tryrelock_restart; diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c index bb45ba0..4f4b6d2 100644 --- a/sys/vm/vm_radix.c +++ b/sys/vm/vm_radix.c @@ -302,7 +302,7 @@ vm_radix_reserve_kva(void *arg __unused) sizeof(struct vm_radix_node)))) panic("%s: unable to reserve KVA", __func__); } -SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_SECOND, +SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_THIRD, vm_radix_reserve_kva, NULL); #endif diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index 458539e..dac4abe 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -55,10 +55,9 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_phys.h> static int idlezero_enable_default = 0; -TUNABLE_INT("vm.idlezero_enable", &idlezero_enable_default); /* Defer setting the enable flag until the kthread is running. */ static int idlezero_enable = 0; -SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW, &idlezero_enable, 0, +SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RWTUN, &idlezero_enable, 0, "Allow the kernel to use idle cpu cycles to zero-out pages"); /* * Implement the pre-zeroed page mechanism. diff --git a/sys/x86/cpufreq/hwpstate.c b/sys/x86/cpufreq/hwpstate.c index e86e31a..d4c70b7 100644 --- a/sys/x86/cpufreq/hwpstate.c +++ b/sys/x86/cpufreq/hwpstate.c @@ -118,9 +118,8 @@ static int hwpstate_get_info_from_msr(device_t dev); static int hwpstate_goto_pstate(device_t dev, int pstate_id); static int hwpstate_verbose = 0; -SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RWTUN, &hwpstate_verbose, 0, "Debug hwpstate"); -TUNABLE_INT("debug.hwpstate_verbose", &hwpstate_verbose); static device_method_t hwpstate_methods[] = { /* Device interface */ diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index e221a1e..444329c 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -549,17 +549,16 @@ dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id) int dmar_match_verbose; -static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NULL, - ""); -SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD | CTLFLAG_TUN, +static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NULL, ""); +SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &dmar_tbl_pagecnt, 0, "Count of pages used for DMAR pagetables"); -SYSCTL_INT(_hw_dmar, OID_AUTO, match_verbose, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_dmar, OID_AUTO, match_verbose, CTLFLAG_RWTUN, &dmar_match_verbose, 0, "Verbose matching of the PCI devices to DMAR paths"); #ifdef INVARIANTS int dmar_check_free; -SYSCTL_INT(_hw_dmar, OID_AUTO, check_free, CTLFLAG_RW | CTLFLAG_TUN, +SYSCTL_INT(_hw_dmar, OID_AUTO, check_free, CTLFLAG_RWTUN, &dmar_check_free, 0, "Check the GPA RBtree for free_down and free_after validity"); #endif diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index 88cabc7..f64659e 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -575,7 +575,6 @@ legacy_pcib_write_ivar(device_t dev, device_t child, int which, SYSCTL_DECL(_hw_pci); static unsigned long host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, 0, "Limit the host bridge memory to being above this address."); diff --git a/sys/x86/x86/dump_machdep.c b/sys/x86/x86/dump_machdep.c index 5c874f4..30fa719 100644 --- a/sys/x86/x86/dump_machdep.c +++ b/sys/x86/x86/dump_machdep.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; -TUNABLE_INT("debug.minidump", &do_minidump); -SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, "Enable mini crash dumps"); /* diff --git a/sys/x86/x86/io_apic.c b/sys/x86/x86/io_apic.c index ec469ad..5667120 100644 --- a/sys/x86/x86/io_apic.c +++ b/sys/x86/x86/io_apic.c @@ -134,7 +134,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); static int enable_extint; SYSCTL_INT(_hw_apic, OID_AUTO, enable_extint, CTLFLAG_RDTUN, &enable_extint, 0, "Enable the ExtINT pin in the first I/O APIC"); -TUNABLE_INT("hw.apic.enable_extint", &enable_extint); static __inline void _ioapic_eoi_source(struct intsrc *isrc) diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index 8a0d2b1..347d570 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -92,12 +92,10 @@ static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture"); static int mca_enabled = 1; -TUNABLE_INT("hw.mca.enabled", &mca_enabled); SYSCTL_INT(_hw_mca, OID_AUTO, enabled, CTLFLAG_RDTUN, &mca_enabled, 0, "Administrative toggle for machine check support"); static int amd10h_L1TP = 1; -TUNABLE_INT("hw.mca.amd10h_L1TP", &amd10h_L1TP); SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0, "Administrative toggle for logging of level one TLB parity (L1TP) errors"); diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 2a6c81d..54c4d02 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -58,34 +58,28 @@ static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); -TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); #ifdef SMP int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, "Indicates whether the TSC is safe to use in SMP mode"); -TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc); int smp_tsc_adjust = 0; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc_adjust, CTLFLAG_RDTUN, &smp_tsc_adjust, 0, "Try to adjust TSC on APs to match BSP"); -TUNABLE_INT("kern.timecounter.smp_tsc_adjust", &smp_tsc_adjust); #endif static int tsc_shift = 1; SYSCTL_INT(_kern_timecounter, OID_AUTO, tsc_shift, CTLFLAG_RDTUN, &tsc_shift, 0, "Shift to pre-apply for the maximum TSC frequency"); -TUNABLE_INT("kern.timecounter.tsc_shift", &tsc_shift); static int tsc_disabled; SYSCTL_INT(_machdep, OID_AUTO, disable_tsc, CTLFLAG_RDTUN, &tsc_disabled, 0, "Disable x86 Time Stamp Counter"); -TUNABLE_INT("machdep.disable_tsc", &tsc_disabled); static int tsc_skip_calibration; SYSCTL_INT(_machdep, OID_AUTO, disable_tsc_calibration, CTLFLAG_RDTUN, &tsc_skip_calibration, 0, "Disable TSC frequency calibration"); -TUNABLE_INT("machdep.disable_tsc_calibration", &tsc_skip_calibration); static void tsc_freq_changed(void *arg, const struct cf_level *level, int status); |