sysctl
Get or set the state of the socket manager
Syntax:
sysctl [-bdehiNnoqTtVWx] [-B bufsize] [-f filename] name[=value[,value]] ...
sysctl [-bdehNnoqTtVWx] [-B bufsize] -a
Runs on:
QNX OS
Description:
The sysctl utility retrieves the state of the socket manager and allows processes with appropriate privilege to set the state. The variable to retrieve or set is described using a Management Information Base (MIB) style name, described as a dotted set of components.
The sysctl utility that QNX OS provides for use with io-sock is ported from FreeBSD. It supports additional MIB-style names that are specific to io-sock and removes support for any standard variables that io-sock doesn't require.
Otherwise, sysctl for io-sock supports the same options and features as the standard FreeBSD sysctl. (An exception is the -h option, which you can specify, but io-sock ignores it.)
For a description of the standard version of sysctl, including option descriptions, see the FreeBSD documentation (https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=8&manpath=FreeBSD+13.5-RELEASE+and+Ports).
Variables
The
variables that are available to you depend on what you're running on your machine; the
io-sock-specific variables that are likely of most interest are listed
below. For information about determining the meaning of other variables, see the FreeBSD
docs for sysctl() and sysctlbyname() (https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&manpath=FreeBSD+13.5-RELEASE+and+Ports).
Some FreeBSD variables that can affect performance are discussed in the
Networking stack (io-sock)
chapter of the
Performance Tuning User's Guide.
A process with appropriate privilege can change the value of any variables that are not read-only. All values are integers unless otherwise indicated.
These variables are for use with the io-sock context and process. They do not apply to the filesystem, environment, or the QNX OS kernel.
net.isr.dispatch
- Set the netisr (kernel network dispatch service) dispatch policy. Valid values are
deferred
,hybrid
, ordirect
. For more information, go toChanging the network dispatch service (netisr) policies
in theNetworking stack (io-sock)
chapter of the Performance Tuning User's Guide. qnx.dtb_path
-
Read the DTB (device tree blob) from the specified path instead of the asinfo (Address Space Information) section of the system page. This setting is designed for driver development—don't use it in production systems. For more information, go to
Writing Network Drivers for io-sock
in the High Performance Networking Stack User's Guide. qnx.max_stack_size
-
Set the stack size of the threads that io-sock creates. Default is 32 KB. The value is passed to pthread_attr_setstacksize() without verification.
qnx.net.inet.tcp.rfc1323_timestamps
- Disable (
0
) or enable (1
; the default) TCP timestamps, for both inbound and outbound traffic. qnx.pool
- Read io-sock resource manager thread pool information:
-
qnx.pool.max
— maximum number of threads. -
qnx.pool.start
— initial number of threads. qnx.pool.min
— minimum number of threads.qnx.pool.total
— total number of resource manager worker threads.qnx.pool.worker
— number of worker threads that are actively doing work or are ready to receive work (i.e., they are not blocked in a sleeping state or waiting for, for example, a network packet).
qnx.pool.max
,qnx.pool.start
, andqnx.pool.min
. For more information, go toTunables.
-
qnx.sec.droproot
- When you set this variable, io-sock stops running as
root and switches to the specified user. For example:
sysctl qnx.sec.droproot=value
where value specifies a user, one or more groups, or both, using one of the following formats:
- uid[:gid[,sup_gid]*]
- user_name[,sup_gid]*
The default is 99:99,120. In the second format, the primary group is the one specified for user_name in /etc/passwd.
For more information about io-sock abilities, see
Privilege control
in the High Performance Networking Stack User's Guide. qnx.sec.transition
- When you set this variable, io-sock continues running with the same
uid it was started with, but switches to a different security type, most
likely with fewer abilities:
sysctl qnx.sec.transition=1
The sysctl design means it's necessary to pass in some non-zero value; passing in 1 is recommended because future releases could assign specific meanings to other parameter values.
Because the new security type depends on the security policies you've defined for the system, this variable is useful only if the system uses security policies. For more information, see
For more information about io-sock abilities, seeSecurity Policies
in the System Security Guide.Privilege control
in the High Performance Networking Stack User's Guide. - Variables that drop specific abilities
- You can use the following variables to selectively drop the abilities that
io-sock retains after setting
qnx.sec.droproot
:qnx.sec.drop.iofunc_read
- Drop IOFUNC_ABILITY_READ (needed for Unix Domain Sockets).
qnx.sec.drop.priority
- Drop PROCMGR_AID_PRIORITY (set priority for driver threads).
qnx.sec.drop.pathspace
- Drop PROCMGR_AID_PATHSPACE (needed for Unix Domain Sockets).
qnx.sec.drop.iofunc_read
- Drop PROCMGR_AID_MEM_PHYS (io-sock needs it to increase the size of the mbuf pool with physical memory).
- Plug and Play variables
- All have a default value of 1.
qnx.pnp.pci
qnx.pnp.ofwbus
qnx.pnp.usb
- Version information variables
- Currently, all have a value of 65536 (0x10000).
qnx.driver.smsc
qnx.driver.cdce
qnx.driver.axge
qnx.driver.axe
qnx.driver.vtnet_pci
qnx.driver.re
qnx.driver.ix
qnx.driver.em
qnx.driver.dwc
qnx.driver.vtnet_mmio
qnx.module.usb
qnx.module.pci
qnx.module.phy
qnx.module.fdt
Tunables
The sysctl utility provided for use with io-sock does not support the FreeBSD loader program or loader.config, which can be used to initialize some of the variables that cannot be modified during normal system operation. However, some of the variables set via loader.conf (tunables) can instead be initialized via the file specified by the config option that io-sock provides.
Specify values in the file using the format value_name="value". (For an example configuration file, go to the io-sock entry in this reference.)
The available tunables include:
net.isr.maxthreads
- The number of netisr threads to run. Default is 1. -1 specifies the maximum, which is the number of CPUs.
In addition, the following io-sock-specific tunables are available:
dev.iface_name.iface_no.iflib.rxtx_in_ist
- Specify where packet processing for the specified interface is done.
- 0 — Process in the taskqueue group thread.
- 1 — Process in the Interrupt Service Thread (IST; the default).
qnx.iolevel
- Specify the level of I/O privilege.
- 0 (_NTO_IO_LEVEL_NONE) — Default on AArch64.
- 1 (_NTO_IO_LEVEL_1) — Default on x86_64.
- 2 (_NTO_IO_LEVEL_2)
qnx.ipv4idrsvd
- Specify identifiers that are reserved (i.e., that io-sock does not
use) by providing the minimum identifier value for io-sock. Must be a
value between 2 and 32768 and a power of 2. (For no reserved identifiers, specify no
value or 0.)
Any identifiers lower than the specified value can instead be used by any application by setting the IP_HDRINCL socket option and providing the complete IPv4 header. For information about socket options, see https://www.freebsd.org/cgi/man.cgi?query=getsockopt&sektion=2&manpath=FreeBSD+13.5-RELEASE.
qnx.pool.*
-
Set io-sock resource manager thread pool parameters.
qnx.pool.max
-
Set the maximum number of threads in the io-sock thread pool. Default is 700.
qnx.pool.min
-
Set the minimum number of threads in the pool. If there are fewer than this number when a resource manager thread goes to sleep on the io-sock sleep queue, io-sock starts a new thread. Default is 1.
qnx.pool.start
-
Set the initial number of threads in the pool. Default is the number of CPUs.
qnx.priority
- Sets the priority of io-sock threads. Default is 21.
qnx.smmu
- Specify whether or not support for the system memory management unit (IOMMU/SMMU) manager is required. If you specify 1, SMMU support is required and io-sock exits if it isn't available. Default is 0 (off).
qnx.typed_mem
- Specify a typed memory region for mbuf allocation. When using
mbuf zones or the DMA mapping interface (bus_dma),
memory is allocated from the specified typed memory region.
For example, to specify the region /memory/below4G/ram/iosock, include the following line in the configuration file:
For AArch64 targets, there is both "Normal" memory and "Device" memory. The typed memory region you specify must be Normal memory. Using Device memory is not supported.qnx.typed_mem="/memory/below4G/ram/iosock"
Device memory has some restrictions, including that all memory accesses must be aligned. The io-sock networking manager may make unaligned accesses to memory, so any POSIX Typed Memory region specified in the io-sock configuration file with
qnx.typed_mem
must be Normal memory. qnx.usb_stack_path
- Sets the path to the USB stack. Default is set by the USB library.