From: Jakub Kicinski <kuba@xxxxxxxxxx> Date: Fri, 21 Apr 2023 06:50:59 -0700 > On Fri, 21 Apr 2023 15:31:04 +0800 Xuan Zhuo wrote: >> I am not particularly familiar with dma-bufs. I want to know if this mechanism >> can solve the problem of virtio-net. >> >> I saw this framework, allowing the driver do something inside the ops of >> dma-bufs. >> >> If so, is it possible to propose a new patch based on dma-bufs? > > I haven't looked in detail, maybe Olek has? AFAIU you'd need to rework Oh no, not me. I suck at dma-bufs, tried to understand them several times with no progress :D My knowledge is limited to "ok, if it's DMA + userspace, then it's likely dma-buf" :smile_with_tear: > uAPI of XSK to allow user to pass in a dma-buf region rather than just > a user VA. So it may be a larger effort but architecturally it may be > the right solution. > I'm curious whether this could be done without tons of work. Switching Page Pool to dma_alloc_noncoherent() is simpler :D But, as I wrote above, we need to extend DMA API first to provide bulk allocations and NUMA-aware allocations. Can't we provide a shim for back-compat, i.e. if a program passes just a user VA, create a dma-buf in the kernel already? Thanks, Olek