https://cloud.tencent.com/developer/article/1984109?from=article.detail.1998962&areaSource=106000.4&traceId=YD2oWP83NY3oL5ojIBmEE
XDP or eXpress Data Path provides a high performance, programmable network data path in the Linux kernel as part of the IO Visor Project. XDP provides bare metal packet processing at the lowest point in the software stack which makes it ideal for speed without compromising programmability. Furthermore, new functions can be implemented dynamically with the integrated fast path without kernel modification. Other key benefits of XDP includes the following:
XDP 或 eXpress 数据路径在 Linux 内核中提供高性能、可编程的网络数据路径,作为 IO Visor 项目的一部分。XDP 在软件堆栈的最低点提供裸机数据包处理,这使其成为速度的理想选择,而不会影响可编程性。此外,新功能可以通过集成的快速路径动态实现,而无需修改内核。XDP 的其他主要优点包括:
It does not require any specialized hardware 它不需要任何专用硬件
It does not required kernel bypass 它不需要内核绕过
It does not replace the TCP/IP stack 它不会替换 TCP/IP 堆栈
It works in concert with TCP/IP stack along with all the benefits of BPF 它与 TCP/IP 堆栈以及 BPF 的所有优点协同工作
The XDP packet process includes an in kernel component that processes RX packet-pages directly out of driver via a functional interface without early allocation of skbuff’s or software queues. Normally, one CPU is assigned to each RX queue but in this model, there is no locking RX queue, and CPU can be dedicated to busy poll or interrupt model. BPF programs performs processing such as packet parsing, table look ups, creating/managing stateful filters, encap/decap packets, etc.
XDP 数据包进程包括一个内核组件,该组件通过功能接口直接从驱动程序中处理 RX 数据包页,而无需提前分配 skbuff 或软件队列。通常,每个 RX 队列分配一个 CPU,但在此模型中,没有锁定 RX 队列,CPU 可以专用于忙轮询或中断模型。BPF 程序执行数据包解析、表查找、创建/管理有状态筛选器、封装/取消封装数据包等处理。
The extensibility of BPF is kept intact with packet inspection and manipulation functions, flow and table lookups, and application processing leveraging BPF programs which are portable to userspace and other operating systems.
通过数据包检查和操作功能、流和表查找以及利用可移植到用户空间和其他操作系统的 BPF 程序的应用程序处理,BPF 的可扩展性保持不变。
Use cases for XDP include the following:
XDP is sometimes juxtaposed with DPDK when both are perfectly fine approaches. XDP offers another option for users who want performance while still leveraging the programmability of the kernel. Some of the functions that XDP delivers include the following: