Linux Documentation
 help / color / mirror / Atom feed
From: Koichiro Den <den@valinux.co.jp>
To: "Manivannan Sadhasivam" <mani@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Frank Li" <Frank.Li@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 v4 0/7] PCI: endpoint: Remote DMA support via vNTB
Date: Thu,  3 Sep 2026 17:23:20 +0900	[thread overview]
Message-ID: <20260903082327.2345602-1-den@valinux.co.jp> (raw)

Hi,

This series lets an RC use endpoint-local DesignWare eDMA read channels
through vNTB. It keeps the export within pci-epf-vntb and ntb_hw_epf
rather than defining a generic remote-DMA ABI or using a separate PCI
DMA function.

On the endpoint, pci-epf-vntb reserves the complete eDMA read direction
and exposes those channels as a group. This version supports unrolled
DW eDMA only.

Setting the pci-epf-vntb 'dma_bar' configfs attribute enables DMA export.
It defaults to -1, which leaves the extension disabled. pci-epf-ntb is
unchanged.

Base and dependencies
=====================

This series is based on v7.3-rc1 (cee9395acd80) plus:

  [PATCH v3 0/3] dmaengine: dw-edma: Prepare channels for remote use
  https://lore.kernel.org/r/20260903064533.2269557-1-den@valinux.co.jp/

  [PATCH v6 0/2] PCI: endpoint: pci-epf-*ntb: Harden vNTB resource management
  https://lore.kernel.org/r/20260901063238.631166-1-den@valinux.co.jp/

The second series fixes an older vNTB lifetime issue. It is also needed
to address an issue Sashiko reported during the v3 review.

Best regards,
Koichiro
---
Changes in v4:
  - Base the series on the vNTB lifecycle fixes, so unbind removes NTB
    clients and the virtual PCI device before releasing DMA resources.
    (Sashiko)
    https://lore.kernel.org/r/20260901063238.631166-1-den@valinux.co.jp/
  - Keep DMA BAR submaps for the EPF bind lifetime and drop TEARDOWN_DMA.
    (Sashiko)
  - Rename CONFIGURE_DMA to SETUP_DMA_BAR to distinguish this bind-lifetime
    BAR setup from CONFIGURE_MW's outbound mapping.
  - Continue without DMA if no DMA IRQ is available or the advertised DMA
    type is unsupported. (Sashiko)

Changes in v3:
  - Rework DMA BAR setup around pci_epf_assign_bar_space() and submaps.
    Allocate backing only for uncovered BAR ranges. This handles the BAR
    backing alignment issue in pci-epf-vntb instead of adding a generic
    pci_epf_alloc_space() workaround. (Sashiko)
    https://lore.kernel.org/r/nvgnu3enktslxuiv7kdapcotoaxlfqhivar4jbf2tqvrk4otz5@exapzemrq37q/
  - Set up a shared DMA/MW BAR through one BAR update path and simplify
    error paths. (Sashiko)
  - Make dma_bar the explicit opt-in and drop use_dma and automatic BAR
    selection. Split BAR sharing into its own patch, then document the
    final interface at the end of the series instead of updating the
    documentation twice.
  - Validate peer-provided DW eDMA region offsets before MMIO mapping.
    (Sashiko)
  - Include several other minor cleanups and refactorings.

Changes in v2:
  - Rewrite most of v1 and move the dw-edma preparation into the
    companion series. Drop the generic pci-ep-dma API, auxiliary-bus
    child/frontend, test ntb client, and preparatory MW-state
    refactoring.
    See individual patch trailers for provenance.
  - Replace v1's post-registration channel-ID cache with driver-supplied
    static IDs. (Frank)
    https://lore.kernel.org/r/abMcgQOHDD55Yv0e@lizhi-Precision-Tower-5810/
  - Let pci-epf-vntb reserve channels with dma_request_channel() and
    configure interrupt routing with dmaengine_slave_config(). This
    removes the PCI EPC DMA delegation API. (Frank)
    https://lore.kernel.org/r/ao2nHoCwfTEEiFSr@SMW015318/
  - Drop v1's dma_offset and dma_num_chans attributes. use_dma now enables
    export of the complete eDMA read direction as a group.

v3: https://lore.kernel.org/r/20260831182657.329614-1-den@valinux.co.jp/
v2: https://lore.kernel.org/r/20260828170932.2735807-1-den@valinux.co.jp/
v1: https://lore.kernel.org/r/20260312165005.1148676-1-den@valinux.co.jp/

Related PCI DMA EPF v7:
  https://lore.kernel.org/r/20260813063757.3131865-1-den@valinux.co.jp/


Koichiro Den (7):
  PCI: endpoint: Add DMA auxiliary resource metadata
  PCI: dwc: Expose endpoint DMA resources
  PCI: endpoint: pci-epf-vntb: Move epf_ntb_is_bar_used() up
  PCI: endpoint: pci-epf-vntb: Export endpoint DMA channels
  PCI: endpoint: pci-epf-vntb: Allow DMA and MW to share a BAR
  NTB: ntb_hw_epf: Discover vNTB-embedded DMA
  Documentation: PCI: endpoint: Document vNTB DMA export

 Documentation/PCI/endpoint/pci-vntb-howto.rst |  30 +-
 drivers/ntb/hw/epf/ntb_hw_epf.c               | 366 ++++++++-
 .../pci/controller/dwc/pcie-designware-ep.c   | 107 ++-
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 729 ++++++++++++++++--
 include/linux/pci-epc.h                       |  34 +-
 5 files changed, 1186 insertions(+), 80 deletions(-)

-- 
2.51.0


             reply	other threads:[~2026-09-03  8:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  8:23 Koichiro Den [this message]
2026-09-03  8:23 ` [PATCH v4 1/7] PCI: endpoint: Add DMA auxiliary resource metadata Koichiro Den
2026-09-03  8:23 ` [PATCH v4 2/7] PCI: dwc: Expose endpoint DMA resources Koichiro Den
2026-09-03  8:23 ` [PATCH v4 3/7] PCI: endpoint: pci-epf-vntb: Move epf_ntb_is_bar_used() up Koichiro Den
2026-09-03  8:23 ` [PATCH v4 4/7] PCI: endpoint: pci-epf-vntb: Export endpoint DMA channels Koichiro Den
2026-09-03  8:23 ` [PATCH v4 5/7] PCI: endpoint: pci-epf-vntb: Allow DMA and MW to share a BAR Koichiro Den
2026-09-03  8:23 ` [PATCH v4 6/7] NTB: ntb_hw_epf: Discover vNTB-embedded DMA Koichiro Den
2026-09-03  8:23 ` [PATCH v4 7/7] Documentation: PCI: endpoint: Document vNTB DMA export 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=20260903082327.2345602-1-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