Re: [PATCH net-next 2/3] page_pool: Turn dma_sync and dma_sync_cpu fields into a bitmap

From
Toke Høiland-Jørgensen <hidden>
Date
2025-03-17 14:55:29
Also in
bpf, linux-mm, linux-rdma
Reply to
Yunsheng Lin, 2025-03-15
Yunsheng Lin [off-list ref] writes:
On 3/14/2025 6:10 PM, Toke Høiland-Jørgensen wrote:
quoted
Change the single-bit booleans for dma_sync into an unsigned long with
BIT() definitions so that a subsequent patch can write them both with a
singe WRITE_ONCE() on teardown. Also move the check for the sync_cpu
side into __page_pool_dma_sync_for_cpu() so it can be disabled for
non-netmem providers as well.
I guess this patch is for the preparation of disabling the
page_pool_dma_sync_for_cpu() related API on teardown?

It seems unnecessary that page_pool_dma_sync_for_cpu() related API need
to be disabled on teardown as page_pool_dma_sync_for_cpu() has the same
calling assumption as the alloc API, which is not supposed to be called
by the drivers when page_pool_destroy() is called.
Sure, we could keep it to the dma_sync_for_dev() direction only, but
making both directions use the same variable to store the state, and
just resetting it at once, seemed simpler and more consistent.

-Toke
Thread (19 messages) 19 messages, 6 authors, last reply 2025-03-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help