Chapter 3. Configuring the core RDMA subsystem

This section describes how to configure the rdma service and increase the amount of memory that users are allowed to pin in the system.

3.1. Configuring the rdma service

The rdma service manages the RDMA stack in the kernel. If Red Hat Enterprise Linux detects InfiniBand, iWARP, or RoCE devices, the udev device manager instructs systemd to start the rdma service.

Procedure

  1. Edit the /etc/rdma/rdma.conf file, and set the variables of the modules you want to enable to yes. The following is the default /etc/rdma/rdma.conf on Red Hat Enterprise Linux 8:

    # Load IPoIB
    IPOIB_LOAD=yes
    # Load SRP (SCSI Remote Protocol initiator support) module
    SRP_LOAD=yes
    # Load SRPT (SCSI Remote Protocol target support) module
    SRPT_LOAD=yes
    # Load iSER (iSCSI over RDMA initiator support) module
    ISER_LOAD=yes
    # Load iSERT (iSCSI over RDMA target support) module
    ISERT_LOAD=yes
    # Load RDS (Reliable Datagram Service) network protocol
    RDS_LOAD=no
    # Load NFSoRDMA client transport module
    XPRTRDMA_LOAD=yes
    # Load NFSoRDMA server transport module
    SVCRDMA_LOAD=no
    # Load Tech Preview device driver modules
    TECH_PREVIEW_LOAD=no
  2. Restart the rdma service:

    # systemctl restart rdma

3.2. Renaming IPoIB devices

By default, the kernel names IP over InfiniBand (IPoIB) devices, for example, ib0, ib1, and so on. To avoid conflicts, Red Hat recommends creating a rule in the udev device manager to create persistent and meaningful names, such as mlx4_ib0.

Prerequisites

  • An InfiniBand device is installed in the host.

Procedure

  1. Display the hardware address of the device. For example, to display the address for the device named ib0, enter:

    # ip link show ib0
    8: ib0: >BROADCAST,MULTICAST,UP,LOWER_UP< mtu 65520 qdisc pfifo_fast state UP mode DEFAULT qlen 256
        link/infiniband 80:00:02:00:fe:80:00:00:00:00:00:00:00:02:c9:03:00:31:78:f2 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff

    The last eight bytes of the address, marked in bold in the example, are required to create a udev rule in the next step.

  2. Edit the /etc/udev/rules.d/70-persistent-ipoib.rules file, and append an ACTION rule. For example, to configure a rule that renames the device with the 00:02:c9:03:00:31:78:f2 hardware address to mlx4_ib0, append the following line:

    ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*00:02:c9:03:00:31:78:f2", NAME="mlx4_ib0"
  3. Reboot the host:

    # reboot

Additional resources

3.3. Increasing the amount of memory that users are allowed to pin in the system

RDMA operations require pinning of physical memory. This means that the kernel is not allowed to write memory into the swap space. If a user pins too much memory, the system can run out of memory, and the kernel terminates processes in order to free up more memory. For this reason, memory pinning is a privileged operation.

If non-root users run large RDMA applications, it can be necessary to increase the amount of memory these users can pin in the system. This section describes how to configure an unlimited amount of memory for the rdma group.

Procedure

  • As the root user, create the /etc/security/limits.d/rdma.conf file with the following content:

    @rdma    soft    memlock     unlimited
    @rdma    hard    memlock     unlimited

Verification steps

  1. Log in as a member of the rdma group after you edited the /etc/security/limits.d/rdma.conf file.

    Note that Red Hat Enterprise Linux applies updated ulimit settings when the user logs in.

  2. Use the ulimit -l command to display the limit:

    $ ulimit -l
    unlimited

    If the command returns unlimited, the user can pin an unlimited amount of memory.

Additional resources

  • For further details about limiting system resources, see the limits.conf(5) man page.