Re: [PATCH net-next v1 06/11] page_pool: Coordinate refill with memory providers
From: Björn Töpel
Date: Wed Nov 11 2026 - 14:43:33 EST
Stanislav Fomichev <sdf.kernel@xxxxxxxxx> writes:
> On 11/10, Björn Töpel wrote:
>> diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h
>> index 989120cbf452..ca12cbf7b825 100644
>> --- a/include/net/netdev_rx_queue.h
>> +++ b/include/net/netdev_rx_queue.h
>> @@ -33,6 +33,12 @@ struct netdev_rx_queue {
>> struct pp_memory_provider_params mp_params;
>> /* stamps the page pools of each queue allocation */
>> u32 mp_gen;
>> + /* NAPI of the running queue, for memory provider wakeups. Set while
>> + * mp_armed, and if the provider has a refill_done op. Written under
>> + * the ops lock, read under RCU, see netif_mp_wake().
>> + */
>> + struct napi_struct __rcu *mp_napi;
>> + bool mp_armed;
>
> The comment should explain why mp_napi != napi? (I do not understand why)
Fair. It's the same NAPI, with other rules. napi is the driver's
association: read under the ops lock, and not cleared when the NAPI is
deleted. Provider wakeups run without that lock, from socket syscalls
and ->release_netmem().
mp_napi is an RCU copy, set only while the device is up and the queue
isn't restarting, for providers with ->refill_done(). netif_napi_del()
clears it before its grace period. Setting it also schedules the NAPI
once, which replays wakeups lost while the queue was stopped. I'll put
that in the comment.
Björn