目錄
1. 基礎知識
2. 驅動安裝
3.配置IP
4. 性能測試
5. 其他問題
RDMA 、InfiniBand、IB卡、IB驅動的關系
ibdump 用法說明
原文:https://www.cnblogs.com/sctb/p/13179542.html
最近多次安裝、使用infiniband網卡,每次都要到處尋找相關資料,是以決定做此總結,友善查找。
1. 基礎知識
首先,得了解什麼是RDMA,貼幾個資料:
深入淺出全面解析RDMA
RDMA技術詳解(一):RDMA概述
RDMA技術詳解(二):RDMA Send Receive操作
然後得了解如何實作,這兩個可以有個初步了解:
RDMA程式設計:事件通知機制
RDMA read and write with IB verbs
程式設計過程,真正有用的還是官方的手冊:
RDMA Aware Networks Programming User Manual
mellanox官方社群能找到很多你需要的東西:
https://community.mellanox.com/s/
也下了個中文版,但我感覺英文版看着更好。中文版下載下傳:
百度雲: https://pan.baidu.com/s/1BkbinPMy6fwN7J5BPFadDw 提取碼: rm8i
藍奏雲:https://wwa.lanzous.com/iXUd6jm7qla 密碼: 4aps
RDMA程式設計入門可參考的項目:
https://github.com/tarickb/the-geek-in-the-corner
https://github.com/jcxue/RDMA-Tutorial
一、診斷工具--翻譯中
摘自《Mellanox_OFED_Linux_User_Manual_v4_1》
本章介紹的診斷工具提供了fabric中IB裝置的連接配接和狀态調試方法。
工具 | 描述 |
ibdump | 測試流入和流出Mellanox Technologies ConnectX系列擴充卡InfiniBand端口的InfiniBand通信。 請注意以下幾點:
dump出來的檔案,可以通過Wireshark工具加載進行圖形流量分析。 以下描述了本地HCA(擴充卡)嗅探的工作流程:
注意:盡管ibdump是Linux應用程式,但是可以在任一作業系統上分析生成的.pcap檔案。 [mlx4]為了使ibdump與RoCE一起使用,必須啟用Flow Steering。 啟用步驟: 1.将以下内容添加到/etc/modprobe.d/mlnx.conf檔案:options mlx4_core log_num_mgm_entry_size = -1 2.重新啟動驅動程式。 注意:如果将HCA的端口中有一個配置為InfiniBand,則ibdump要求IPoIB DMFS是使能的。有關更多資訊,請參閱第3.1.12.1節,啟用/禁用流向,第103頁。有關更多資訊,請參閱工具的手冊頁。 |
dump_fts | 為子網的ibnetdiscover掃描中發現的每個交換機轉儲表。dump檔案格式與使用-R file -U /path/to/dump-file文法加載到OpenSM相容。 Dumps tables for every switch found in an ibnetdiscover scan of the subnet. The dump file format is compatible with loading into OpenSM using the -R file -U /path/to/dump-file syntax. For further information, please refer to the tool’s man page. |
ibaddr | 預設情況下,可以用來顯示指定端口或本地端口的LID和GID位址。這個實用程式可以用作簡單的位址解析器。 要了解更多資訊,請參考該工具的手冊頁。 Can be used to show the LID and GID addresses of the specified port or the local port by default. This utility can be used as simple address resolver. For further information, please refer to the tool’s man page. |
ib_send_bw | 測試兩台機器之間的SEND帶寬 一個充當伺服器,另一個充當用戶端。伺服器從用戶端接收資料包,它們都計算操作的吞吐量。該測試支援雙向功能(雙向功能可同時發送和接收),mtu大小的更改,tx大小,疊代次數,消息大小等。使用“ -a”可提供所有消息大小的結果。 有關更多資訊,請參閱該工具的手冊頁。 Calculates the BW of SEND between a pair of machines. One acts as a server and the other as a client. The server receive packets from the client and they both calculate the throughput of the operation. The test supports features such as Bidirectional, on which they both send and receive at the same time, change of mtu size, tx size, number of iteration, message size and more. Using the "-a" provides results for all message sizes. For further information, please refer to the tool’s man page. |
rping | softRoCE連通性測試 服務端IP為:192.168.1.10,在服務端開啟RDMA rping -s -a 192.168.1.10 -v -C 10 出現的等待視窗, 用戶端IP為:192.168.1.34,按照同樣的方式安裝RDMA(因為rping的指令需要使用以上軟體的安裝才能生成) rping -c -a 192.168.1.10 -v -C 10 |
2. 驅動安裝
-
下載下傳驅動,進入網站選擇相應系統和軟體版本,archive versions這裡可以下載下傳舊版本驅動
http://www.mellanox.com/page/software_overview_ib
ubuntu16.04平台5.0-2.1.8.0的下載下傳連結為:【RDMA】infiniband網卡安裝|InfiniBand 連接配接和狀态診斷工具|測試RDMA網卡是否正常工作一、診斷工具--翻譯中 wget http://content.mellanox.com/ofed/MLNX_OFED-5.0-2.1.8.0/MLNX_OFED_LINUX-5.0-2.1.8.0-ubuntu16.04-x86_64.iso
版本5.1之後連結細微變化,ubuntu18.04平台5.1-2.5.8.0的下載下傳連結為:wget https://www.mellanox.com/downloads/ofed/MLNX_OFED-5.1-2.5.8.0/MLNX_OFED_LINUX-5.1-2.5.8.0-ubuntu18.04-x86_64.iso
其它平台和版本的驅動,可以自己修改。 - 挂載或解壓,如果下載下傳的iso則挂載,若是tgz就解壓,下面是挂載指令:
sudo mount -o ro,loop MLNX_OFED_LINUX-5.0-2.1.8.0-ubuntu16.04-x86_64.iso /mnt
- 安裝
cd /mnt sudo ./mlnxofedinstall
可能會提示你安裝一堆東西,複制,安裝就可以了。
安裝成功截圖:
【RDMA】infiniband網卡安裝|InfiniBand 連接配接和狀态診斷工具|測試RDMA網卡是否正常工作一、診斷工具--翻譯中 - 執行以下指令:
sudo /etc/init.d/openibd restart sudo /etc/init.d/opensmd restart
- 檢視網卡狀态:
sudo hca_self_test.ofed
【RDMA】infiniband網卡安裝|InfiniBand 連接配接和狀态診斷工具|測試RDMA網卡是否正常工作一、診斷工具--翻譯中 沒有 failed 就對了。
一些其它檢視網卡資訊的指令:
ibstat ibstatus ibv_devinfo ibv_devices #檢視本主機的infiniband裝置 ibnodes #檢視網絡中的infiniband裝置
3.配置IP
見:《linux配置網口IP|RDMA配置IP|ens、eno、enp網口的差別》https://blog.csdn.net/bandaoyu/article/details/116308950
4. 性能測試
- 服務端運作:
ib_send_bw -a -c UD -d mlx4_0 -i 1
注意,參數 -i 指定端口,在一個網卡有多個網口的時候,需要指定測試的端口,具體哪個端口,通過 ibstatus 可以看到。 - 用戶端運作:
ib_send_bw -a -c UD -d mlx4_0 -i 1 172.16.0.102
最後面的ip位址是服務端infiniband網卡的ip位址。【RDMA】infiniband網卡安裝|InfiniBand 連接配接和狀态診斷工具|測試RDMA網卡是否正常工作一、診斷工具--翻譯中 - 其他測試項
ib_atomic_bw ib_atomic_lat ib_read_bw ib_read_lat ib_send_bw ib_send_lat ib_write_bw ib_write_lat
bw表示測試帶寬,lat表示測試延遲,參數同上,可以i通過 --help 檢視。
- 其他測試項
其他測試工具說明:https://community.mellanox.com/s/topic/0TO50000000g1zZGAQ/infinibandroce-tools?tabset-dea0d=2
測試工具源碼:https://github.com/linux-rdma/perftest
5. 其他問題
更換網卡工作模式:
有些網卡,當你安裝好驅動後,通過 ibstatus 指令,會出現下面的情況:
可以看到,該網卡現在處于 Ethernet 的工作模式,如果想要切換成infiniband模式,參考如下連結:
https://community.mellanox.com/s/article/howto-change-port-type-in-mellanox-connectx-3-adapter
檢視目前工作模式:
sudo /sbin/connectx_port_config -s
輸入以下指令切換工作模式:
sudo /sbin/connectx_port_config
如果提示如圖,說明不支援infiniband模式,否則,就切換成功了,再次使用一下指令可以驗證:
sudo /sbin/connectx_port_config -s
不能切換到infiniband工作模式,并不代表不支援RDMA,處于Ethernet模式的網卡使用 RoCE 協定工作。
RDMA 協定:底層可以是以太網( RoCE 或者 iWARP )或者 Infiniband
有些網卡隻支援Ethernet(RoCE),不支援Infiniband模式,也就是想從Ethernet切換到Infiniband模式時不能成功,這個要提前了解好。我目前了解到的,Connectx-3隻支援Ethernet模式。
https://community.mellanox.com/s/question/0D51T00006RVtsz/connectx4-says-it-doesnt-support-linktypep1-configuration
RDMA 、InfiniBand、IB卡、IB驅動的關系
1、RDMA 是一種技術(遠端直接記憶體通路技術),如何實作這種技術呢?
2、實作這種技術你可以選擇用 Infiniband 協定。(當然你也可以使用其他協定,eg:roce、iwarp)
3、如果你使用 Infiniband 協定,這個協定作為一個新一代網絡協定。它必須依靠專門的硬體才能實作。eg:專用INC(網卡)—— IB卡,或者專用交換機。
4、當你在伺服器上安裝了IB卡之後,你還得安裝 IB驅動,才能使用 infiniband 。
原文連結:https://blog.csdn.net/ljlfather/article/details/102930714
其他文章《Infiniband的驅動安裝與配置》:https://blog.csdn.net/oPrinceme/article/details/51001849