采用 InfiniBand 连接的设备可以通过RDMA(Remote Direct Memory Access)技术实现零拷贝数据传输,在减少CPU负载的同时提高了应用程序的性能。此外,InfiniBand 还提供了诸如缓冲区管理、QoS(Quality of Service)和虚拟化等特性,以支持高效的数据传输和资源管理。
[root@toolbox ~]# ibstat CA 'mlx4_0' CA type: MT4099 Number of ports: 2 Firmware version: 2.42.5000 Hardware version: 1 Node GUID: 0x0002c903003fc5e0 System image GUID: 0x0002c903003fc5e3 Port 1: State: Active Physical state: LinkUp Rate: 40 Base lid: 45 LMC: 0 SM lid: 1 Capability mask: 0x02514868 Port GUID: 0x0002c903003fc5e1 Link layer: InfiniBand Port 2: State: Active Physical state: LinkUp Rate: 40 Base lid: 46 LMC: 0 SM lid: 1 Capability mask: 0x02514868 Port GUID: 0x0002c903003fc5e2 Link layer: InfiniBand [root@toolbox ~]#
CA类型: HCA型号为 MT4099。
端口数量: HCA有2个端口。
固件版本: HCA固件版本为2.42.5000。
硬件版本: HCA硬件版本为1。
节点GUID: 此HCA的节点全局唯一标识符(GUID)为0x0002c903003fc5e0。
系统镜像GUID: 此HCA的系统镜像GUID为0x0002c903003fc5e3。
端口1: 这提供了有关HCA端口1的信息:
状态: 端口1的状态为“活动”。
物理状态: 端口1的物理状态为“LinkUp”。
速率: 端口1的数据传输速率为40 Gbps。
基本LID: 端口1的基本LID(本地标识符)为45。
LMC: 端口1的LMC(LID掩码计数)为0,表示仅使用基本LID。
SM LID: 端口1的SM LID(子网管理器LID)为1。
能力掩码: 端口1的能力掩码为0x02514868。
端口GUID: 端口1的端口GUID为0x0002c903003fc5e1。
链接层: 端口1使用的链接层协议是InfiniBand。
ibdiagnet
ibdiagnet 检测当前集群下物理链路的健康情况
1 2 3 4 5 6 7 8 9 10
root@liruilongs.github.io:~# ibdiagnet Loading IBDIAGNET from: /usr/lib/x86_64-linux-gnu/ibdiagnet1.5.7 -W- Topology file is not specified. Reports regarding cluster links will use direct routes. Loading IBDM from: /usr/lib/x86_64-linux-gnu/ibdm1.5.7 -W- A few ports of local device are up. Since port-num was not specified (-p option), port 1 of device 1 will be used as the local port. ibwarn: [7757] get_abi_version: can't read ABI version from /sys/class/infiniband_mad/abi_version (No such file or directory): is ib_umad module loaded? -E- Fail to ibcr_bind.
root@liruilongs.github.io:~# ibdiagnet Loading IBDIAGNET from: /usr/lib/x86_64-linux-gnu/ibdiagnet1.5.7 -W- Topology file is not specified. Reports regarding cluster links will use direct routes. Loading IBDM from: /usr/lib/x86_64-linux-gnu/ibdm1.5.7 -W- A few ports of local device are up. Since port-num was not specified (-p option), port 1 of device 1 will be used as the local port. -I- Discovering ... 49 nodes (4 Switches & 45 CA-s) discovered.
-I--------------------------------------------------- -I- Bad Guids/LIDs Info -I--------------------------------------------------- -I- No bad Guids were found
-I--------------------------------------------------- -I- Bad Links Info -I- No bad link were found -I--------------------------------------------------- ---------------------------------------------------------------- -I- Stages Status Report: STAGE Errors Warnings Bad GUIDs/LIDs Check 0 0 Link State Active Check 0 0 General Devices Info Report 0 0 Performance Counters Report 0 0 Partitions Check 0 0 IPoIB Subnets Check 0 1
Please see /var/cache/ibutils/ibdiagnet.log for complete log ----------------------------------------------------------------
-I- Done. Run time was 5 seconds. root@liruilongs.github.io:~#
root@liruilongs.github.io:~# ip a ................................... 7: ibs106f0: <BROADCAST,MULTICAST> mtu 4092 qdisc noop state DOWN group default qlen 256 link/infiniband 00:00:10:87:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:29:22:7a brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff altname ibp177s0f0 8: ibs106f1: <BROADCAST,MULTICAST> mtu 4092 qdisc noop state DOWN group default qlen 256 link/infiniband 00:00:18:87:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:29:22:7b brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff altname ibp177s0f1
给IB卡配置IP
1 2
root@liruilongs.github.io:~# ip address add 10.5.200.177/24 dev ibs106f0 root@liruilongs.github.io:~# ip link set ibs106f0 up
确认配置
1 2 3 4 5 6 7 8 9 10 11 12
root@liruilongs.github.io:~# ip a ................................................ 7: ibs106f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2044 qdisc mq state UP group default qlen 256 link/infiniband 00:00:10:87:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:29:22:7a brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff altname ibp177s0f0 inet 10.5.200.177/24 scope global ibs106f0 valid_lft forever preferred_lft forever inet6 fe80::7efe:9003:29:227a/64 scope link tentative valid_lft forever preferred_lft forever 8: ibs106f1: <BROADCAST,MULTICAST> mtu 4092 qdisc noop state DOWN group default qlen 256 link/infiniband 00:00:18:87:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:29:22:7b brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff altname ibp177s0f1
做 ping 测试
1 2 3 4 5 6 7 8
root@liruilongs.github.io:~# ping 10.5.200.177 PING 10.5.200.177 (10.5.200.177) 56(84) bytes of data. 64 bytes from 10.5.200.177: icmp_seq=1 ttl=64 time=0.027 ms 64 bytes from 10.5.200.177: icmp_seq=2 ttl=64 time=0.017 ms ^C --- 10.5.200.177 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1031ms rtt min/avg/max/mdev = 0.017/0.022/0.027/0.005 ms
ping 局域网IP 测试
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
root@liruilongs.github.io:~# ping 10.5.200.200 PING 10.5.200.200 (10.5.200.200) 56(84) bytes of data. 64 bytes from 10.5.200.200: icmp_seq=1 ttl=64 time=0.319 ms 64 bytes from 10.5.200.200: icmp_seq=2 ttl=64 time=0.281 ms ^C --- 10.5.200.200 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1011ms rtt min/avg/max/mdev = 0.281/0.300/0.319/0.019 ms root@liruilongs.github.io:~# ping 10.5.200.200 -i ibs106f0 ping: option argument contains garbage: ibs106f0 ping: this will become fatal error in the future PING 10.5.200.200 (10.5.200.200) 56(84) bytes of data. 64 bytes from 10.5.200.200: icmp_seq=1 ttl=64 time=0.295 ms 64 bytes from 10.5.200.200: icmp_seq=75 ttl=64 time=0.267 ms 64 bytes from 10.5.200.200: icmp_seq=107 ttl=64 time=0.240 ms ^C --- 10.5.200.200 ping statistics --- 129 packets transmitted, 13 received, 89.9225% packet loss, time 1839ms rtt min/avg/max/mdev = 0.177/0.218/0.344/0.050 ms, ipg/ewma 14.370/0.240 ms
[ibtests]# ib_send_bw -a -c UD -d mlx4_0 -i 1 ------------------------------------------------------------------ Send BW Test Connection type : UD Inline data is used up to 1 bytes message local address: LID 0x0b, QPN 0x28004c, PSN 0xfaa100 remote address: LID 0x02, QPN 0x70004b, PSN 0xc14da8 Mtu : 2048 ------------------------------------------------------------------ #bytes #iterations BW peak[MB/sec] BW average[MB/sec] ------------------------------------------------------------------