sysctl (io-sock)

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 Neutrino

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 Neutrino 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 Tuning the io-sock networking stack chapter.

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 Neutrino kernel.

net.isr.dispatch
Set the netisr (kernel network dispatch service) dispatch policy. Valid values are deferred, hybrid, or direct. For more information, go to Changing the network dispatch service (netisr) policies.
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).
You can also set qnx.pool.max, qnx.pool.start, and qnx.pool.min. For more information, go to Tunables.
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.

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 Security Policies in the System Security Guide.

For more information about io-sock abilities, see Privilege control.

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
A version information variable is available for each networking driver, using the format qnx.driver.driver_name. Examples: for devs-axe.so, qnx.driver.axe; for devs-cdce.so, qnx.driver.cdce.

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 initalize 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".

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).
For example, for the ix0 interface, to turn off IST processing:
dev.ix.0.iflib.rxtx_in_ist="0"
This setting can be part of a performance tuning strategy when your environment is using routing or bridging. For more information, go to Adjusting packet processing for routing and bridging.
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.

To read the current values and worker thread information, use the qnx.pool variable. For more information, go to Variables.

For a discussion of using these values to improve performance, go to Configuring resource manager thread pools.

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:

 qnx.typed_mem="/memory/below4G/ram/iosock" 

For AArch64 targets, there is both "Normal" memory and "Device" memory. The typed memory region that you specify must be Normal memory. Using Device memory is not supported.

"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.

For more information on setting config, see io-sock.
Page updated: