[Mellanox] 安装MFT并配置网卡为以太网模式
当我们想要配置Mellanox网卡时,如果出现了下面情况:
$ sudo mst start
mst: command not found
这说明我们的系统中缺少MFT。
MFT是一套管理Mellanox网卡的工具,也是MLEX_OFED中的一部分。如果你不小心搞丢了MFT,可以用下面的方法安装:
- 去官网下载MFT
Mellanox Firmware Tools (MFT) (nvidia.com)
我下的版本是4.22.1 LTS Linux DEB x64
tar xvf mft-4.22.1-11-x86_64-deb.tgz
cd mft-4.22.1-11-x86_64-deb
sudo bash install.sh
sudo mst start
如果不报错就说明MFT装好了。
默认地,你的网卡应该是IB模式,如果你的网络是以太网的话,你就需要将网卡转换为以太网模式:
- 查看你的设备名称
$ ls /dev/mst
mt4119_pciconf0 mt4119_pciconf0.1
- 查看设备的状态
$ sudo mlxconfig -d /dev/mst/mt4119_pciconf0 query
Device #1:
----------
Device type: ConnectX5
Name: MCX556A-ECA_Ax
Description: ConnectX-5 VPI adapter card; EDR IB (100Gb/s) and 100GbE; dual-port QSFP28; PCIe3.0 x16; tall bracket; ROHS R6
Device: /dev/mst/mt4119_pciconf0
Configurations: Next Boot
...
LINK_TYPE_P1 IB(1)
LINK_TYPE_P2 IB(1)
...
可以看到LINK_TYPE_P1和LINK_TYPE_P2的配置都是IB。
- 将设备切换到以太网模式
$ sudo mlxconfig -d /dev/mst/mt4119_pciconf0 set LINK_TYPE_P1=2 LINK_TYPE_P2=2
Device #1:
----------
Device type: ConnectX5
Name: MCX556A-ECA_Ax
Description: ConnectX-5 VPI adapter card; EDR IB (100Gb/s) and 100GbE; dual-port QSFP28; PCIe3.0 x16; tall bracket; ROHS R6
Device: /dev/mst/mt4119_pciconf0
Configurations: Next Boot New
LINK_TYPE_P1 IB(1) ETH(2)
LINK_TYPE_P2 IB(1) ETH(2)
Apply new Configuration? (y/n) [n] : y
Applying... Done!
-I- Please reboot machine to load new configurations.
- 重启设备
sudo reboot
现在网卡已经变成以太网模式的了,可以通过下面几种命令查看
$ ibdev2netdev
mlx5_0 port 1 ==> ens10f0 (Down)
mlx5_1 port 1 ==> ens10f1 (Up)
$ ifconfig
ens10f0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 10:70:fd:2f:e4:40 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens10f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::9a81:307c:1222:53bc prefixlen 64 scopeid 0x20<link>
ether 10:70:fd:2f:e4:41 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 45 bytes 7117 (7.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ ibstat
CA 'mlx5_0'
...
Port 1:
...
Link layer: Ethernet
CA 'mlx5_1'
.
Port 1:
...
Link layer: Ethernet
标签:mst,网卡,MFT,LINK,IB,TYPE,以太网
From: https://www.cnblogs.com/CQzhangyu/p/17322167.html