STAFD.CONF(5)
π NAME π
stafd.conf β the config file for stafd(8). Like, the manual name is stafd.conf(5), and this is where your daemon gets its whole personality. β¨
πΈ SYNOPSIS πΈ
/etc/stas/stafd.conf
That's the path, bestie. No cap. π
π¦ DESCRIPTION π¦
When stafd(8) starts up, it reads its configuration from stafd.conf. Periodt. That's the vibe. π
β¨ CONFIGURATION FILE FORMAT β¨
stafd.conf is a plain text file divided into sections, with configuration entries in the style key=value. Spaces immediately before or after the = are ignored. Empty lines are ignored as well as lines starting with #, which may be used for commenting. So yeah, # is your comment bae. π
π OPTIONS π
π [Global] section π
The following options are available in the [Global] section:
tron=β Trace ON. Takes a boolean argument. Iftrue, enables full code tracing. The trace will be displayed in the system log such as systemd's journal. Defaults tofalse. π₯hdr-digest=β Enable Protocol Data Unit (PDU) Header Digest. Takes a boolean argument. NVMe/TCP facilitates an optional PDU Header digest. Digests are calculated using theCRC32Calgorithm. Iftrue, Header Digests are inserted in PDUs and checked for errors. Defaults tofalse. β¨data-digest=β Enable Protocol Data Unit (PDU) Data Digest. Takes a boolean argument. NVMe/TCP facilitates an optional PDU Data digest. Digests are calculated using theCRC32Calgorithm. Iftrue, Data Digests are inserted in PDUs and checked for errors. Defaults tofalse. πkato=β Keep Alive Timeout (KATO) in seconds. Takes an unsigned integer. This field specifies the timeout value for the Keep Alive feature in seconds. Defaults to30seconds for Discovery Controller connections and120seconds for I/O Controller connections. πip-family=β Takes a string argument. With this you can specify whether IPv4, IPv6, or both are supported when connecting to a Controller. Connections will not be attempted to IP addresses (whether discovered or manually configured withcontroller=) disabled by this option. If an invalid value is entered, then the default (see below) will apply. Choices areipv4,ipv6, oripv4+ipv6. Defaults toipv4+ipv6. πqueue-size=β Takes a value in the range16...1024. Overrides the default number of elements in the I/O queues created by the driver. This option will be ignored for discovery, but will be passed on to the subsequent connect call. Note: This parameter is identical to that provided bynvme-cli. Defaults to128. π¦reconnect-delay=β Takes a value in the range1toNseconds. Overrides the default delay before reconnect is attempted after a connect loss. Note: This parameter is identical to that provided bynvme-cli. Defaults to10. Retry to connect every10seconds. β°ctrl-loss-tmo=β Takes a value in the range-1,0, ...,Nseconds.-1means retry forever.0means do not retry. Overrides the default controller loss timeout period (in seconds). Note: This parameter is identical to that provided bynvme-cli. Defaults to600seconds (10 minutes). πdisable-sqflow=β Takes a boolean argument. Disables SQ flow control to omit head doorbell update for submission queues when sending nvme completions. Note: This parameter is identical to that provided bynvme-cli. Defaults tofalse. π«ignore-iface=β Takes a boolean argument. This option controls how connections with Discovery Controllers (DC) are made. DCs are automatically discovered using DNS-SD/mDNS. mDNS provides the DC's IP address and the interface on which the DC was discovered. There is no guarantee that there will be a route to reach that DC. However, we can use the socket optionSO_BINDTODEVICEto force the connection to be made on a specific interface instead of letting the routing tables decide where to make the connection. This option determines whetherstafdwill useSO_BINDTODEVICEto force connections on an interface or just rely on the routing tables. The default is to useSO_BINDTODEVICE, in other words,stafddoes not ignore the interface by default. Defaults tofalse. π«Άpleo=β Port Local Entries Only. Takes a string argumentenabledordisabled. This option is sent in the LSP field (Log SPecific) of the Get Discovery Log Page (DLP) command. It is used bystafdto tell Discovery Controllers (DC) whether the response to a Get DLP command should contain all the NVM subsystems or only those reachable by the host on the interface where the Get DLP command was issued by the host. This parameter was introduced in TP8010. Whenpleo=enabled, then the DC shall return records for only NVM subsystem ports that are presented through the same NVM subsystem port that received the Get Log Page command. Whenpleo=disabled, then the DC may return all the NVM subsystem ports that it holds, even those that can only be reached on NVM subsystem ports that did not receive the Get Log Page command. In other words, the host may not even be able to reach those subsystems. Defaults toenabled. π
πΈ [Service Discovery] section πΈ
The following options are available in the [Service Discovery] section:
zeroconf=β Enable zeroconf provisioning using DNS-SD/mDNS. Takes a string argumentenabledordisabled. Whenenabled, the default,stafdmakes a request with the Avahi daemon to locate Discovery Controllers using DNS-SD/mDNS. Discovery Controllers that support zeroconf advertise themselves over mDNS with the service type_nvme-disc._tcp. Defaults totrue. π
π [Discovery controller connection management] section π
The following options are available in the [Discovery controller connection management] section:
persistent-connections=β Takes a boolean argument. Whether connections to Discovery Controllers (DC) are persistent. Whentrue, connections initiated bystafdwill persists even whenstafdis stopped. Whenfalse,stafdwill disconnect from all DCs it is connected to on exit. Defaults tofalse. πzeroconf-connections-persistence=β Takes a unit-less value in seconds, or a time span value such as"72hours"or"5days". A value of0means no persistence. In other words, configuration acquired through zeroconf (mDNS service discovery) will be removed immediately when mDNS no longer reports the presence of a Discovery Controller (DC) and connectivity to that DC is lost. A value of-1means that configuration acquired through zeroconf will persist forever. This is used for the case where a DC that was discovered through mDNS service discovery no longer advertises itself through mDNS and can no longer be connected to. For example, the DC had some catastrophic failure (e.g. power surge) and needs to be replaced. In that case, the connection to that DC can never be restored and a replacement DC will be needed. The replacement DC will likely have a different NQN (or IP address). In that scenario, the host won't be able to determine that the old DC is not coming back. It won't know either that a newly discovered DC is really the replacement for the old one. For that reason, the host needs a way to "age" zeroconf-acquired configuration and remove it automatically after a certain amount of time. This is what this parameter is for. Defaults to72hours. β³
π [Controllers] section π
The following options are available in the [Controllers] section:
controller=β Controllers are specified with thecontrolleroption. This option may be specified more than once to specify more than one controller. The format is one line per Controller composed of a series of fields separated by semi-colons as follows:
controller=transport=[trtype];traddr=[traddr];trsvcid=[trsvcid];host-traddr=[traddr],host-iface=[iface];nqn=[nqn]
Fields
transport=β This is a mandatory field that specifies the network fabric being used for a NVMe-over-Fabrics network. Current trtype values understood are:
Table 1. Transport type
rdmaβ The network fabric is an rdma network (RoCE, iWARP, Infiniband, basic rdma, etc)fcβ The network fabric is a Fibre Channel network.tcpβ The network fabric is a TCP/IP network.loopβ Connect to a NVMe over Fabrics target on the local host
traddr=β This is a mandatory field that specifies the network address of the Controller. For transports using IP addressing (e.g. rdma) this should be an IP-based address (ex. IPv4, IPv6). It could also be a resolvable host name (e.g. localhost).trsvcid=β This is an optional field that specifies the transport service id. For transports using IP addressing (e.g. rdma, tcp) this field is the port number. Depending on the transport type, this field will default to either8009or4420as follows. UDP port4420and TCP port4420have been assigned by IANA for use by NVMe over Fabrics. NVMe/RoCEv2 controllers use UDP port4420by default. NVMe/iWARP controllers use TCP port4420by default.
kay so ports, bestie, we gotta talk about ports. π§
TCP port 4420 has been assigned for use by NVMe over Fabrics, and TCP port 8009 has been assigned by IANA for use by NVMe over Fabrics discovery. And like, 8009 is the default TCP port for NVMe/TCP discovery controllers. But for NVMe/TCP I/O controllers? There's literally no default TCP port β nope, none β the Transport Service Identifier (TRSVCID) field in the Discovery Log Entry is the one telling you which TCP port to use. The TRSVCID is the main character here, fr fr. π
So which TCP ports can NVMe/TCP I/O controllers use? You're looking at:
- TCP port
4420 - the Dynamic and/or Private TCP ports (i.e., ports in the TCP port number range from
49152to65535)
And two big no-nos:
NVMe/TCP I/O controllers should not use TCP port 8009.
TCP port 4420 shall not be used for both NVMe/iWARP and NVMe/TCP at the same IP address on the same network.
Ref: IANA Service names port numbers[1] β that's over in the notes, iykyk. π
nqn=β bestie this is the Controller's NVMe Qualified Name. It is mandatory for I/O Controllers, but it's optional for Discovery Controllers (DC). And for those DCs? If you leave it undefined, the NQN just defaults to the well-known DC NQN:nqn.2014-08.org.nvmexpress.discoveryβ¨host-traddr=β optional field, and it specifies the network address used on the host to connect to the Controller. For TCP, this sets the source address on the socket. πhost-iface=β also optional! It's the network interface used on the host to connect to the Controller (e.g.IPeth1,enp2s0,enx78e7d1ea46da). This forces the connection to be made on a specific interface instead of letting the system decide. no cap, sometimes you just gotta pick for it. π¦dhchap-secret=β NVMe In-band authentication host secret (i.e. key). It needs to be in ASCII format as specified inNVMe 2.0section8.13.5.8Secret representation. If you don't specify this option, the default is read from/etc/stas/sys.conf(see the'key'parameter under the[Host]section). In-band authentication is attempted when this is present. πdhchap-ctrl-secret=β optional field, and it specifies the NVMe In-band authentication controller secret (i.e. key) for bi-directional authentication. Needs to be in ASCII format as specified inNVMe 2.0section8.13.5.8'Secret representation'. Bi-directional authentication will be attempted when it's present. πhdr-digest=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.data-digest=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.nr-io-queues=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.nr-write-queues=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.nr-poll-queues=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.queue-size=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.kato=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.reconnect-delay=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.ctrl-loss-tmo=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.disable-sqflow=β See definition in[Global]section. This is an optional field used to override the value specified in the[Global]section.
Examples:
controller = transport=tcp;traddr=localhost;trsvcid=8009
controller = transport=tcp;traddr=2001:db8::370:7334;host-iface=enp0s8
controller = transport=fc;traddr=nn-0x204600a098cbcac6:pn-0x204700a098cbcac6
periodt. look at those. so clean. πΈ
exclude=β the ghosting list π. Controllers that should be excluded can be specified with theexclude=option. Here's the tea: using mDNS to automatically discover and connect to controllers can result in unintentional connections being made, and this keyword is what lets you configure the controllers that should not be connected to.
The syntax is the same as for "controller", except that only transport, traddr, trsvcid, nqn, and host-iface apply. Multiple exclude= keywords may appear in the config file to specify more than 1 excluded controller. π
- Note 1: A minimal match approach is used to eliminate unwanted controllers. That is, you do not need to specify all the parameters to identify a controller. Just specifying the
host-iface, for example, can be used to exclude all controllers on an interface. - Note 2:
exclude=takes precedence overcontroller. A controller specified by thecontrollerkeyword, can be eliminated by theexclude=keyword. (yes bestie, exclude= is the bigger icon here π)
Examples:
exclude = transport=tcp;traddr=fe80::2c6e:dee7:857:26bb # Eliminate a specific address
exclude = host-iface=enp0s8 # Eliminate everything on this interface
π SEE ALSO π
stafd(8)β go read it, bestie π«Ά
π NOTES π
- IANA Service names port numbers
https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=nvmeπ
that's the whole vibe check done β¨ this was nvme-stas version 2.4.1, living in the STAFD.CONF(5) page, and honestly? iconic. slay. ππ
π¦ where this page comes from
- ubuntu resolute: nvme-stas 2.4.1-3build1 Β· Apache-2.0
- ubuntu stonking: nvme-stas 2.4.1-3build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms