Re: [PATCH v13 00/19] PCI/P2PDMA: Route peer-to-peer DMA by TLP class
From: Jason Gunthorpe
Date: Fri Nov 13 2026 - 18:59:06 EST
On Thu, Nov 12, 2026 at 11:23:26AM +0200, Leon Romanovsky wrote:
> > I guess one benefit of this series is that a path where P2P Completion
> > Redirect is set used to mean that pci_p2pdma_map_type() would return
> > PCI_P2PDMA_MAP_NOT_SUPPORTED (unless the RC was allow-listed), and now
> > it might return PCI_P2PDMA_MAP_BUS_ADDR because if P2P Request
> > Redirect is clear, Requests can be routed directly?
>
> I'm not sure the first part (return PCI_P2PDMA_MAP_NOT_SUPPORTED) is correct,
> since callers have so far ensured that P2P is supported before calling this
> function. The second part is correct.
>
> >
> > That sounds great as long as the Request uses Relaxed Ordering, so the
> > Completion won't be affected by P2P Completion Redirect. But devices
> > aren't *required* to use RO even if enabled, and I'm doubtful that a
> > non-RO Completion redirected to the RC is going to work. So I don't
> > understand how p2pdma.c can guarantee safety.
> >
> > Translated Requests seems similar -- are we assuming that if ACS
> > Direct Translated P2P is set and ATS Enable is set, the device
> > *always* generates Translated Requests?
>
> PCI spec allows "A Function is permitted to intermix translated
> and untranslated requests" and p2p doesn't decide anything except
> if routing is possible or not.
Both of these are basically the question we left open in the
discussion with Christian.
To use this new TLP specific API correctly the initiator needs to tell
the API what kinds of TLPs it intends to generate, and ask if that set
is OK.
So you need to say 'I will use translated, I will use RO, I will use
untranslated' because each of them can have different routing.
NOT_SUPPORTED has to be returned if the modes the driver asks for
don't have identical routing.
I forget how this ended up when that got deferred, but that missing
driver input is an important part of the puzzle.
eg mlx5 knows exactly which of the three TLPs it is going to generate.
Jason