diff options
| author | Jakub Kicinski <[email protected]> | 2025-02-06 22:56:37 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-02-08 01:21:03 +0000 |
| commit | c1e00bc4be06cacee6307cedb9b55bbaddb5044d (patch) | |
| tree | 728835e1ad8748a10634d8855130d0b4dc7cc3bd /net/core/page_pool.c | |
| parent | net: devmem: don't call queue stop / start when the interface is down (diff) | |
| download | kernel-c1e00bc4be06cacee6307cedb9b55bbaddb5044d.tar.gz kernel-c1e00bc4be06cacee6307cedb9b55bbaddb5044d.zip | |
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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/page_pool.c')
| -rw-r--r-- | net/core/page_pool.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 686bd4a117d9..1c6fec08bc43 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -26,6 +26,7 @@ #include <trace/events/page_pool.h> +#include "dev.h" #include "mp_dmabuf_devmem.h" #include "netmem_priv.h" #include "page_pool_priv.h" @@ -1147,11 +1148,7 @@ void page_pool_disable_direct_recycling(struct page_pool *pool) if (!pool->p.napi) return; - /* To avoid races with recycling and additional barriers make sure - * pool and NAPI are unlinked when NAPI is disabled. - */ - WARN_ON(!test_bit(NAPI_STATE_SCHED, &pool->p.napi->state)); - WARN_ON(READ_ONCE(pool->p.napi->list_owner) != -1); + napi_assert_will_not_race(pool->p.napi); mutex_lock(&page_pools_lock); WRITE_ONCE(pool->p.napi, NULL); |
