From: Leon Romanovsky leonro@nvidia.com
ACS P2P Completion Redirect leaves Completions carrying the Relaxed Ordering attribute alone. PCIe r7.0 sec 6.12.1.1 redirects only those "that do not have the Relaxed Ordering Attribute bit set", and sec 7.7.12.5 describes the enable bit as "applicable only to Completions whose Relaxed Ordering Attribute is clear". P2PDMA reports one answer for every kind of TLP, so a client that sets Relaxed Ordering on its Non-Posted Requests, and therefore receives such Completions (sec 2.2.9.1), is sent through the host bridge for a redirect that never happens to it.
Route Completions directly for the classes that set PCI_P2PDMA_TLP_RELAXED_CPL.
Reviewed-by: Logan Gunthorpe logang@deltatee.com Tested-by: Tushar Dave tdave@nvidia.com Signed-off-by: Leon Romanovsky leonro@nvidia.com --- drivers/pci/p2pdma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 479bf58104ca..e6482467e121 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -542,11 +542,15 @@ pci_acs_p2pdma_request(u16 ctrl, unsigned int tlp_flags) /* * Decide how a peer-to-peer Completion at an ACS-capable ingress port routes. * PCIe r7.0 sec 6.12.1.1: no ACS control other than P2P Completion Redirect - * affects a Completion. + * affects a Completion, and that one leaves Completions carrying the Relaxed + * Ordering attribute alone. */ static enum pci_acs_p2pdma_state pci_acs_p2pdma_completion(u16 ctrl, unsigned int tlp_flags) { + if (tlp_flags & PCI_P2PDMA_TLP_RELAXED_CPL) + return PCI_ACS_P2PDMA_DIRECT; + return ctrl & PCI_ACS_CR ? PCI_ACS_P2PDMA_REDIRECT : PCI_ACS_P2PDMA_DIRECT; }