Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
13.5. Configuring the Base RDMA Subsystem
Startup of the
rdma service is automatic. When RDMA capable hardware, whether InfiniBand or iWARP or RoCE/IBoE is detected, udev instructs systemd to start the rdma service.
systemctl status rdma
~]# systemctl status rdma
● rdma.service - Initialize the iWARP/InfiniBand/RDMA stack in the kernel
Loaded: loaded (/usr/lib/systemd/system/rdma.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: file:/etc/rdma/rdma.conf
Users need not enable the
rdma service, but they can if they want to force it on all the time. To do that, enter the following command as root:
systemctl enable rdma
~]# systemctl enable rdma
13.5.1. Configuration of the rdma.conf file Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
The
rdma service reads /etc/rdma/rdma.conf to find out which kernel-level and user-level RDMA protocols the administrator wants to be loaded by default. Users should edit this file to turn various drivers on or off.
The various drivers that can be enabled and disabled are:
IPoIB— This is anIPnetwork emulation layer that allowsIPapplications to run over InfiniBand networks.SRP— This is the SCSI Request Protocol. It allows a machine to mount a remote drive or drive array that is exported through theSRPprotocol on the machine as though it were a local hard disk.SRPT— This is the target mode, or server mode, of theSRPprotocol. This loads the kernel support necessary for exporting a drive or drive array for other machines to mount as though it were local on their machine. Further configuration of the target mode support is required before any devices will actually be exported. See the documentation in the targetd and targetcli packages for further information.ISER— This is a low-level driver for the general iSCSI layer of the Linux kernel that provides transport over InfiniBand networks for iSCSI devices.RDS— This is the Reliable Datagram Service in the Linux kernel. It is not enabled in Red Hat Enterprise Linux 7 kernels and so cannot be loaded.
13.5.2. Usage of 70-persistent-ipoib.rules Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
The rdma package provides the file
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Immediately after
/etc/udev.d/rules.d/70-persistent-ipoib.rules. This udev rules file is used to rename IPoIB devices from their default names (such as ib0 and ib1) to more descriptive names. Users must edit this file to change how their devices are named. First, find out the GUID address for the device to be renamed:
ip link show ib0
~]$ 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:f4:52:14:03:00:7b:cb:a1 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
link/infiniband is the 20 byte hardware address for the IPoIB interface. The final 8 bytes of the address, marked in bold above, is all that is required to make a new name. Users can make up whatever naming scheme suits them. For example, use a device_fabric naming convention such as mlx4_ib0 if a mlx4 device is connected to an ib0 subnet fabric. The only thing that is not recommended is to use the standard names, like ib0 or ib1, as these can conflict with the kernel assigned automatic names. Next, add an entry in the rules file. Copy the existing example in the rules file, replace the 8 bytes in the ATTR{address} entry with the highlighted 8 bytes from the device to be renamed, and enter the new name to be used in the NAME field.
13.5.3. Relaxing memlock restrictions for users Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
RDMA communications require that physical memory in the computer be pinned (meaning that the kernel is not allowed to swap that memory out to a paging file in the event that the overall computer starts running short on available memory). Pinning memory is normally a very privileged operation. In order to allow users other than
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
root to run large RDMA applications, it will likely be necessary to increase the amount of memory that non-root users are allowed to pin in the system. This is done by adding a file in the /etc/security/limits.d/ directory with contents such as the following:
more /etc/security/limits.d/rdma.conf
~]$ more /etc/security/limits.d/rdma.conf
# configuration for rdma tuning
* soft memlock unlimited
* hard memlock unlimited
# rdma tuning end
13.5.4. Configuring Mellanox cards for Ethernet operation Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Certain hardware from Mellanox is capable of running in either InfiniBand or Ethernet mode. These cards generally default to InfiniBand. Users can set the cards to Ethernet mode. There is currently support for setting the mode only on ConnectX family hardware (which uses either the mlx5 or mlx4 driver).
To configure Mellanox mlx5 cards, use the mstconfig program from the mstflint package. For more details, see the Configuring Mellanox mlx5 cards in Red Hat Enterprise Linux 7 Knowledge Base article on the Red Hat Customer Portal.
To configure Mellanox mlx4 cards, use mstconfig to set the port types on the card as described in the Knowledge Base article. If mstconfig does not support your card, edit the
/etc/rdma/mlx4.conf file and follow the instructions in that file to set the port types properly for RoCE/IBoE usage. In this case is also necessary to rebuild the initramfs to make sure the updated port settings are copied into the initramfs.
Once the port type has been set, if one or both ports are set to Ethernet and mstconfig was not used to set the port types, then users might see this message in their logs:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
This is normal and does not affect operation. The script responsible for setting the port type has no way of knowing when the driver has finished switching port 2 to the requested type internally, and from the time that the script issues a request for port 2 to switch until that switch is complete, the attempts to set port 1 to a different type get rejected. The script retries until the command succeeds or until a timeout has passed indicating that the port switch never completed.
mlx4_core 0000:05:00.0: Requested port type for port 1 is not supported on this HCA
mlx4_core 0000:05:00.0: Requested port type for port 1 is not supported on this HCA
13.5.5. Connecting to a Remote Linux SRP Target Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
The SCSI RDMA Protocol (SRP) is a network protocol that enables a system to use RDMA to access SCSI devices that are attached to another system. To allow an SRP initiator to connect an SRP target on the SRP target side, you must add an access control list (ACL) entry for the host channel adapter (HCA) port used in the initiator.
ACL IDs for HCA ports are not unique. The ACL IDs depend on the GID format of the HCAs. HCAs that use the same driver, for example
ib_qib, can have different format of GIDs. The ACL ID also depends on how you initiate the connection request.
Connecting to a Remote Linux SRP Target: High-Level Overview
- Prepare the target side:
- Create storage back end. For example get the /dev/sdc1 partition:
/> /backstores/block create vol1 /dev/sdc1
/> /backstores/block create vol1 /dev/sdc1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create an SRP target:
/> /srpt create 0xfe80000000000000001175000077dd7e
/> /srpt create 0xfe80000000000000001175000077dd7eCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a LUN based on the back end created in step a:
/> /srpt/ib.fe80000000000000001175000077dd7e/luns create /backstores/block/vol1
/> /srpt/ib.fe80000000000000001175000077dd7e/luns create /backstores/block/vol1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a Node ACL for the remote SRP client:Note that the Node ACL is different for
/> /srpt/ib.fe80000000000000001175000077dd7e/acls create 0x7edd770000751100001175000077d708
/> /srpt/ib.fe80000000000000001175000077dd7e/acls create 0x7edd770000751100001175000077d708Copy to Clipboard Copied! Toggle word wrap Toggle overflow srp_daemonandibsrpdm.
- Initiate an SRP connection with
srp_daemonoribsrpdmfor the client side:srp_daemon -e -n -i qib0 -p 1 -R 60 &
[root@initiator]# srp_daemon -e -n -i qib0 -p 1 -R 60 &Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibsrpdm -c -d /dev/infiniband/umad0 > /sys/class/infiniband_srp/srp-qib0-1/add_target
[root@initiator]# ibsrpdm -c -d /dev/infiniband/umad0 > /sys/class/infiniband_srp/srp-qib0-1/add_targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Optional. It is recommended to verify the SRP connection with different tools, such as
lsscsiordmesg.
Procedure 13.3. Connecting to a Remote Linux SRP Target with srp_daemon or ibsrpdm
- Use the
ibstatcommand on the target to determine theStateandPort GUIDvalues. The HCA must be inActivestate. The ACL ID is based on thePort GUID:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Get the SRP target ID, which is based on the GUID of the HCA port. Note that you need a dedicated disk partition as a back end for a SRP target, for example
/dev/sdc1. The following command replaces the default prefix of fe80, removes the colon, and adds the new prefix to the remainder of the string:ibstatus | grep '<default-gid>' | sed -e 's/<default-gid>://' -e 's/://g' | grep 001175000077dd7e
[root@target]# ibstatus | grep '<default-gid>' | sed -e 's/<default-gid>://' -e 's/://g' | grep 001175000077dd7e fe80000000000000001175000077dd7eCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
targetclitool to create the LUN vol1 on the block device, create an SRP target, and export the LUN:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
ibstatcommand on the initiator to check if the state isActiveand determine thePort GUID:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the following command to scan without connecting to a remote SRP target. The target GUID shows that the initiator had found remote target. The ID string shows that the remote target is a Linux software target (
ib_srpt.ko).Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To verify the SRP connection, use the
lsscsicommand to list SCSI devices and compare thelsscsioutput before and after the initiator connects to target.lsscsi
[root@initiator]# lsscsi [0:0:10:0] disk IBM-ESXS ST9146803SS B53C /dev/sdaCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To connect to a remote target without configuring a valid ACL for the initiator port, which is expected to fail, use the following commands for
srp_daemonoribsrpdm:srp_daemon -e -n -i qib0 -p 1 -R 60 &
[root@initiator]# srp_daemon -e -n -i qib0 -p 1 -R 60 & [1] 4184Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibsrpdm -c -d /dev/infiniband/umad0 > /sys/class/infiniband_srp/srp-qib0-1/add_target
[root@initiator]# ibsrpdm -c -d /dev/infiniband/umad0 > /sys/class/infiniband_srp/srp-qib0-1/add_targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow - The output of the
dmesgshows why the SRP connection operation failed. In a later step, thedmesgcommand on the target side is used to make the situation clear.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Because of failed LOGIN, the output of the
lsscsicommand is the same as in the earlier step.lsscsi
[root@initiator]# lsscsi [0:0:10:0] disk IBM-ESXS ST9146803SS B53C /dev/sdaCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Using the
dmesgon the target side (ib_srpt.ko) provides an explanation of why LOGIN failed. Also, the output contains the valid ACL ID provided bysrp_daemon:0x7edd770000751100001175000077d708.dmesg
[root@target]# dmesg [ 1200.303001] ib_srpt Received SRP_LOGIN_REQ with i_port_id 0x7edd770000751100:0x1175000077d708, t_port_id 0x1175000077dd7e:0x1175000077dd7e and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x1175000077dd7e) [ 1200.322207] ib_srpt Rejected login because no ACL has been configured yet for initiator 0x7edd770000751100001175000077d708.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
targetclitool to add a valid ACL:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify the SRP LOGIN operation:
- Wait for 60 seconds to allow
srp_daemonto re-try logging in:sleep 60
[root@initiator]# sleep 60Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify the SRP LOGIN operation:
lsscsi
[root@initiator]# lsscsi [0:0:10:0] disk IBM-ESXS ST9146803SS B53C /dev/sda [7:0:0:0] disk LIO-ORG vol1 4.0 /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - For a kernel log of SRP target discovery, use:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow