Re: [PATCH net-next v2 4/5] page_pool: disable sync for cpu for dmabuf memory provider

From: Pavel Begunkov
Date: Fri Nov 08 2024 - 11:39:01 EST


On 11/8/24 15:58, Stanislav Fomichev wrote:
On 11/08, Jason Gunthorpe wrote:
On Thu, Nov 07, 2024 at 09:23:08PM +0000, Mina Almasry wrote:
dmabuf dma-addresses should not be dma_sync'd for CPU/device. Typically
its the driver responsibility to dma_sync for CPU, but the driver should
not dma_sync for CPU if the netmem is actually coming from a dmabuf
memory provider.

This is not completely true, it is not *all* dmabuf, just the parts of
the dmabuf that are actually MMIO.

If you do this you may want to block accepting dmabufs that have CPU
pages inside them.

We still want udmabufs to work, so probably need some new helper to test
whether a particular netmem is backed by the cpu memory?

Agree. I guess it's fair to assume that page pool is backed either
by one or another, so could be a page pool flag that devmem.c can set
on init.

--
Pavel Begunkov