[root@localhost ixgbe]# cpupower frequency-info analyzing CPU 0: driver: cppc_cpufreq CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 CPUs which need to have their frequency coordinated by software: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 maximum transition latency: 40.0 us hardware limits: 200 MHz - 2.60 GHz available cpufreq governors: conservative ondemand userspace powersave performance current policy: frequency should be within 1000 MHz and 2.60 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 2.60 GHz (asserted by call to kernel) [root@localhost ixgbe]#
[root@localhost ixgbe]# lspci -s 05:00.0 -vv | grep Lnk LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- CommClk- LnkSta: Speed 8GT/s, Width x16, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt- LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis- LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete+, EqualizationPhase1+ [root@localhost ixgbe]#
1. PCIe是否存在瓶颈?
因为报文从网卡到系统是经过PCIe总线来传输的,PCIe总线的吞吐将直接影响数据包从网卡拷贝到内存的速率。通过lspci -s 03:00.1 -vv | grep Lnk
可以查看当前网卡的PCIe速率,其中03:00.1是网卡的PCIe地址,可通过lspci -v|grep Ethernet
查到。
由上图可以看到网口能力是传输速率5GT/s,总线宽带x8(LnkCap),实际使用的是传输速率5GT/s,总线宽带x8(LnkSta),工作正常。如果传输速率和总线带宽下降,则需要调试PCIe兼容性问题。一般是服务器与网卡兼容性问题,可以更换网卡或者更换服务器。如果有条件,可以找服务器厂商从bios等方面进行详细定位解决兼容性问题。
2. rte_rx_queue中的数据包没有及时消费掉?
-
检查CPU运行模式,
cpupower frequency-info
如果当前运行在powersave模式下,可以将其修改为performance,提升CPU频率,cpupower frequency-set -g performance
。