* [PATCH] PCI: Enable ACS "Direct translated" feature on capable devices
@ 2025-10-27 7:32 Ramkumar Santhanakrishnan
0 siblings, 0 replies; only message in thread
From: Ramkumar Santhanakrishnan @ 2025-10-27 7:32 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Ramkumar Santhanakrishnan
From: "ramkumar.s" <ramkumar.s@nutanix.com>
The "Direct Translated" feature of ACS should be enabled on the PCIe
bridges to direct the transaction with translated address from one
downstream device to another downstream device.
The ATS capable devices can accelerate the P2P transaction by caching
the address translation and directly send the PCIe transaction with
the translated address. The parent bridge of these ATS capable devices
should have "Direct translated" feature enabled to forward these
packets to the target devices.
The intention is to enable the "Direct Translated" feature when
the ATS is not disabled and the device is trusted and not external.
Signed-off-by: ramkumar.s <ramkumar.s@nutanix.com>
---
drivers/pci/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b14dd064006c..e5e5ee3ccfc1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1006,9 +1006,14 @@ static void pci_std_enable_acs(struct pci_dev *dev, struct pci_acs *caps)
/* Upstream Forwarding */
caps->ctrl |= (caps->cap & PCI_ACS_UF);
- /* Enable Translation Blocking for external devices and noats */
+ /*
+ * Enable Translation Blocking for external devices and noats,
+ * otherwise allow Direct Translated.
+ */
if (pci_ats_disabled() || dev->external_facing || dev->untrusted)
caps->ctrl |= (caps->cap & PCI_ACS_TB);
+ else
+ caps->ctrl |= (caps->cap & PCI_ACS_DT);
}
/**
--
2.43.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-27 7:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27 7:32 [PATCH] PCI: Enable ACS "Direct translated" feature on capable devices Ramkumar Santhanakrishnan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).