2.6. Packet Drops 原因
当队列已满时,数据包会被丢弃,通常是当队列没有足够快时,数据包被丢弃。瓶颈是当队列没有足够快排空时,应该排空队列的实体。在大多数情况下,使用 drop 计数器来跟踪丢弃的数据包。有时,硬件或软件设计中的一个错误可能会导致数据包跳过丢弃计数器。
Data Plan Development Kit(DPDK)包括用于转发数据包的 testpmd 应用。在本章中显示的情况下,testpmd 安装在虚拟机上,并轮询带有分配的逻辑内核(lcore)的端口,以将数据包从一个端口转发到另一个端口。testpmd 常与流量生成器一起使用,在本例中为物理虚拟物理(PVP)路径中的吞吐量。
2.6.1. OVS-DPDK Too Slow to Drain physical NIC 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
本例显示 PMD 线程负责轮询物理网络适配器(dpdk0)的接收(RX)队列。当 PMD 线程无法跟上数据包卷或中断时,数据包可能会被丢弃。
图 2.1. 轮询物理适配器 RX 队列
以下命令显示 dpdk0 界面中的统计信息。如果数据包被丢弃,因为 ovs-dpdk 没有快排空物理适配器,您会看到 rx_dropped 的速度会快速增长。
注意
PMD 应该为每个 NUMA 节点有一个以上物理 CPU 内核。
# ovs-vsctl --column statistics list interface dpdk0
statistics : {mac_local_errors=0, mac_remote_errors=0, "rx_1024_to_1522_packets"=26, "rx_128_to_255_packets"=243,
"rx_1523_to_max_packets"=0, "rx_1_to_64_packets"=102602, "rx_256_to_511_packets"=6100, "rx_512_to_1023_packets"=27,
"rx_65_to_127_packets"=16488, rx_broadcast_packets=2751, rx_bytes=7718218, rx_crc_errors=0, rx_dropped=0, rx_errors=0,
rx_fragmented_errors=0, rx_illegal_byte_errors=0, rx_jabber_errors=0, rx_length_errors=0, rx_mac_short_dropped=0,
rx_mbuf_allocation_errors=0, rx_oversize_errors=0, rx_packets=125486, rx_undersized_errors=0, "tx_1024_to_1522_packets"=63,
"tx_128_to_255_packets"=319, "tx_1523_to_max_packets"=0, "tx_1_to_64_packets"=1053, "tx_256_to_511_packets"=50,
"tx_512_to_1023_packets"=68, "tx_65_to_127_packets"=7732, tx_broadcast_packets=12, tx_bytes=466813, tx_dropped=0,
tx_errors=0, tx_link_down_dropped=0, tx_multicast_packets=5642, tx_packets=9285}