[PATCH v4 7/7] Documentation: PCI: endpoint: Document vNTB DMA export

From: Koichiro Den

Date: Thu Sep 03 2026 - 05:33:08 EST


Document the dma_bar attribute and the requirements for exporting endpoint
DMA channels. Also document how the selected BAR may be shared with an MW.

Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
---
Changes in v4:
- Document operation without DMA when the advertised type or a DMA IRQ is
unavailable. (Sashiko)
- List the constraints for sharing DMA and MW in one BAR.
- Fix the misleading sentence: s/select their BAR/set dma_bar/.

Documentation/PCI/endpoint/pci-vntb-howto.rst | 30 +++++++++++++++++--
1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/Documentation/PCI/endpoint/pci-vntb-howto.rst b/Documentation/PCI/endpoint/pci-vntb-howto.rst
index 3679f5c30254..b5f843bdae38 100644
--- a/Documentation/PCI/endpoint/pci-vntb-howto.rst
+++ b/Documentation/PCI/endpoint/pci-vntb-howto.rst
@@ -90,9 +90,9 @@ of the function device and is populated with the following NTB specific
attributes that can be configured by the user::

# ls functions/pci_epf_vntb/func1/pci_epf_vntb.0/
- ctrl_bar db_count mw1_bar mw2_bar mw3_bar mw4_bar spad_count
- db_bar mw1 mw2 mw3 mw4 num_mws vbus_number
- vntb_vid vntb_pid
+ ctrl_bar dma_bar mw2 mw3_bar num_mws vntb_pid
+ db_bar mw1 mw2_bar mw4 spad_count vntb_vid
+ db_count mw1_bar mw3 mw4_bar vbus_number

A sample configuration for NTB function is given below::

@@ -105,6 +105,30 @@ By default, each construct is assigned a BAR, as needed and in order.
Should a specific BAR setup be required by the platform, BAR may be assigned
to each construct using the related ``XYZ_bar`` entry.

+To export DMA channels, set dma_bar before binding the function::
+
+ # echo 5 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/dma_bar
+
+This currently supports the unrolled DesignWare eDMA layout. If any DMA
+resource has no fixed BAR assignment, the EPC must support subrange and
+dynamic inbound mappings.
+
+Leaving ``dma_bar`` unassigned disables DMA export.
+With a separate DMA BAR, an older ``ntb_hw_epf`` peer can ignore the extension
+and continue without DMA. A peer that understands the extension also continues
+without DMA if the advertised type is unavailable or no DMA IRQ can be
+allocated.
+
+When ``dma_bar`` selects an MW BAR, DMA resources follow that MW. In this
+configuration:
+
+* The shared MW size must be a power of two and its translation must cover the
+ full configured size.
+* Any rounded-up BAR tail is scratch-backed.
+* An updated peer is required because older peers treat the whole BAR as an
+ MW.
+* Control and doorbell BARs cannot be shared.
+
A sample configuration for virtual NTB driver for virtual PCI bus::

# echo 0x1957 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vntb_vid
--
2.51.0