在 Linux x86_64 内核 3.16 上处理网络数据包时,可以在不同的 CPU 内核上执行相同网络数据包的硬和软 IRQ 吗?
Soft IRQs may run directly after the hard IRQ that raises them, or at a later time in ksoftirqd.
In case of multi queues (RSS), hardware interrupt will go to matching CPU processor, and that processor will also be responsible for softIRQ processing.
In case of monoqueues, the hardware interrupt generated is from single queue and same CPU is also responisble for processing softIRQ. If RPS is enabled on mono queue, the incoming packets are hashed, load is distributed across multiple CPU processors.
As a downside, RPS increases the rate of inter-processor interrupts (IPIs).
是否意味着:
read(,buf,)
在 上将数据从套接字缓冲区 (mbuf) 获取到用户空间中的缓冲区CPU Core-K 那是对的吗?
使用 RPS 时,可以在不同的内核上执行相同网络数据包的硬和软 IRQ 吗?
最佳答案
我试着解释我的理解,但是,可能不正确。请帮助纠正我的答案。
首先,RPS 和 RSS 的工作原理是一样的,即通过哈希将 irq/packet 映射到特定的 CPU 内核,例如 4 元组、V(X)LAN 标签等。不同之处在于 RPS 是在软件上实现的,而RSS 是在硬件上实现的,即网卡。
所以这个博客( http://balodeamit.blogspot.ru/2013/10/receive-side-scaling-and-receive-packet.html )中的 claim 可能是与自身的契约。
其次,RFS 和 aRFS 也执行 CPU 控制。它们将 irq/packet 映射到与上层应用程序相同的核心以实现亲和性,例如,由相同的 NUMA 节点处理。 aRFS 是 RFS 的硬件版本。你可以引用这篇论文( https://dl.acm.org/doi/abs/10.1145/3452296.3472888 )了解更多细节。
最后,硬和软 irq 可以映射到相同的 CPU 内核,但是具有不同的控制机制,例如 RPS/RSS 和 RFS/aRFS。
关于linux - 可以在不同的 CPU 内核上执行相同网络数据包的硬和软 IRQ 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45066524/