我准备好了dpdk兼容的环境,然后我尝试使用dpdk-testpmd发送数据包,并希望看到它在另一台服务器上被接收。我在no-IOMMU(不安全)模式下使用vio -pci驱动程序。我跑
$./dpdk-testpmd -l 11-15 -- -i
的输出类似于
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: VFIO support initialized
EAL: Using IOMMU type 8 (No-IOMMU)
EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:01:00.1 (socket 0)
TELEMETRY: No legacy callbacks, legacy socket not created
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_1>: n=179456, size=2176, socket=1
testpmd: preferred mempool ops selected: ring_mp_mc
testpmd: create a new mbuf pool <mb_pool_0>: n=179456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.
Configuring Port 0 (socket 0)
Port 0: E4:43:4B:4E:82:00
Checking link statuses...
Done
然后
$set nbcore 4
Number of forwarding cores set to 4
testpmd> show config fwd
txonly packet forwarding - ports=1 - cores=1 - streams=1 - NUMA support enabled, MP allocation mode: native
Logical Core 12 (socket 0) forwards packets on 1 streams:
RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=BE:A6:27:C7:09:B4
我的nbcore没有被正确设置,甚至在我设置eth-peer地址之前没有设置'txonly'模式。但一些参数正在发挥作用。此外,如果我不改变突发延迟,我的服务器就会崩溃,只要我开始传输,它有10G以太网端口(80MBps可用带宽计算)。因此,通过在相应的接收接口执行tcpdump,我在接收服务器上看不到数据包。这里发生了什么,我做错了什么?
基于问题&在评论中回答,真正的意图是send packets from DPDK testpmd using Intel Fortville (net_i40e) to the remote server
。没有生成流量的真正问题既不是应用程序命令行,也不是通过dpdk-testpmd设置交互选项来创建数据包。
- start tx_first:这将发送一个默认的32数据包,一旦端口启动。
- forward mode tx-only:将dpdk-testpmd下的端口设置为仅传输模式。一旦端口启动,它将以默认数据包大小传输数据包。
这两个选项都没有使用,因此我的建议是
- 请浏览关于testpmd及其配置的DPDK文档
- 根据DPDK Testpmd命令行选项 使用
- 在交互模式下使用
start txfirst
或set fwd txonly or set fwd flwogen
参考Testpmd运行时函数 带有此流量的
--tx-first
或--forward-mode=txonly
将从testpmd生成并发送到设备(远程服务器)。一个简单的例子是">dpdk-testpmd——file-prefix=test1 -a81:00.0 -l 7,8——socket-mem=1024 -- --burst=128——txd=8192——rxd=8192——mbcache=512——rxq=1——txq=1——nb-cores=2 -a——forward-mode=io——rss-udp——enable-rx-cksum——no-mlockall——no-lsc-interrupt——enable-drop-en——no-rmv-interrupt -i">
从上面的示例配置参数
- rx-tx突发的数据包数由
--burst=128
设置 - rx-tx队列数由
--rxq=1 --txq=1
配置 - rx-tx使用的内核数由
--nb-cores=2
设置 - 设置flowgen, txonly, rxonly或io模式,使用
--forward-mode=io
因此在注释中提到了neither set nbcore 4 or there are any configurations in testpmd args or interactive which shows the application is set for TX only
。
查询的第二部分确实令人困惑,因为正如它所说的
此外,如果我不改变突发延迟,我的服务器会崩溃一旦我开始传输通过它有10G以太网端口(80MBps可用带宽计算)。因此,我没有看到数据包通过在相应的接收端跟踪tcpdump接收服务器接口。这里发生了什么,我做错了什么?
假设my server
是由dpdk testpmd发送数据包的远程服务器。因为有提到I see packets with tcpdump
(因为Intel fortville X710绑定UIO驱动程序时将删除内核netlink接口)。
它提到80MBps,这是0.08Gbps左右,真的很奇怪。如果将远端接口设置为混杂模式,并且有AF_XDP应用程序或原始套接字应用程序配置为以线速率(10Gbps)接收流量,则可以工作。由于没有远程服务器的日志或崩溃转储,并且极不可能从testpmd生成实际流量,因此这看起来更像是远程服务器中的配置或设置问题。
[EDIT-1]根据现场调试,确认
- DPDK未安装-使用
ninja isntall
修复 - DPDK网卡端口
eno2
-没有直接连接到远程服务器 - dpdk网卡端口
eno2
已通过交换机 连接 - DPDk应用程序testpmd没有崩溃-确认
pgrep testpmd
- 当与
set fwd txonly
一起使用时,数据包会淹没交换机,而来自其他端口的SSH数据包会被丢弃。
解决方案:请使用另一个交换机进行数据路径测试,或者使用直接连接到远程服务器。