【问题标题】:Testing XDP vs DPDK测试 XDP 与 DPDK
【发布时间】:2020-08-23 06:29:50
【问题描述】:
我确实有一些使用 DPDK 的经验,但目前我正在阅读许多关于 XDP 的博客。我正在尝试比较这两种技术并了解 DPDK 和 XDP 之间的区别。这提出了一些问题。我希望有人可以帮助我解决以下问题:
- 使用 DPDK,我可以将 worker 映射到 CPU 内核并隔离 DPDK 将使用的 CPU 内核。在 eBPF / XDP 的情况下,使用哪些 CPU 内核?是否使用了所有可用的 CPU 内核?是否可以隔离用于 eBPF / XDP 程序的 CPU 内核?
- 当我测试 DPDK 应用程序的吞吐量时,我能够检查环形缓冲区(内存池)是否已满,因此数据包会丢失。但是如何检查 eBPF / XDP 程序是否因为吞吐量太高而导致丢包呢?我假设当 eBPF / XDP 程序花费太多时间来处理数据包时,最终您会看到数据包丢失吗? (尤其是在高速率发送64B数据包时,寻找可以发送的最大数据包数)
提前感谢您的帮助!
【问题讨论】:
标签:
cpu
dpdk
ebpf
xdp-bpf
【解决方案1】:
With DPDK I can map workers to CPU cores and isolate CPU cores which will be used by DPDK. In case of eBPF / XDP, which CPU cores are used?
答:与 DPDK 用户空间不同,带有 eBPF 的 XDP 在内核空间中运行。
Are all available CPU cores used?
答:是的,但通常 irqbalance 或中断 pinning 会将端口的 RX 队列放在特定的内核上。
Would it be possible to isolate CPU cores meant for eBPF / XDP programs?
答:您指的是KERNEL_CMD_LINE选项isol,理解有误。如上所述,您可以锁定 RX 队列的中断,强制在该内核上运行 eBPF XDP。
When I test the throughput from a DPDK application, I'm able to check whether ring buffers (mempools) are full so packets will be lost. But how can I check whether an eBPF / XDP program causes packet drops because the throughput is too high?
答:你已经混合使用了 NIC 和 eBPF 计数器来达到同样的效果
I assume when an eBPF / XDP program takes too much time to process a packet, eventually, you will see packet drops? (especially when sending 64B packets on a high rate to find the maximum number of packets that can be send)
答:不必如此,XDP 的最佳性能是零拷贝驱动程序到用户空间。在单独的内核上运行应用程序线程可提供与 DPDK 几乎相当的性能(在 2 * 10Gbps 的情况下测试 - 95% 的 DPDK 性能)。