Thread (23 messages) 23 messages, 5 authors, 2025-07-11

Re: [RFC net-next 1/4] net: Allow non parent devices to be used for ZC DMA

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-07-02 20:53:31
Also in: lkml

On Wed, 2 Jul 2025 20:01:48 +0000 Dragos Tatulea wrote:
On Wed, Jul 02, 2025 at 11:32:08AM -0700, Jakub Kicinski wrote:
quoted
On Wed, 2 Jul 2025 20:24:23 +0300 Dragos Tatulea wrote:  
quoted
For zerocopy (io_uring, devmem), there is an assumption that the
parent device can do DMA. However that is not always the case:
for example mlx5 SF devices have an auxiliary device as a parent.  
Noob question -- I thought that the point of SFs was that you can pass
them thru to a VM. How do they not have DMA support? Is it added on
demand by the mediated driver or some such?  
They do have DMA support. Maybe didn't state it properly in the commit
message. It is just that the the parent device
(sf_netdev->dev.parent.device) is not a DMA device. The grandparent
device is a DMA device though (PCI dev of parent PFs). But I wanted to
keep it generic. Maybe it doesn't need to be so generic?

Regarding SFs and VM passtrhough: my understanding is that SFs are more
for passing them to a container.
Mm. We had macvlan offload for over a decade, there's no need for
a fake struct device, auxbus and all them layers to delegate a
"subdevice" to a container in netdev world.
In my head subfunctions are a way of configuring a PCIe PASID ergo
they _only_ make sense in context of DMA.
Maybe someone with closer understanding can chime in. If the kind
of subfunctions you describe are expected, and there's a generic 
way of recognizing them -- automatically going to parent of parent
would indeed be cleaner and less error prone, as you suggest.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help