lnetctl(8) configuration utilities lnetctl(8)

# [SYNOPSIS](#SYNOPSIS)

**lnetctl**  
**lnetctl --list-commands**  
**lnetctl** **&lt;cmd&gt; &lt;subcmd&gt; \[optional parameters]**

# [DESCRIPTION](#DESCRIPTION)

**lnetctl** is used to configure LNet parameters allowing various configuration and debugging features to be accessed.

**lnetctl** can be invoked in interactive mode by issuing lnetctl command. After that, commands are issued as below.

To get a complete listing of available commands, type **--list-commands** at the lnetctl prompt. To get basic help on the meaning and syntax of a command type **&lt;command&gt;** --help.

For non-interactive use the **lnetctl** utility can be invoked from the command line as follows:

lnetctl *command* *subcommand* \[optional parameters]

## [LNet Initialization:](#LNet_Initialization:)

[**lnetctl lnet** configure \[--all\]](#lnetctl)

Brings up the LNet Network [Interface (NI)](/man/enterprise-packages/lustre/Interface.NI) system. If the --all option is provided it will load network interfaces defined in the modprobe files. Otherwise, it doesn´t initialize any networks by default.

[**lnetctl lnet** unconfigure](#lnetctl~2)

Brings down the LNet Network [Interface (NI)](/man/enterprise-packages/lustre/Interface.NI) system including any configured networks.

## [Network Configuration](#Network_Configuration)

[**lnetctl net** add](#lnetctl~3)

Configures a network interface either given the network name and physical interface device name, or given the ip2net parameter. Other parameters are optional.  
\--net: net name (e.g. tcp0)  
\--if: physical interface (e.g. eth0)  
\--nid: LNet network address to bring up. Cannot be combined with --net.  
\--ip2net: specify networks based on IP address patterns  
\--peer-timeout: time to wait before declaring a peer dead (in seconds). Default value for o2iblnd and socklnd is 180 seconds.  
\--peer-credits: define the max number of in-flight messages per peer.  
\--peer-buffer-credits: the max number of routed in-flight messages per peer.  
\--credits: The total number of in-flight messages over a network interface.  
\--cpt: The CPU partitions on which the created network interface is bound to. Refer to the Lustre Manual Section "Binding Network Interface Against CPU Partitions" for more details. For example to bind a Network Interface to CPU partitions 0 and 1, you would specify this parameter as --cpt \[0, 1]

[**lnetctl net** del](#lnetctl~4)

Delete a network interface given the network name.  
\--net: net name (e.g. tcp0)  
\--nid: lnet network address to bring up. Cannot be combined with --net.

[**lnetctl net** show](#lnetctl~5)

Show all currently configured network interfaces if no parameters given or filter on the network name. More details can be shown by specifying the --verbose parameter.  
\--net: net name (e.g. tcp0) to filter on  
\--verbose: display detailed output per network

## [Peer Configuration](#Peer_Configuration)

[**lnetctl peer** add](#lnetctl~6)

Configure an LNET peer with at least one supplied NID. The primary NID must be specified. By default, peers are marked as multi-rail capable.  
\--nid: one or more peer NIDs to add to the peer.  
\--prim\_nid: Primary NID of the peer.  
\--non\_mr: create this peer as not Multi-Rail capable.  
\--lock\_prim: lock primary NID of the peer for the purpose of identification with Lustre.

[**lnetctl peer** del](#lnetctl~7)

Delete a peer NID. The primary NID must be specified. If the removed NID is the primary NID, the peer entry will be deleted.  
\--nid: one or more peer NIDs to remove from the peer.  
\--prim\_nid: Primary NID of the peer.  
\--force: optional, use to delete a peer with primary NID locked.

[**lnetctl peer** show](#lnetctl~8)

Show configured peers. By default, lists all peers and associated NIDs.  
\--nid: list of primary nids to filter on  
\--verbose: Include extended statistics, including credits and counters.

## [Route Configuration](#Route_Configuration)

[**lnetctl route** add](#lnetctl~9)

Add a route.  
\--net: net name (e.g. tcp0)  
\--gateway: gateway nid (e.g. 10.1.1.2@tcp)  
\--hop: number to final destination (1 &lt; hops &lt; 255)  
\--priority: priority of route (0 - highest prio)

[**lnetctl route** del](#lnetctl~10)

Delete a route specified via the network and gateway.  
\--net: net name (e.g. tcp0)  
\--gateway: gateway nid (e.g. 10.1.1.2@tcp)

[**lnetctl route** show](#lnetctl~11)

Show all currently configured routes if no parameters given, or filter on given parameters. More details can be shown by specifying the --verbose parameter.  
\--net: net name (e.g. tcp0) to filter on  
\--gateway: gateway nid (e.g. 10.1.1.2@tcp) to filter on  
\--hop: number to final destination (1 &lt; hops &lt; 255) to filter on  
\--priority: priority of route (0 - highest prio to filter on)  
\--verbose: display detailed output per route

## [Routing Information](#Routing_Information)

[**lnetctl routing** show](#lnetctl~12)

Show router buffers values as well as show the status of routing (IE: whether the node is set to be a router)

## [Value Setting](#Value_Setting)

Individual values can be set using the **lnetctl set** command.

[**lnetctl set** tiny\_buffers *value*](#lnetctl~13)

Set the number of tiny buffers in the system. This is the total number of tiny buffers for all CPU partitions.

[**lnetctl set** small\_buffers *value*](#lnetctl~14)

Set the number of small buffers in the system. This is the total number of small buffers for all CPU partitions.

[**lnetctl set** large\_buffers *value*](#lnetctl~15)

Set the number of large buffers in the system. This is the total number of large buffers for all CPU partitions.

[**lnetctl set** routing *\[0, 1\]*](#lnetctl~16)

0 value indicates to disable routing. 1 value indicates to enable routing. When routing is disabled the values of the buffers that might have been changed are not remembered, and the next time routing is enabled the default buffer count will be used.

[**lnetctl set** drop\_asym\_route *\[0, 1\]*](#lnetctl~17)

0 value indicates to accept asymmetrical route messages. 1 value indicates to drop them. Asymmetrical route is when a message from a remote peer is coming through a router that would not be used by this node to reach the remote peer.

[**lnetctl set** latency\_stats *\[0, 1\]*](#lnetctl~18)

0 value indicates to stop accumulating per-operation latency statistics. 1 value indicates to accumulate them (default). The latency statistics are reported by **lnetctl net show -v** and **lnetctl peer show -v**. The global counters and the per-interface element statistics are not affected by this setting.

[**lnetctl set** response\_tracking *\[0, 1, 2, 3\]*](#lnetctl~19)

Set the behavior of response tracking.  
0 - Only LNet pings and discovery pushes utilize response tracking.  
1 - GETs are eligible for response tracking.  
2 - PUTs are eligible for response tracking.  
3 - Both PUTs and GETs are eligible for response tracking (default).  
Note: Regardless of the value of the response\_tracking parameter LNet  
pings and discovery pushes always utilize response tracking.

[**lnetctl set** recovery\_limit *value*](#lnetctl~20)

Set how long LNet will attempt to recover unhealthy peer interfaces.  
0 - Recover indefinitely (default).  
&gt;0 - Recover for the specified number of seconds.

[**lnetctl set** max\_recovery\_ping\_interval *value*](#lnetctl~21)

Set the maximum recovery ping interval. The recovery ping mechanism increases the next scheduled recovery ping attempt timeout exponentially (base 2) until it is equal to the value set. The default value is 900.

## [Import and Export YAML Configuration Files](#Import_and_Export_YAML_Configuration_Files)

LNet configuration can be represented in YAML format. A YAML configuration file can be passed to the lnetctl utility via the **import** command. The lnetctl utility will attempt to configure all elements defined in the YAML file.

Similarly the **export** command can be used to dump all supported LNet configuration to stdout. The output can be redirected to a file.

[**lnetctl import** *FILE*:](#lnetctl~22)

[**lnetctl import** &lt; *FILE*](#lnetctl~23)

**import** command uses the specified YAML configuration file to configure LNet parameters defined within. The import command by default adds the LNet parameters defined in the YAML file, but this default behavior can be overwritten by specifying the desired behavior.  
\--add: add configuration  
\--del: delete configuration  
\--show: show configuration  
\--exec: execute command  
\--help: display this help

[**lnetctl export** *FILE*:](#lnetctl~24)

[**lnetctl export** &gt; *FILE*](#lnetctl~25)

**export** command dumps the LNet configuration, state information, and stats in YAML format to stdout, which can be redirected to a normal file. The output of the **export** command can be used as input to the **import** command.  
\--backup: dump only elements necessary to recreate the current configuration.  
\--help: display this help

## [LNet Statistics](#LNet_Statistics)

[**lnetctl stats** show](#lnetctl~26)

Show LNET statistics  
\-&gt; Number of messages allocated  
\-&gt; Maximum number of messages allocated  
\-&gt; Number of errors encountered  
\-&gt; Number of messages sent  
\-&gt; Number of messages received  
\-&gt; Number of messages routed  
\-&gt; Total size in bytes of messages sent  
\-&gt; Total size in bytes of messages received  
\-&gt; Total size in bytes of messages routed  
\-&gt; Total size in bytes of messages dropped

## [Showing Peer Credits](#Showing_Peer_Credits)

[**lnetctl peer\_credits**](#lnetctl~27)

Show details on configured peer credits  
\-&gt; Peer nid  
\-&gt; State  
\-&gt; Reference count on the peer  
\-&gt; Maximum transmit credits  
\-&gt; Available transmit credits  
\-&gt; Available router credits  
\-&gt; Minimum router credits.

## [UDSP Configuration](#UDSP_Configuration)

[**lnetctl udsp** add](#lnetctl~28)

Add user-defined selection policy.

[Adding a local network udsp.](#Adding)

If multiple local networks are available, each one can be assigned a priority. The one with the highest priority is selected to send on. NID and network matching is using NID-range syntax, please see the manual for more detail.  
\--src : network in NID-range syntax (e.g. tcp0 or tcp\[1-3])  
\--&lt;priority&gt; &lt;priority value&gt;: optional priority value in \[0-255], 0 as the highest  
\--&lt;idx&gt;: The index of where to insert the rule. By default append to the end of the list

[Adding a local NID udsp.](#Adding~2)

Assign priority to local NIDs. After a local network is chosen, the NI with highest priority is selected.  
\--src: NID in NID-range syntax (e.g. 10.1.1.2@tcp or 10.1.1.\*@tcp)  
\--&lt;priority&gt; &lt;priority value&gt;: optional priority value in \[0-255], 0 as the highest  
\--&lt;idx&gt;: The index of where to insert the rule. By default append to the end of the list

[Adding a peer NID udsp.](#Adding~3)

Assign priority to peer NIDs. Peer NID with highest priority is selected to send to.  
\--dst: NID in NID-range syntax (e.g. 10.1.1.2@tcp)  
\--&lt;priority&gt; &lt;priority value&gt;: optional priority value in \[0-255], 0 as the highest  
\--&lt;idx&gt;: The index of where to insert the rule. By default append to the end of the list

[Adding a NID pair udsp.](#Adding~4)

The local NIDs which match the rule are added on a list on the peer NIs matching the rule. When selecting the peer NI, the one with the local NID being used on its list is preferred.  
\--dst: NID in NID-range syntax (e.g. 10.1.1.1@tcp)  
\--src: NID in NID-range syntax (e.g. 10.1.1.2@tcp)  
\--&lt;idx&gt;: The index of where to insert the rule. By default append to the end of the list

[Adding a Peer Router udsp.](#Adding~5)

The router NIDs matching the rule are added on a list on the peer NIs matching the rule. When sending to a remote peer, the router which has its nid on the peer NI list is preferred.  
\--dst: peer NID in NID-range syntax (e.g. 10.1.1.1@tcp)  
\--rte: router NID in NID-range syntax (e.g. 10.1.2.1@tcp)  
\--&lt;idx&gt;: The index of where to insert the rule. By default append to the end of the list

[**lnetctl udsp** del](#lnetctl~29)

Delete user-defined selection policy.  
\--idx: The index of the rule to delete.

[**lnetctl udsp** show](#lnetctl~30)

Show all user-defined selection policies in the system. The policies are dumped in YAML form.

## [Debugging](#Debugging)

[**lnetctl debug** recovery](#lnetctl~31)

List NIDs on recovery queue  
\--local : list NIDs on local recovery queue  
\--peer : list NIDs on peer recovery queue

[**lnetctl debug** peer](#lnetctl~32)

Dump peer debug info to debug log and console  
\--nid : peer's NID

# [OPTIONS](#OPTIONS)

[**--list-commands**](#list-commands)

Output a list of the commands supported by the lnetctl utility

# [EXAMPLES](#EXAMPLES)

## [Initializing LNet after load](#Initializing_LNet_after_load)

- lnetctl lnet configure
- lnetctl lnet configure --all

## [Shutting down LNet](#Shutting_down_LNet)

•

lnetctl lnet unconfigure

## [Add network](#Add_network)

- lnetctl net add --net tcp0 --if eth0
- lnetctl net add --ip2net "tcp0(eth0) 192.168.0.\[2,4]; tcp0 192.168.0.\*; o2ib0 132.6.\[1-3].\[2-8/2]"

## [Delete network](#Delete_network)

•

lnetctl net del --net tcp0

## [Show network](#Show_network)

[lnetctl net show --verbose:](#lnetctl~33)

net:  
\- nid: 0@lo  
status: up  
tunables:  
peer\_timeout: 0  
peer\_credits: 0  
peer\_buffer\_credits: 0  
credits: 0  
\- nid: 192.168.205.130@tcp1  
status: up  
interfaces:  
0: eth3  
1: eth4  
tunables:  
peer\_timeout: 180  
peer\_credits: 8  
peer\_buffer\_credits: 0  
credits: 256

## [Add route](#Add_route)

•

lnetctl route add --net tcp0 --gateway 10.10.10.1@tcp1 --hop 1 --priority 1

## [Delete route](#Delete_route)

•

lnetctl route del --net tcp0 --gateway 10.10.10.1@tcp1

## [Show route](#Show_route)

•

lnetctl route show --verbose

route:  
\- net: tcp  
gateway: 192.168.205.131@tcp1  
hop: 1  
priority: 0 state: down

## [Show routing](#Show_routing)

•

lnetctl routing show

routing:  
\- cpt\[0]:  
tiny:  
npages: 0  
nbuffers: 2048  
credits: 2048  
mincredits: 2048  
small:  
npages: 1  
nbuffers: 16384  
credits: 16384  
mincredits: 16384  
large:  
npages: 256  
nbuffers: 1024  
credits: 1024  
mincredits: 1024  
\- enable: 1

## [Setting variables](#Setting_variables)

- lnetctl set tiny\_buffers 2048
- lnetctl set small\_buffers 16384
- lnetctl set large\_buffers 256
- lnetctl set routing 1

## [Importing YAML files for configuring](#Importing_YAML_files_for_configuring)

- lnetctl import lnet.conf
- lnetctl import &lt; lnet.conf

## [Exporting LNet Configuration](#Exporting_LNet_Configuration)

- lnetctl export lnet.conf
- lnetctl export &gt; lnet.conf

## [Showing LNet Stats](#Showing_LNet_Stats)

•

lnetctl stats show

statistics:  
msgs\_alloc: 0  
msgs\_max: 1  
errors: 0  
send\_count: 89  
recv\_count: 0  
route\_count: 0  
drop\_count: 19  
send\_length: 0  
recv\_length: 0  
route\_length: 0  
drop\_length: 0

## [Showing peer information](#Showing_peer_information)

•

lnetctl peer show

peer:  
\- primary nid: 10.148.0.8@o2ib  
Multi-Rail: True  
peer ni:  
\- nid: 10.148.0.8@o2ib  
state: NA  
\- primary nid: 10.148.0.20@o2ib  
Multi-Rail: True  
peer ni:  
\- nid: 10.148.0.20@o2ib  
state: NA  
\- nid: 10.148.0.25@o2ib  
state: NA

## [Adding a UDSP](#Adding_a_UDSP)

•

lnetctl udsp add --src tcp --priority 1

## [Deleting a UDSP](#Deleting_a_UDSP)

•

lnetctl udsp del --idx 0

## [Show UDSPs](#Show_UDSPs)

•

lnetctl udsp show

udsp:  
\- idx: 0  
src: tcp  
dst: NA  
rte: NA  
action:  
priority: 0

# [SEE ALSO](#SEE_ALSO)

[**lustre**(7)](/man/enterprise-packages/lustre/lustre.7)

2017 Jan 12 Lustre

---

Document: lnetctl(8) from lustre 2.17.59-r2 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
