summaryrefslogtreecommitdiffstats
path: root/net/core/page_pool_user.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-11-27 00:07:31 +0100
committerPaolo Abeni <pabeni@redhat.com>2023-11-28 15:48:39 +0100
commit02b3de80c5f879f92e5f4bb3f535d172e0fc0ea0 (patch)
treedb3a33025453778ddac1a6c5e2e93214c8db180e /net/core/page_pool_user.c
parentnet: page_pool: record pools per netdev (diff)
downloadlinux-02b3de80c5f879f92e5f4bb3f535d172e0fc0ea0.tar.xz
linux-02b3de80c5f879f92e5f4bb3f535d172e0fc0ea0.zip
net: page_pool: stash the NAPI ID for easier access
To avoid any issues with race conditions on accessing napi and having to think about the lifetime of NAPI objects in netlink GET - stash the napi_id to which page pool was linked at creation time. Reviewed-by: Eric Dumazet <edumazet@google.com> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/page_pool_user.c')
-rw-r--r--net/core/page_pool_user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
index e5c7f078fbd4..2888aa8dd3e4 100644
--- a/net/core/page_pool_user.c
+++ b/net/core/page_pool_user.c
@@ -37,9 +37,11 @@ int page_pool_list(struct page_pool *pool)
if (err < 0)
goto err_unlock;
- if (pool->slow.netdev)
+ if (pool->slow.netdev) {
hlist_add_head(&pool->user.list,
&pool->slow.netdev->page_pools);
+ pool->user.napi_id = pool->p.napi ? pool->p.napi->napi_id : 0;
+ }
mutex_unlock(&page_pools_lock);
return 0;