mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-25 19:42:19 +00:00
net: page_pool: avoid false positive warning if NAPI was never added
We expect NAPI to be in disabled state when page pool is torn down. But it is also legal if the NAPI is completely uninitialized. Reviewed-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20250206225638.1387810-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -299,6 +299,18 @@ void xdp_do_check_flushed(struct napi_struct *napi);
|
||||
static inline void xdp_do_check_flushed(struct napi_struct *napi) { }
|
||||
#endif
|
||||
|
||||
/* Best effort check that NAPI is not idle (can't be scheduled to run) */
|
||||
static inline void napi_assert_will_not_race(const struct napi_struct *napi)
|
||||
{
|
||||
/* uninitialized instance, can't race */
|
||||
if (!napi->poll_list.next)
|
||||
return;
|
||||
|
||||
/* SCHED bit is set on disabled instances */
|
||||
WARN_ON(!test_bit(NAPI_STATE_SCHED, &napi->state));
|
||||
WARN_ON(READ_ONCE(napi->list_owner) != -1);
|
||||
}
|
||||
|
||||
void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu);
|
||||
|
||||
#define XMIT_RECURSION_LIMIT 8
|
||||
|
||||
Reference in New Issue
Block a user