On Tue, May 27, 2025 at 10:56 PM Byungchul Park <byungchul@xxxxxx> wrote: > > On Tue, May 27, 2025 at 08:21:32PM -0700, Mina Almasry wrote: > > On Tue, May 27, 2025 at 7:29 PM Byungchul Park <byungchul@xxxxxx> wrote: > > > > > > Now that __page_pool_release_page_dma() is for releasing netmem, not > > > struct page, rename it to __page_pool_release_netmem_dma() to reflect > > > what it does. > > > > > > Signed-off-by: Byungchul Park <byungchul@xxxxxx> > > > --- > > > net/core/page_pool.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/net/core/page_pool.c b/net/core/page_pool.c > > > index fb487013ef00..af889671df23 100644 > > > --- a/net/core/page_pool.c > > > +++ b/net/core/page_pool.c > > > @@ -674,8 +674,8 @@ void page_pool_clear_pp_info(netmem_ref netmem) > > > netmem_set_pp(netmem, NULL); > > > } > > > > > > -static __always_inline void __page_pool_release_page_dma(struct page_pool *pool, > > > - netmem_ref netmem) > > > +static __always_inline void __page_pool_release_netmem_dma(struct page_pool *pool, > > > + netmem_ref netmem) > > > { > > > struct page *old, *page = netmem_to_page(netmem); > > > unsigned long id; > > > @@ -722,7 +722,7 @@ static void page_pool_return_netmem(struct page_pool *pool, netmem_ref netmem) > > > if (static_branch_unlikely(&page_pool_mem_providers) && pool->mp_ops) > > > put = pool->mp_ops->release_netmem(pool, netmem); > > > else > > > - __page_pool_release_page_dma(pool, netmem); > > > + __page_pool_release_netmem_dma(pool, netmem); > > > > > > /* This may be the last page returned, releasing the pool, so > > > * it is not safe to reference pool afterwards. > > > @@ -1140,7 +1140,7 @@ static void page_pool_scrub(struct page_pool *pool) > > > } > > > > > > xa_for_each(&pool->dma_mapped, id, ptr) > > > - __page_pool_release_page_dma(pool, page_to_netmem(ptr)); > > > + __page_pool_release_netmem_dma(pool, page_to_netmem((struct page *)ptr)); > > > > I think this needs to remain page_to_netmem(). This static cast should > > Do you mean to ask to revert the casting patch of page_to_netmem()? > > Or leave page_to_netmem(ptr) unchanged? > > I added the casting '(struct page *)ptr' above to avoid compliler > warning.. Do you see another warning on it? > Ah, sorry, I misread this on the first try. I thought you're replaceing page_to_netmem with a static cast but you're not. You're just casting a void * to page*. That should be fine and should indeed remove warning. Reviewed-by: Mina Almasry <almasrymina@xxxxxxxxxx> -- Thanks, Mina