Subject: Re: [PATCH net-next] xsk: introduce xsk_dma_ops

From: Jakub Kicinski <[email-masked]>
Date: Mon, 17 Apr 2023 19:54:00 -0700

On Tue, 18 Apr 2023 10:19:39 +0800 Xuan Zhuo wrote:
> > Can we not push this down to be bus level? virtio has its own bus it
> > can plug in whatever magic it wants into dma ops.  
> 
> It is actually not possible.
> 
> [1] https://lore.kernel.org/virtualization/[email-masked]/

Maybe Christoph, or Greg can comment.

AF_XDP, io_uring, and increasing number of pinned memory / zero copy
implementations need to do DMA mapping outside the drivers.
I don't think it's reasonable to be bubbling up custom per-subsystem
DMA ops into all of them for the sake of virtio.

> > Otherwise it really seems like we're bubbling up a virtio hack into
> > generic code :(  
> 
> Can we understand the purpose of this matter to back the DMA operation to the
> driver?

We understand what your code does.