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 内核。
2.6.2. VM Too Slow to Drain vhost-user
此示例与 图 2.1 中的示例类似,如果 lcore 线程超过发送到实例接收(RX)队列的数据包卷,则可能会遇到数据包丢失。
如需更多信息,请参阅以下文章:
图 2.2. 轮询虚拟适配器 RX 队列
					要检查主机的 tx_dropped 值是否与虚拟机的 rx_dropped 值对应,请运行以下命令:
				
ovs-vsctl --column statistics list interface vhud8ada965-ce
statistics          : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0,
"rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0, rx_bytes=0,
rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}
ovs-vsctl --column statistics list interface vhud8ada965-ce
statistics          : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0,
"rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0, rx_bytes=0,
rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}2.6.3. OVS-DPDK Too Slow to Drain vhost-user
在本例中,MonyD 线程是从主机角度轮询 virtio TX 的接收队列。如果 PMD 线程被数据包卷超过,或者中断,数据包可能会丢弃。
图 2.3. 轮询虚拟适配器 TX 队列
					跟踪来自虚拟机的数据包的返回路径,并提供主机上的丢弃计数器(tx_dropped)和 VM(rx_dropped)端值,运行以下命令:
				
ovs-vsctl --column statistics list interface vhue5146cdf-aa
statistics          : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0,
"rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0,
rx_bytes=0, rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}
ovs-vsctl --column statistics list interface vhue5146cdf-aa
statistics          : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0,
"rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0,
rx_bytes=0, rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}2.6.4. Egress 物理接口上的数据包丢失
PCIe 和 RAM 之间的慢速传输速率可能会导致物理适配器从 TX 队列丢弃数据包。虽然这不经常存在,但是了解如何识别和解决这个问题非常重要。
图 2.4. 轮询物理适配器 TX 队列
					以下命令显示 dpdk1 界面中的统计信息。如果 tx_dropped 大于零且快速增长,则创建一个红帽支持问题单。
				
如果您看到这些类型的数据包丢失,请考虑重新配置内存频道。
- 要计算内存频道,请参阅: 网络功能虚拟化规划和聚合指南 中的内存参数。https://access.redhat.com/documentation/zh-cn/red_hat_openstack_platform/{vernum}/html-single/network_functions_virtualization_planning_and_configuration_guide/index#c_ovsdpdk-memory-params
- 要确定内存频道的数量,请参阅: 如何确定 Red Hat OpenStack Platform 中的 NeutronDpdkMemoryChannels 或 OvsDpdkMemoryChannels 的内存频道数。
 
     
     
    