From: Koichiro Den <den@valinux.co.jp>
To: "Frank Li" <Frank.Li@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Jon Mason" <jdmason@kudzu.us>,
"Dave Jiang" <dave.jiang@intel.com>,
"Allen Hubbe" <allenbh@gmail.com>,
"Niklas Cassel" <cassel@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Jingoo Han <jingoohan1@gmail.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Rob Herring <robh@kernel.org>,
Jerome Brunet <jbrunet@baylibre.com>,
linux-pci@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, ntb@lists.linux.dev
Subject: [PATCH v10 07/10] Documentation: PCI: endpoint: Document vNTB DMA export
Date: Fri, 13 Nov 2026 22:29:32 +0900 [thread overview]
Message-ID: <20261113132935.4152566-8-den@valinux.co.jp> (raw)
In-Reply-To: <20261113132935.4152566-1-den@valinux.co.jp>
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.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
Changes in v10:
- Remove the IRQ-allocation fallback description now that DMA uses slot 1.
R-b tag is kept. Only patch 9 should need another review.
- Link to v9: https://lore.kernel.org/r/20261110082459.1798763-8-den@valinux.co.jp/
Documentation/PCI/endpoint/pci-vntb-howto.rst | 33 +++++++++++++++++--
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/Documentation/PCI/endpoint/pci-vntb-howto.rst b/Documentation/PCI/endpoint/pci-vntb-howto.rst
index 3679f5c30254..f53cd0fe91b0 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,33 @@ 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.
+For example::
+
+ # echo 5 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/dma_bar
+
+This currently supports the unrolled DesignWare eDMA layout. The EPC must
+support subrange and dynamic inbound mappings.
+
+``dma_bar`` cannot select the control or doorbell BAR.
+Any rounded-up BAR tail is scratch-backed.
+
+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.
+
+If no spare BAR is available, ``dma_bar`` can select the BAR of one MW instead.
+DMA resources then follow that MW. In this configuration:
+
+* The configured MW size must be a power of two and meet the EPC's alignment
+ requirement. Without the fallback described below, the MW translation must
+ cover that full size. Smaller requests are rejected, including those caused
+ by the host's ``max_mw_size`` setting for ``ntb_transport``.
+* Older peers treat the whole BAR as an MW. The function detects this at
+ link-up and then exposes the whole BAR as the MW, so NTB still works
+ without DMA.
+
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.54.0
next prev parent reply other threads:[~2026-11-13 13:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 13:29 [PATCH v10 00/10] PCI: endpoint: Remote DMA support via vNTB Koichiro Den
2026-11-13 13:29 ` [PATCH v10 01/10] PCI: endpoint: Add DMA auxiliary resource metadata Koichiro Den
2026-11-13 13:29 ` [PATCH v10 02/10] PCI: dwc: Expose endpoint DMA resources Koichiro Den
2026-11-13 13:29 ` [PATCH v10 03/10] PCI: endpoint: pci-epf-vntb: Move epf_ntb_is_bar_used() up Koichiro Den
2026-11-13 13:29 ` [PATCH v10 04/10] PCI: endpoint: Add pci-epf-ntb.h for the shared NTB control layout Koichiro Den
2026-11-13 13:29 ` [PATCH v10 05/10] PCI: endpoint: pci-epf-vntb: Export endpoint DMA channels Koichiro Den
2026-11-13 13:29 ` [PATCH v10 06/10] PCI: endpoint: pci-epf-vntb: Allow DMA and MW to share a BAR Koichiro Den
2026-11-13 13:29 ` Koichiro Den [this message]
2026-11-13 13:29 ` [PATCH v10 08/10] NTB: ntb_hw_epf: Use the shared NTB control layout Koichiro Den
2026-11-13 13:29 ` [PATCH v10 09/10] NTB: ntb_hw_epf: Discover vNTB-embedded DMA Koichiro Den
2026-11-13 16:24 ` Frank Li
2026-11-13 13:29 ` [PATCH v10 10/10] NTB: ntb_hw_epf: Support DMA and MW sharing a BAR Koichiro Den
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113132935.4152566-8-den@valinux.co.jp \
--to=den@valinux.co.jp \
--cc=Frank.Li@kernel.org \
--cc=allenbh@gmail.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=corbet@lwn.net \
--cc=dave.jiang@intel.com \
--cc=jbrunet@baylibre.com \
--cc=jdmason@kudzu.us \
--cc=jingoohan1@gmail.com \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=ntb@lists.linux.dev \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®