NVMe-oF TCP

TCP transport does not need any special libraries. All required software is built in scope of the xiRAID engine.

The following steps are needed to configure TCP target:

  1. Create TCP transport at the xiRAID engine:

    xnr_cli nvmf transport create --trtype TCP --zcopy
  2. Create NVME-oF subsystem. You have to provide the subsystem nqn and serial number. Both are ASCII stings. Serial number can be any string. NQN format shall correspond to the NVMe specification. The engine validates NQN.

    xnr_cli nvmf subsystem create --nqn nqn.2018-09.io.xinnor:node1 --serial-number XNR00001 --model-number 'Xinnor Raid' --ana-reporting --allow-any-host
  3. Add TCP listener to connect the NVMe. Specify IP address for the listener. It should be configured at a network device or you can select localhost 127.0.0.1 address. Usually localhost connectivity is slow and is suitable for test purposes. 4420 is a port number usually used for NVMe-oF.

    xnr_cli nvmf listener add --nqn nqn.2018-09.io.xinnor:node1 --trtype tcp --adrfam ipv4 --traddr 127.0.0.1 --trsvcid 4420
  4. Add a RAID to the subsystem as a namespace. This operation connect the RAID block device to the subsystem as externally visible NVMe namespace through the configured transport

    xnr_cli nvmf namespace add --nqn nqn.2018-09.io.xinnor:node1 --bdev xnraid

As soon as the RAID BDEV is exposed as NVMe-oF target it can be connected by regular initiator. For example, if the listener uses localhost IP address you can connect the RAID as local Linux block device by

sudo modprobe nvme-fabrics nvme-tcp
sudo connect -t tcp -a 127.0.0.1 -s 4420 -n nqn.2018-09.io.xinnor:node1
Then you can list the device by nvme tool amd use the /dev/nvme0n1 as a regualr block device for IO.

The device can be disconnected by

sudo nvme disconnect -n nqn.2018-09.io.xinnor:node1

and the namespace can be removed by

xnr_cli nvmf namespace remove --nqn nqn.2018-09.io.xinnor:node1 --nsid 1, where nsid is the namespace ordinal number.

There is no way to destroy TCP listener and NVMe-oF subsystem in this release.