pktgen 找不到 Mellanox 端口

如何解决pktgen 找不到 Mellanox 端口

设置

  • Pktgen 版本 21.01.0
  • DPDK 20.11 版
  • 操作系统:ubuntu 18.04
  • 网卡:Mellanox
driver: mlx5_core
version: 5.1-2.5.8
firmware-version: 16.28.2006 (MT_0000000012)
expansion-rom-version:
bus-info: 0000:03:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes

问题

当我在 dpdk 20.11 和 dpdk-testpmd 中运行 ./dpdk-devbind -s 时,它可以找到 mlx 端口

Network devices using kernel driver
===================================
0000:03:00.0 'MT27800 Family [ConnectX-5] 1017' if=ens1f0 drv=mlx5_core unused=vfio-pci
0000:03:00.1 'MT27800 Family [ConnectX-5] 1017' if=ens1f1 drv=mlx5_core unused=vfio-pci
0000:05:00.0 'I210 Gigabit Network Connection 1533' if=enp5s0 drv=igb unused=vfio-pci *Active*
0000:06:00.0 'I210 Gigabit Network Connection 1533' if=enp6s0 drv=igb unused=vfio-pci
0000:07:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb' if=enp7s0f0 drv=ixgbe unused=vfio-pci
0000:07:00.1 '82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb' if=enp7s0f1 drv=ixgbe unused=vfio-pci
$sudo build/app/dpdk-testpmd -c7 --vdev=net_pcap0,iface=eth0 --vdev=net_pcap1,iface=eth1 -- -i --nb-cores=2 --nb-ports=2 --total-num-mbufs=2048

EAL: Detected 24 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:03:00.0 (socket 0)
mlx5_pci: Size 0xFFFF is not power of 2,will be aligned to 0x10000.
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:03:00.1 (socket 0)
mlx5_pci: Size 0xFFFF is not power of 2,will be aligned to 0x10000.
open_iface_live(): Couldn't open eth0: eth0: No such device exists (SIOCGIFHWADDR: No such device)
open_single_iface(): Couldn't open interface eth0
vdev_probe(): failed to initialize net_pcap0 device
open_iface_live(): Couldn't open eth1: eth1: No such device exists (SIOCGIFHWADDR: No such device)
open_single_iface(): Couldn't open interface eth1
vdev_probe(): failed to initialize net_pcap1 device
EAL: Bus (vdev) probe failed.
EAL: No legacy callbacks,legacy socket not created
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_0>: n=2048,size=2176,socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Configuring Port 0 (socket 0)
Port 0: 98:03:9B:06:AB:34
Configuring Port 1 (socket 0)
Port 1: 98:03:9B:06:AB:35
Checking link statuses...
Done
testpmd> quit

但是当我运行 pktgen 时,它不起作用。

$sudo ./Builddir/app/pktgen -c 0xff -n 3 -a 0000:03:00.1 -- -p 0x1 -P -m "[1:2].0"

Copyright (c) <2010-2020>,Intel Corporation. All rights reserved. Powered by DPDK
EAL: Detected 24 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: No legacy callbacks,legacy socket not created

*** Copyright (c) <2010-2020>,Intel Corporation. All rights reserved.
*** Pktgen  created by: Keith Wiles -- >>> Powered by DPDK <<<

 Port: Name         IfIndex Alias        NUMA  PCI

!PANIC!: *** Did not find any ports to use ***
PANIC in pktgen_config_ports():
*** Did not find any ports to use ***
6: [./Builddir/app/pktgen(+0x977a) [0x556f614b477a]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f1721223bf7]]
4: [./Builddir/app/pktgen(+0x9319) [0x556f614b4319]]
3: [./Builddir/app/pktgen(+0x31fa7) [0x556f614dcfa7]]
2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.21(__rte_panic+0xc5) [0x7f172221d285]]
1: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.21(rte_dump_stack+0x2e) [0x7f172223ef2e]]
Aborted

[更新-1]

我发现系统中存在 librte_net_mlx5.so

/usr/local/lib/x86_64-linux-gnu/librte_net_mlx5.so.21.0
/usr/local/lib/x86_64-linux-gnu/librte_net_mlx5.so.21
/usr/local/lib/x86_64-linux-gnu/librte_net_mlx5.so
/usr/local/lib/x86_64-linux-gnu/dpdk/pmds-21.0/librte_net_mlx5.so.21.0
/usr/local/lib/x86_64-linux-gnu/dpdk/pmds-21.0/librte_net_mlx5.so.21
/usr/local/lib/x86_64-linux-gnu/dpdk/pmds-21.0/librte_net_mlx5.so
/usr/local/lib/x86_64-linux-gnu/librte_net_mlx5.a
/home/dpdk-20.11/build/drivers/librte_net_mlx5.so.21.0
/home/dpdk-20.11/build/drivers/librte_net_mlx5.so.21
/home/dpdk-20.11/build/drivers/librte_net_mlx5.so
/home/dpdk-20.11/build/drivers/librte_net_mlx5.a.p
/home/dpdk-20.11/build/drivers/librte_net_mlx5.so.21.0.p
/home/dpdk-20.11/build/drivers/librte_net_mlx5.a

我尝试将 -d librte_net_mlx5.so 添加为 @Vipin Varghese 的建议,并得到以下输出:

$sudo ./Builddir/app/pktgen -c 0xff -n 3 -a 0000:03:00.1 -d librte_net_mlx5.so -- -p 0x1 -P -m "[1:2].0"

EAL: Detected 24 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:03:00.1 (socket 0)
mlx5_pci: Size 0xFFFF is not power of 2,will be aligned to 0x10000.
EAL: No legacy callbacks,Intel Corporation. All rights reserved.
*** Pktgen  created by: Keith Wiles -- >>> Powered by DPDK <<<

 Port: Name         IfIndex Alias        NUMA  PCI
    0: mlx5_pci       11                   0   15b3:1017/03:00.1

Initialize Port 0 -- TxQ 1,RxQ 1
MBUF: error setting mempool handler
!PANIC!: Cannot create mbuf pool (Default RX  0:0) port 0,queue 0,nb_mbufs 4096,socket_id 0: Invalid argument
PANIC in pktgen_mbuf_pool_create():
Cannot create mbuf pool (Default RX  0:0) port 0,socket_id 0: Invalid argument
6: [./Builddir/app/pktgen(+0x977a) [0x55fd3145f77a]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f5479069bf7]]
4: [./Builddir/app/pktgen(+0x9319) [0x55fd3145f319]]
3: [./Builddir/app/pktgen(+0x3198b) [0x55fd3148798b]]
2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.21(__rte_panic+0xc5) [0x7f547a063285]]
1: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.21(rte_dump_stack+0x2e) [0x7f547a084f2e]]
Aborted

解决方法

很明显 pktgen 实用程序是

  1. 不是基于日志使用 Mellanox PMD mlx5 构建的
  2. 或 pktgen 未通过共享库来初始化 MLX5 PMD

由于用于构建的 DPDK 是 DPDK 版本 20.11。 pktgen 用共享库构建的概率很高。将 eal 参数作为 -d librte_net_mlx5.so 传递应该可以解决共享库问题。

不建议静态库路径的原因是 testpmd 的日志显示 MLX5 被识别,而 eth0 和 eth1 是不存在的接口并跳过 PCAP PMD

EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:03:00.0 (socket 0)
mlx5_pci: Size 0xFFFF is not power of 2,will be aligned to 0x10000.
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:03:00.1 (socket 0)
mlx5_pci: Size 0xFFFF is not power of 2,will be aligned to 0x10000.

[EDIT-1] 也要求在评论中提供正确的详细信息,但没有。

[EDIT-2] 在控制台检查中检查 PKTGEN 21.01 是否使用 MXL5 PMD 构建

  1. pkg-config --cflags --libs --static libdpdk | grep -i mlx5
  2. nm [pktgen-application] | grep -i mlx5

。根据更新的日志,pktgen 不是使用放置在 /usr/local/lib/x86_64-linux-gnu

中的 DPDK 构建的

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-