diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-06-27 16:33:43 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-06-27 16:33:43 +0000 |
commit | bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9 (patch) | |
tree | 522e12e286a7e13608cc5ce25965451047b98773 /sys/dev/bce | |
parent | 465e750b1418c7bcbd18c4e34b36120ff51ae0fc (diff) | |
download | FreeBSD-src-bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9.zip FreeBSD-src-bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9.tar.gz |
Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.
Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.
MFC after: 2 weeks
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev/bce')
-rw-r--r-- | sys/dev/bce/if_bce.c | 15 |
1 files changed, 0 insertions, 15 deletions
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"); |