Commit 6fd82434 authored by Byungchul Park's avatar Byungchul Park Committed by Jakub Kicinski
Browse files

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: default avatarByungchul Park <byungchul@sk.com>
Link: https://patch.msgid.link/20250721021835.63939-5-byungchul@sk.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 89ade7c7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
	}