Home / Alt manpages / rdma-link(8)

  • rdma-link(8)
  • Admin command
  • linux

Create and Remove Soft RDMA Links with rdma-link

You will inspect the RDMA links on a Linux host, create a software RDMA link for a network device, verify the result, and remove that link without touching the underlying network device. Allow about fifteen minutes if you already know the interface name. The examples use the installed rdma utility from iproute2 6.1.0-1ubuntu6.4 and the local rdma-link(8) manual page.

This guide covers the two link types documented by that version: rxe, Soft RoCE, and siw, Soft iWARP. It does not configure an RDMA application, IP addressing or a physical adapter.

1. Check the utility and available network device

Start with read-only checks. These do not need elevated privileges:

$ command -v rdma
/usr/bin/rdma
$ rdma -V
rdma utility, iproute2-6.1.0
$ ip -brief link

Use an interface that really exists in your own output. Replace eth0 below with the exact name from that output. Do not confuse an RDMA link name with a network-device name: the latter is the device after netdev.

Checkpoint

Write down the network-device name and choose one link type. If you do not need a software RDMA link, stop here. The remaining steps change kernel networking state.

List every RDMA link before making a change:

$ rdma link show

On the reference host this returned no lines and status 0. The output is host-specific: a configured machine will list its links, while a machine with none may print nothing and still return success. A link is addressed in the form DEV/PORT_INDEX, such as mlx5_0/1. To inspect one known link, pass that value:

$ rdma link show mlx5_0/1

Use the device and port index from your own listing. Do not paste this example unless your host really has that link.

The exact attributes depend on the driver. Treat the list as the source of truth for names already in use; do not choose a new name by guessing from a physical port.

Warning

Adding a link changes live kernel state and can affect software that discovers RDMA devices. Use an interface intended for this test, and confirm that its name is correct before pressing Enter. The operation normally needs elevated privileges, so use sudo only for this state-changing command.

For Soft RoCE, choose a new RDMA link name and bind it to the existing network device:

$ sudo rdma link add rxe_eth0 type rxe netdev eth0

The name rxe_eth0 is only an example. It is the name you will use for inspection and removal. If your test needs Soft iWARP instead, use the documented siw type:

$ sudo rdma link add siw_eth0 type siw netdev eth0

Do not run both examples unless you intentionally want two software links on the same network device. If the command reports that the name exists, pick a different name or inspect the existing link first. If it reports that the type or network device is unavailable, check the spelling and whether the relevant software driver is present on this host.

Checkpoint

A successful add normally produces no output. That is not enough to identify the resulting link, so verify it immediately.

Show all links and look for the name you selected:

$ rdma link show

For a software link, the port index and state are supplied by the driver. The important checks are that your chosen name appears, the reported netdev is the intended interface, and the command exits successfully.

You can also ask for the link directly with its device and port index once the listing tells you both values:

$ rdma link show rxe_eth0/1

Replace rxe_eth0/1 with the exact device and port index shown by the preceding listing. If the link is absent, record the error from the add command and inspect the list again. Do not repeatedly retry an unknown failure: a partial result or a name collision is easier to resolve from the current listing.

Removing the link is the undo operation for the examples above. First confirm its exact name with rdma link show. Then delete it with elevated privileges:

$ sudo rdma link delete rxe_eth0
$ rdma link show

The final command should no longer list rxe_eth0. Deleting the link does not delete or rename eth0, but applications using the RDMA link can lose access while it is removed. If you created siw_eth0, substitute that exact name.

There is no safe generic delete command for an unknown name. If deletion fails with a name or device error, do not broaden the command. Re-run the listing, copy the exact link name, and retry that specific deletion.

6. Keep the common traps separate

  • rdma link show displays RDMA links. It is not the same as ip link show, which displays network devices.
  • netdev eth0 names the network device being used by the new link. It is not the new RDMA link name.
  • rxe means Soft RoCE; siw means Soft iWARP. Choose the type your test or application expects.
  • DEV/PORT_INDEX is the lookup form for an existing link. Discover the port index from rdma link show instead of assuming it.
  • rdma link add and rdma link delete alter live state. Keep their use out of unattended scripts until failure handling and cleanup are explicit.

For command syntax on this installation, use rdma link help. It lists show, add, delete and the required arguments without changing state.

Done means

  • You checked the installed iproute2 version and selected a real network-device name.
  • You inspected existing links before choosing a new RDMA name.
  • You used either rxe or siw deliberately and verified the resulting netdev.
  • You recorded the exact RDMA link name so it can be removed without guessing.
  • You deleted the test link, or left it in place knowingly because an application still needs it.