zrlio / urdma

Verbs on DPDK
102 stars 24 forks source link

This repository contains the DPDK verbs source along with some demo applications.

Requirements

Setup instructions

I am assuming a default installation of Ubuntu 18.04. Other modern distributions should also work, but you would need to install DPDK yourself in order to build the required rte_kni kernel modules which most other distributions do not ship in their repositories.

To build this package, RTE_SDK and RTE_TARGET need to be exported into the environment. Using the packages in the Ubuntu 16.10 repositories, you can run the following:

$ source /usr/share/dpdk/dpdk-sdk-env.sh

Or for a manual DPDK installation:

$ export RTE_SDK=${prefix}/share/dpdk
$ export RTE_TARGET=x86_64-native-linuxapp-gcc

If you are pulling this from a fresh git clone, first run:

$ autoreconf -i

Then this follows the normal autotools-style build:

$ ./configure --sysconfdir /etc
$ make
$ sudo make install

Note that sysconfdir must match that of your libibverbs installation, in order for the verbs library to find the urdma driver.

The configure script will look for your kernel source directory in the typical location by default (/lib/modules/uname -r/source). You can set the KERNELDIR environment variable to specify a different location; for example, if you are building against a different kernel version than what it installed locally.

To run an application with this driver, the KNI and urdma modules must be loaded:

$ sudo modprobe rte_kni
$ sudo modprobe urdma

You need to use the dpdk-devbind script to bind the NICs that you wish to use with rdma to a DPDK-compatible UIO/VFIO kernel driver, instead of the default kernel netdev driver. Refer to the DPDK documentation for more information on this.

You will need to create a file ${sysconfdir}/rdma/urdma.json that looks like this, with appropriate values substituted in:

{ "ports": [ { "ipv4_address": "10.2.0.100" } ],
  "socket": "/run/urdma.sock",
  "eal_args": { "log-level": 7 }
}

You can validate your config file against doc/urdma-schema.json using any JSON schema validator; python-jsonschema which comes with Ubuntu is one possibility. Note that this schema file is stricter than what is actually allowed at runtime; at runtime, additional properties are simply ignored but the schema file does not allow them; this is to make typos more obvious.

Finally, the urdmad service must be running:

$ systemctl --user start urdmad

This will cause devices to appear in your "ip link" output, and cause uverbs devices to appear in /sys/class/infiniband_verbs.

Or you can manually run urdmad as root; in this case you will need to run every verbs application as root to pick up the DPDK configuration which cannot be relocated.

Troubleshooting Notes

Some RDMA demos, particularly the tools that come with librdmacm, can give confusing error messages when there are no RDMA devices available, along the lines of:

rdma_create_event_channel: No such device

If you see this error message, it indicates that urdma is not set up properly. Verify that you followed the steps above properly.

Known Issues