我无法将 mlx5 pmd 驱动程序与我在服务器上安装的某些 Mellanox NIC 一起使用。我在 EAL 初始化期间收到的错误是:
et_mlx5:没有 Verbs 设备与 PCI 设备 0000:03:00.0 匹配,是否加载了内核驱动程序?
我当前使用的DPDK版本是:DPDK-STABLE-18.11
我已经安装了OFED最新版本:
mlnx-en-4.5-1.0.1.0-ubuntu16.04-x86_64
我已经执行了 ib_uverbs 内核模块的 modprobe
这是我正在使用的内核版本
moragalu@server:~$ uname -r
4.4.0-143-generic
以下是网卡型号:
moragalu@server:~$ lspci | grep Mell
03:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
03:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
06:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
06:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
NIC 使用的固件版本:
moragalu@eridium03:~$ ethtool -i eridium25-03
driver: mlx5_core
version: 4.5-1.0.1
firmware-version: 14.24.1000 (MT_2420110034)
expansion-rom-version:
bus-info: 0000:06:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes
真实初始化的完整输出是:
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:03:00.0 on NUMA socket 0
EAL: probe driver: 15b3:1015 net_mlx5
net_mlx5: no Verbs device matches PCI device 0000:03:00.0, are kernel drivers loaded?
EAL: Requested device 0000:03:00.0 cannot be used
EAL: PCI device 0000:03:00.1 on NUMA socket 0
EAL: probe driver: 15b3:1015 net_mlx5
net_mlx5: no Verbs device matches PCI device 0000:03:00.1, are kernel drivers loaded?
EAL: Requested device 0000:03:00.1 cannot be used
EAL: PCI device 0000:06:00.0 on NUMA socket 0
EAL: probe driver: 15b3:1015 net_mlx5
net_mlx5: no Verbs device matches PCI device 0000:06:00.0, are kernel drivers loaded?
EAL: Requested device 0000:06:00.0 cannot be used
EAL: PCI device 0000:06:00.1 on NUMA socket 0
EAL: probe driver: 15b3:1015 net_mlx5
net_mlx5: no Verbs device matches PCI device 0000:06:00.1, are kernel drivers loaded?
EAL: Requested device 0000:06:00.1 cannot be used
EAL: PCI device 0000:03:00.1 on NUMA socket 0
EAL: probe driver: 15b3:1015 net_mlx5
net_mlx5: no Verbs device matches PCI device 0000:03:00.1, are kernel drivers loaded?
EAL: Driver cannot attach the device (03:00.1)
EAL: Failed to attach device on primary process
内核中加载的当前模块:
moragalu@eridium03:~$ lsmod | grep ib
mlx5_ib 16384 0
mlx_compat 24576 4 mlx4_en,mlx5_ib,mlx4_core,mlx5_core
ib_uverbs 61440 0
ib_iser 49152 0
rdma_cm 49152 1 ib_iser
ib_cm 49152 1 rdma_cm
ib_sa 36864 2 rdma_cm,ib_cm
ib_mad 49152 2 ib_cm,ib_sa
ib_core 106496 7 rdma_cm,ib_cm,ib_sa,iw_cm,ib_mad,ib_iser,ib_uverbs
ib_addr 20480 2 rdma_cm,ib_core
最佳答案
在使用 RDMA 核心库来实现 ibverbs 依赖项时,我也遇到了同样的问题。过去,我曾设法在 mlx5_core.c 中找到一个错误(在探测函数中将队列数硬编码为 8,并且它神奇地工作了),但我不确定这对您来说是否是同样的问题。
无论如何,当我安装最新的 Mellanox OFED Drivers 后,问题就消失了。 ,所以尝试一下是个好主意。只需记住使用以下命令安装它:
mlnxofedinstall --dpdk --upstream-libs
编辑:刚刚注意到您已经安装了驱动程序 - 确保您按照上面的方式进行了安装。您还可以做一件事:检查其输出(使用 -libverbs
编译):
#include <infiniband/verbs.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main() {
struct ibv_device ** devices;
int num;
struct ibv_context * ctx;
devices = ibv_get_device_list(&num);
int i;
if(devices[0] == NULL)
printf("devices is null\n");
printf("got %d devices\n", num);
for (i=0;i<num;i++) {
printf(ibv_get_device_name(devices[i]));
printf("\n");
ctx = ibv_open_device(devices[i]);
if (ctx == NULL)
printf("ctx is null \n");
else
printf("device opened\n");
}
if (errno)
printf("ERROR: %s\n", strerror(errno));
ibv_free_device_list(devices);
return 0;
}
如果它没有列出任何设备,至少您会知道这是 verbs 驱动程序的问题,而不是 DPDK 本身的问题。
关于networking - DPDK MLX5 PMD 驱动程序探针问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55485698/