Lightweight Tunnels (LWTs) in the Linux kernel enable efficient per-route tunneling and are widely used by protocols such as In Situ Operations, Administration, and Maintenance (IOAM), Segment Routing over IPv6 (SRv6), and Routing Protocol for Low-Power and Lossy Networks (RPL). However, a performance issue was detected in their implementations, where a double-reallocation of socket buffers occurs under specific conditions, leading to significant throughput degradation. This paper investigates the root cause of the issue, which depends on the architecture of the Central Processing Unit (CPU) and the Network Interface Card (NIC). We propose a patch for the Linux kernel to fix this problem, replacing the double-reallocation with a single, efficient one. Performance evaluation demonstrates that the patch eliminates the inefficiency, improving forwarding rates by up to 28.8% for affected protocols.
翻译:Linux内核中的轻量级隧道(LWT)技术实现了高效的单路由隧道封装,被原位操作、管理与维护(IOAM)、基于IPv6的分段路由(SRv6)以及低功耗有损网络路由协议(RPL)等协议广泛采用。然而,在其实现中发现了一个性能问题:在特定条件下会发生套接字缓冲区的双重重分配,导致吞吐量显著下降。本文研究了该问题的根本原因,该原因与中央处理器(CPU)和网络接口卡(NIC)的架构相关。我们为Linux内核提出了一个修复补丁,将双重重分配替换为一次高效的单次重分配。性能评估表明,该补丁消除了效率低下的问题,使受影响协议的转发速率最高提升28.8%。