DPDK - 中断而不是轮询

DPDK - interrupts rather than polling

是否可以配置 DPDK,以便 NIC 在收到数据包时发送中断(而不是关闭中断并在 RX 队列上进行核心轮询)?我知道这似乎违反直觉,但我想到了一个可以从中受益的用例。

DPDK 声称允许您对 RX 队列使用中断(您可以调用 rte_eth_dev_rx_intr_enable 并传递一个 port/queue 对作为参数),但在深入研究代码后,似乎这是误导。有一个轮询线程调用 epoll_wait,并在收到数据包后调用 eal_intr_process_interrupts。然后这个函数遍历回调函数列表(应该是中断处理程序)并执行每个回调函数。然后该函数再次调用 epoll_wait(即处于无限循环中)。

我对 DPDK 如何处理 "interrupts" 的理解是否正确?也就是说,即使你开启"interrupts",DPDK真的只是在后台轮询然后执行回调函数(所以没有中断)?

Is my understanding of how DPDK handles "interrupts" correct?

DPDK 是一个用户 space 应用程序。不幸的是,没有神奇的方法可以直接向用户 space 应用程序接收中断回调。

所以 NIC 中断以任何方式在内核中得到服务,然后内核使用 eventfd 通知用户 space。用户 space 线程使用 epoll_wait.

等待 eventfd 通知

In other words, even if you turn "interrupts" on, DPDK is really just polling in the background and then executing callback functions (so there are no interrupts)?

如果没有数据接收,DPDK轮询线程应该阻塞在epoll_wait