Thread (27 messages) 27 messages, 4 authors, 2025-12-31

Re: [PATCH net 1/3] virtio-net: make refill work a per receive queue work

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2025-12-25 16:27:51
Also in: bpf, lkml, virtualization

On Thu, Dec 25, 2025 at 03:33:29PM +0800, Jason Wang wrote:
On Wed, Dec 24, 2025 at 9:48 AM Michael S. Tsirkin [off-list ref] wrote:
quoted
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.
Btw, I see some drivers are doing things as Xuan said. E.g
mlx5e_napi_poll() did:

busy |= INDIRECT_CALL_2(rq->post_wqes,
                                mlx5e_post_rx_mpwqes,
                                mlx5e_post_rx_wqes,

...

if (busy) {
         if (likely(mlx5e_channel_no_affinity_change(c))) {
                work_done = budget;
                goto out;
...

is busy a GFP_ATOMIC allocation failure?
quoted
Not saying refill work is a great hack, but that is the reason for it.
--
MST
Thanks
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help