在使用DPDK时,我试图调试一个与丢包相关的问题。在不使用DPDK的情况下使用应用程序时,不会出现问题。
解释一下:我有一个进程A,它接收来自进程B的数据包(来自不同的服务器)。
初始问题:当在进程A中启用DPDK时,在最初的几秒钟内,数据包流很好,但是在几分钟后,进程A停止接收任何数据包。,这可能是什么原因?我已经确认数据包是由进程B发送的。
要调试这一点:我已经在我的应用程序中启用了pdump特性,这样我就可以使用dpdk来捕获数据包。在调试过程中,当我使用dpdk proc-info进行检查时,服务器正在接收数据包。
[root@QVr740-6 app]# ./dpdk-proc-info -- --stats -p 0x1
EAL: Cannot find resource for device
EAL: No legacy callbacks, legacy socket not created
######################## NIC statistics for port 0 ########################
**RX-packets: 11595973** RX-errors: 0 RX-bytes: 17231595358
RX-nombuf: 0
TX-packets: 0 TX-errors: 0 TX-bytes: 22
############################################################################但是,当我尝试获取数据包捕获时:
[root@QVr740-6 app]# ./dpdk-pdump -l 42,44,46 -- --pdump 'device_id=0000:18:00.1,queue=*,rx-dev=/home/cu1/nmurshed/capture.pcap'
EAL: Detected 56 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket_69588_2a3baabe32a56
EAL: Selected IOVA mode 'PA'
EAL: Probing VFIO support...
EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:18:00.1 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:18:00.2 (socket 0)
EAL: Cannot find resource for device
EAL: No legacy callbacks, legacy socket not created
Port 2 MAC: 02 70 63 61 70 01
core (42), capture for (1) tuples
- port 0 device (0000:18:00.1) queue 65535
^C
Signal 2 received, preparing to exit...
##### PDUMP DEBUG STATS #####
-packets dequeued: 0
-packets transmitted to vdev: 0
-packets freed: 0如何找出这些数据包的丢弃位置?我确实证实了dpdk在问题未被发现时起作用。
任何提示都将是有价值的,因为我一直在撕扯我的头发。
编辑:
我在统计中漏掉了一些东西。我看到,当问题发生时,Rx漏掉的错误继续以惊人的速度增长。
Wed Oct 20 18:47:46 PDT 2021
rx_missed_errors: 0
Wed Oct 20 18:47:47 PDT 2021
rx_missed_errors: 0
Wed Oct 20 18:47:48 PDT 2021
rx_missed_errors: 0
Wed Oct 20 18:47:49 PDT 2021
rx_missed_errors: 8216
Wed Oct 20 18:47:50 PDT 2021
rx_missed_errors: 32384
Wed Oct 20 18:47:51 PDT 2021
rx_missed_errors: 56510
Wed Oct 20 18:47:52 PDT 2021
rx_missed_errors: 80636
Wed Oct 20 18:47:53 PDT 2021
rx_missed_errors: 104762
Wed Oct 20 18:47:54 PDT 2021
rx_missed_errors: 128882
Wed Oct 20 18:47:55 PDT 2021
rx_missed_errors: 152960
Wed Oct 20 18:47:56 PDT 2021
rx_missed_errors: 177086
Wed Oct 20 18:47:57 PDT 2021```
I increased the rx/tx desc in rte_eth_rx_queue_setup which delays the problem. Somehow, my application is not freeing the rx_desc.
Question.. is each packet received == 1 rx_desc?
Is it possible that my application takes too long time to process packet ? or is it like I am not freeing them ?发布于 2021-10-23 02:52:04
DPDK计数器rx_missed_errors推断出在网卡上接收到的许多数据包没有被处理。而Rx-no-mbuf则表示由于缺少MBUF缓冲区而不是DMA到CPU内存的数据包的计数器。因此,错误主要发生在应用程序逻辑中,无论是Spending too much time processing the packets还是recursive processing on the same MBUF array after rx_burst。
基于几次调试尝试和指针,这个问题是导致应用程序逻辑的根本原因。总结以下内容
rte_Eth_tx_burst后立即调用的MBUF和rte_pktmbuf_free上发送ARP应答--为IP数据包发出固定的注意:
https://stackoverflow.com/questions/69624862
复制相似问题