Re: [PATCH net 1/3] virtio-net: make refill work a per receive queue work
From: Bui Quang Minh <hidden>
Date: 2025-12-24 16:50:07
Also in:
bpf, lkml, virtualization
From: Bui Quang Minh <hidden>
Date: 2025-12-24 16:50:07
Also in:
bpf, lkml, virtualization
On 12/24/25 08:47, Michael S. Tsirkin wrote:
On Wed, Dec 24, 2025 at 09:37:14AM +0800, Xuan Zhuo wrote:quoted
Hi Jason, I'm wondering why we even need this refill work. Why not simply let NAPI retry the refill on its next run if the refill fails? That would seem much simpler. This refill work complicates maintenance and often introduces a lot of concurrency issues and races. Thanks.refill work can refill from GFP_KERNEL, napi only from ATOMIC. And if GFP_ATOMIC failed, aggressively retrying might not be a great idea. Not saying refill work is a great hack, but that is the reason for it.
In case no allocated received buffer and NAPI refill fails, the host will not send any packets. If there is no busy polling loop either, the RX will be stuck. That's also the reason why we need refill work. Is it correct? Thanks, Quang Minh.