From: Dave Jiang <dave.jiang@intel.com>
To: "Koichiro Den" <den@valinux.co.jp>,
"Jon Mason" <jdmason@kudzu.us>, "Allen Hubbe" <allenbh@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Niklas Cassel" <cassel@kernel.org>
Cc: ntb@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 3/3] PCI: endpoint: pci-epf-vntb: Implement .get_dma_dev()
Date: Fri, 6 Mar 2026 08:24:48 -0700 [thread overview]
Message-ID: <1ff2c42c-73b2-43f3-a520-fcc3c16cc0a2@intel.com> (raw)
In-Reply-To: <20260306031443.1911860-4-den@valinux.co.jp>
On 3/5/26 8:14 PM, Koichiro Den wrote:
> When vNTB is used as a PCI endpoint function, the NTB device is backed
> by a virtual PCI function. For DMA API allocations and mappings, NTB
> clients must use the device that is associated with the IOMMU domain.
>
> Implement ntb_dev_ops->get_dma_dev() for pci-epf-vntb and return the EPC
> parent device.
>
> Suggested-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/pci/endpoint/functions/pci-epf-vntb.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index 20a400e83439..e5433404f573 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -1436,6 +1436,14 @@ static int vntb_epf_link_disable(struct ntb_dev *ntb)
> return 0;
> }
>
> +static struct device *vntb_epf_get_dma_dev(struct ntb_dev *ndev)
> +{
> + struct epf_ntb *ntb = ntb_ndev(ndev);
> + struct pci_epc *epc = ntb->epf->epc;
> +
> + return epc->dev.parent;
> +}
> +
> static const struct ntb_dev_ops vntb_epf_ops = {
> .mw_count = vntb_epf_mw_count,
> .spad_count = vntb_epf_spad_count,
> @@ -1457,6 +1465,7 @@ static const struct ntb_dev_ops vntb_epf_ops = {
> .db_clear_mask = vntb_epf_db_clear_mask,
> .db_clear = vntb_epf_db_clear,
> .link_disable = vntb_epf_link_disable,
> + .get_dma_dev = vntb_epf_get_dma_dev,
> };
>
> static int pci_vntb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
next prev parent reply other threads:[~2026-03-06 15:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 3:14 [PATCH v2 0/3] NTB: Allow drivers to provide DMA mapping device Koichiro Den
2026-03-06 3:14 ` [PATCH v2 1/3] NTB: core: Add .get_dma_dev() callback to ntb_dev_ops Koichiro Den
2026-03-06 3:14 ` [PATCH v2 2/3] NTB: ntb_transport: Use ntb_get_dma_dev() for DMA buffers Koichiro Den
2026-03-06 3:14 ` [PATCH v2 3/3] PCI: endpoint: pci-epf-vntb: Implement .get_dma_dev() Koichiro Den
2026-03-06 15:24 ` Dave Jiang [this message]
2026-03-26 17:19 ` [PATCH v2 0/3] NTB: Allow drivers to provide DMA mapping device Manivannan Sadhasivam
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=1ff2c42c-73b2-43f3-a520-fcc3c16cc0a2@intel.com \
--to=dave.jiang@intel.com \
--cc=Frank.Li@nxp.com \
--cc=allenbh@gmail.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=den@valinux.co.jp \
--cc=jdmason@kudzu.us \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
--cc=ntb@lists.linux.dev \
/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®