Thread (9 messages) 9 messages, 4 authors, 2021-07-15

Re: [PATCH rfc v5 2/4] page_pool: add interface to manipulate frag count in page pool

flat view

From: Alexander Duyck <hidden>
Date: 2021-07-14 14:46:35
Also in: bpf, lkml

On Wed, Jul 14, 2021 at 3:18 AM Jesper Dangaard Brouer
[off-list ref] wrote:


On 14/07/2021 11.34, Yunsheng Lin wrote:
quoted
As suggested by Alexander, "A DMA mapping should be page
aligned anyway so the lower 12 bits would be reserved 0",
so it might make more sense to repurpose the lower 12 bits
of the dma address to store the frag count for frag page
support in page pool for 32 bit systems with 64 bit dma,
which should be rare those days.
Do we have any real driver users with 32-bit arch and 64-bit DMA, that
want to use this new frag-count system you are adding to page_pool?

This "lower 12-bit use" complicates the code we need to maintain
forever. My guess is that it is never used, but we need to update and
maintain it, and it will never be tested.

Why don't you simply reject using page_pool flag PP_FLAG_PAGE_FRAG
during setup of the page_pool for this case?

  if ((pool->p.flags & PP_FLAG_PAGE_FRAG) &&
      (sizeof(dma_addr_t) > sizeof(unsigned long)))
    goto reject-setup;
That sounds good to me if we want to go that route. It would simplify
this quite a bit since essentially we could just drop these if blocks.

Thanks.

- Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help