Re: [net-next PATCH v6 1/6] octeontx2-pf: use xdp_return_frame() to free xdp buffers
From: Yunsheng Lin
Date: Thu Feb 27 2025 - 21:23:55 EST
On 2025/2/13 13:31, Suman Ghosh wrote:
> - put_page(page);
> cq->pool_ptrs++;
> + if (page->pp) {
It seems the above changing caused the below error for the DMA API misuse
patchset:
https://lore.kernel.org/oe-kbuild-all/202502280250.Bp3jD6ZE-lkp@xxxxxxxxx/
And it seems this patch uses 'page->pp' being NULL or not to decide if a
page is page_pool owned or not, I am not sure if the buddy page allocator
will always ensure that memory that 'page->pp' points to will always be
zero, even if it is for now, It seems the driver should not use that to
decide if a page is page_pool owned or not.
The PP_SIGNATURE magic macro seems to be correct way to decide if the page
is page_pool owned or not when driver doesn't have its own way to decide
if a page is page_pool owned or not, see:
https://elixir.bootlin.com/linux/v6.14-rc1/source/net/core/skbuff.c#L924
> + page_pool_recycle_direct(pool->page_pool, page);
> + } else {
> + otx2_dma_unmap_page(pfvf, iova, pfvf->rbsize,
> + DMA_FROM_DEVICE);
> + put_page(page);
> + }
> return true;
> }
> return false;