]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netdevsim: access ->pp through netmem_desc instead of page
authorByungchul Park <byungchul@sk.com>
Mon, 21 Jul 2025 02:18:27 +0000 (11:18 +0900)
committerJakub Kicinski <kuba@kernel.org>
Thu, 24 Jul 2025 00:46:54 +0000 (17:46 -0700)
To eliminate the use of struct page in page pool, the page pool users
should use netmem descriptor and APIs instead.

Make netdevsim access ->pp through netmem_desc instead of page.

Signed-off-by: Byungchul Park <byungchul@sk.com>
Link: https://patch.msgid.link/20250721021835.63939-5-byungchul@sk.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/netdev.c

index a7628f5c09af71534ed210defab41b68d808d83b..39fe28af48b94aa9ea985f8e693e993c4fba997b 100644 (file)
@@ -917,7 +917,8 @@ nsim_pp_hold_write(struct file *file, const char __user *data,
                if (!ns->page)
                        ret = -ENOMEM;
        } else {
-               page_pool_put_full_page(ns->page->pp, ns->page, false);
+               page_pool_put_full_page(pp_page_to_nmdesc(ns->page)->pp,
+                                       ns->page, false);
                ns->page = NULL;
        }
 
@@ -1145,7 +1146,8 @@ void nsim_destroy(struct netdevsim *ns)
 
        /* Put this intentionally late to exercise the orphaning path */
        if (ns->page) {
-               page_pool_put_full_page(ns->page->pp, ns->page, false);
+               page_pool_put_full_page(pp_page_to_nmdesc(ns->page)->pp,
+                                       ns->page, false);
                ns->page = NULL;
        }