netdevsim: access ->pp through netmem_desc instead of page

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>
This commit is contained in:
Byungchul Park
2025-07-21 11:18:27 +09:00
committed by Jakub Kicinski
parent 89ade7c730
commit 6fd824342a

View 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;
}