Subject: Re: [PATCH net-next v3 4/6] enic: Use the Page Pool API for RX when MTU is less than page size

From: Jakub Kicinski <[email-masked]>
Date: Tue, 31 Dec 2024 16:42:00 -0800

On Tue, 31 Dec 2024 19:37:12 +0800 Yunsheng Lin wrote:
> >> It seems the above has a similar problem of not using
> >> page_pool_put_full_page() when page_pool_dev_alloc() API is used and
> >> page_pool is created with PP_FLAG_DMA_SYNC_DEV flags.
> >>
> >> It seems like a common mistake that a WARN_ON might be needed to catch
> >> this kind of problem.  
> > 
> > Agreed. Maybe also add an alias to page_pool_put_full_page() called
> > something like page_pool_dev_put_page() to correspond to the alloc
> > call? I suspect people don't understand the internals and "releasing
> > full page" feels wrong when they only allocated a portion..  
> 
> Yes, I guess so too.
> But as all the alloc APIs have the 'dev' version of API:
> page_pool_dev_alloc
> page_pool_dev_alloc_frag
> page_pool_dev_alloc_pages
> page_pool_dev_alloc_va
> 
> Only adding 'dev' does not seem to clear the confusion from API naming
> perspective.

page_pool_free_page()? We already have page_pool_free_va()