sysctl

QNX SDP8.0Utilities ReferenceUtilities

Get or set the state of the socket manager

Syntax:

sysctl [-bdehiNnoTtqWx] [-B bufsize] [-f filename] name[=value[,value]] ...

sysctl [-bdehNnoTtqWx] [-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.4-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.4-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, or direct. For more information, go to Changing the network dispatch service (netisr) policies in the Networking stack (io-sock) chapter of the Performance Tuning User's Guide.
qnx.net.inet.tcp.rfc1323_timestamps
Disable (0) or enable (1; the default) TCP timestamps, for both inbound and outbound traffic.
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 Security Policies in the System Security Guide.

For more information about io-sock abilities, see 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. They 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:

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.4-RELEASE.

qnx.ist_prio
Sets the priority of the pulses delivered for interrupts. 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.taskq_prio
Sets the priority of the taskqueue and gtaskqueue thread pulses. Default is 21.
qnx.timer_prio
Sets the priority used by the receive thread to handle timer pulses. Default is 21.
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 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.

qnx.usb_stack_path
Sets the path to the USB stack. Default is set by the USB library.
For more information on setting config, see io-sock.
Page updated: