public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport
@ 2026-04-02  7:30 Shivaji Kant
  2026-04-02 16:03 ` Pranjal Shrivastava
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shivaji Kant @ 2026-04-02  7:30 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi
  Cc: linux-nvme, linux-rdma, linux-kernel, Shivaji Kant,
	Pranjal Shrivastava

Enable BLK_FEAT_PCI_P2PDMA on the NVMe when the underlying
RDMA controller supports it.

This patch depends on the PCI P2PDMA support added in this
patch [1].

Suggested-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Shivaji Kant <shivajikant@google.com>
---
[1] https://lore.kernel.org/all/20260323234416.46944-3-kch@nvidia.com/
---
 drivers/nvme/host/rdma.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 35c0822edb2d..09eefd7c3ff4 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -2189,6 +2189,13 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
 	nvme_rdma_reconnect_or_remove(ctrl, ret);
 }
 
+static bool nvme_rdma_supports_pci_p2pdma(struct nvme_ctrl *ctrl)
+{
+	struct nvme_rdma_ctrl *r_ctrl = to_rdma_ctrl(ctrl);
+
+	return ib_dma_pci_p2p_dma_supported(r_ctrl->device->dev);
+}
+
 static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
 	.name			= "rdma",
 	.module			= THIS_MODULE,
@@ -2203,6 +2210,7 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
 	.get_address		= nvmf_get_address,
 	.stop_ctrl		= nvme_rdma_stop_ctrl,
 	.get_virt_boundary	= nvme_get_virt_boundary,
+	.supports_pci_p2pdma	= nvme_rdma_supports_pci_p2pdma,
 };
 
 /*
-- 
2.53.0.1185.g05d4b7b318-goog



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport
  2026-04-02  7:30 [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport Shivaji Kant
@ 2026-04-02 16:03 ` Pranjal Shrivastava
  2026-04-04  5:16 ` Shivaji Kant
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Pranjal Shrivastava @ 2026-04-02 16:03 UTC (permalink / raw)
  Cc: kbusch, axboe, hch, sagi, linux-nvme, linux-rdma, linux-kernel,
	kch

On Thu, Apr 02, 2026 at 07:30:01AM +0000, Shivaji Kant wrote:
> Enable BLK_FEAT_PCI_P2PDMA on the NVMe when the underlying
> RDMA controller supports it.
> 
> This patch depends on the PCI P2PDMA support added in this
> patch [1].
> 
> Suggested-by: Pranjal Shrivastava <praan@google.com>
> Signed-off-by: Shivaji Kant <shivajikant@google.com>
> ---
> [1] https://lore.kernel.org/all/20260323234416.46944-3-kch@nvidia.com/
> ---
>  drivers/nvme/host/rdma.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 35c0822edb2d..09eefd7c3ff4 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -2189,6 +2189,13 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
>  	nvme_rdma_reconnect_or_remove(ctrl, ret);
>  }
>  
> +static bool nvme_rdma_supports_pci_p2pdma(struct nvme_ctrl *ctrl)
> +{
> +	struct nvme_rdma_ctrl *r_ctrl = to_rdma_ctrl(ctrl);
> +
> +	return ib_dma_pci_p2p_dma_supported(r_ctrl->device->dev);
> +}
> +
>  static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
>  	.name			= "rdma",
>  	.module			= THIS_MODULE,
> @@ -2203,6 +2210,7 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
>  	.get_address		= nvmf_get_address,
>  	.stop_ctrl		= nvme_rdma_stop_ctrl,
>  	.get_virt_boundary	= nvme_get_virt_boundary,
> +	.supports_pci_p2pdma	= nvme_rdma_supports_pci_p2pdma,
>  };
>  

+Chaitanya.

Hi Chaitanya, would you like to pick this up with your v2 for the
multipath p2p enablement series [1] ?

For the changes (with Chaitanya's mpath patch):
Reviewed-by: Pranjal Shrivastava <praan@google.com>

Thanks,
Praan

[1] https://lore.kernel.org/all/20260323234416.46944-3-kch@nvidia.com/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport
  2026-04-02  7:30 [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport Shivaji Kant
  2026-04-02 16:03 ` Pranjal Shrivastava
@ 2026-04-04  5:16 ` Shivaji Kant
  2026-04-06  5:41 ` Christoph Hellwig
       [not found] ` <azabfvzjn4juc77xdq6qhszd6py6hkb35jgi2xymplpnkj5ra4@vpjpaoeenvlu>
  3 siblings, 0 replies; 5+ messages in thread
From: Shivaji Kant @ 2026-04-04  5:16 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi
  Cc: linux-nvme, linux-rdma, linux-kernel, Pranjal Shrivastava, kch

On Thu, Apr 2, 2026 at 1:00 PM Shivaji Kant <shivajikant@google.com> wrote:
>
> Enable BLK_FEAT_PCI_P2PDMA on the NVMe when the underlying
> RDMA controller supports it.
>
> This patch depends on the PCI P2PDMA support added in this
> patch [1].
>
> Suggested-by: Pranjal Shrivastava <praan@google.com>
> Signed-off-by: Shivaji Kant <shivajikant@google.com>
> ---
> [1] https://lore.kernel.org/all/20260323234416.46944-3-kch@nvidia.com/
> ---
>  drivers/nvme/host/rdma.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 35c0822edb2d..09eefd7c3ff4 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -2189,6 +2189,13 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
>         nvme_rdma_reconnect_or_remove(ctrl, ret);
>  }
>
> +static bool nvme_rdma_supports_pci_p2pdma(struct nvme_ctrl *ctrl)
> +{
> +       struct nvme_rdma_ctrl *r_ctrl = to_rdma_ctrl(ctrl);
> +
> +       return ib_dma_pci_p2p_dma_supported(r_ctrl->device->dev);
> +}
> +
>  static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
>         .name                   = "rdma",
>         .module                 = THIS_MODULE,
> @@ -2203,6 +2210,7 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
>         .get_address            = nvmf_get_address,
>         .stop_ctrl              = nvme_rdma_stop_ctrl,
>         .get_virt_boundary      = nvme_get_virt_boundary,
> +       .supports_pci_p2pdma    = nvme_rdma_supports_pci_p2pdma,
>  };
>
>  /*
> --
> 2.53.0.1185.g05d4b7b318-goog
>
JFYI the link to v1 patch:
https://lore.kernel.org/all/20260401103441.1229964-1-shivajikant@google.com/

Thanks
Shivaji


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport
  2026-04-02  7:30 [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport Shivaji Kant
  2026-04-02 16:03 ` Pranjal Shrivastava
  2026-04-04  5:16 ` Shivaji Kant
@ 2026-04-06  5:41 ` Christoph Hellwig
       [not found] ` <azabfvzjn4juc77xdq6qhszd6py6hkb35jgi2xymplpnkj5ra4@vpjpaoeenvlu>
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-04-06  5:41 UTC (permalink / raw)
  To: Shivaji Kant
  Cc: kbusch, axboe, hch, sagi, linux-nvme, linux-rdma, linux-kernel,
	Pranjal Shrivastava

On Thu, Apr 02, 2026 at 07:30:01AM +0000, Shivaji Kant wrote:
> Enable BLK_FEAT_PCI_P2PDMA on the NVMe when the underlying
> RDMA controller supports it.

You can use up to 73 characters per line.
> 
> This patch depends on the PCI P2PDMA support added in this
> patch [1].

I don't think it actually does.  To support multi-path capable RDMA
controllers, and those the vast majority, you need the multipath
support.  But for non-multipath capable controllers your patch
just works.  So I'd suggest to drop this paragraph and reference
from the commit log.

Otherwise looks good.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport
       [not found] ` <azabfvzjn4juc77xdq6qhszd6py6hkb35jgi2xymplpnkj5ra4@vpjpaoeenvlu>
@ 2026-04-06  9:15   ` Shivaji Kant
  0 siblings, 0 replies; 5+ messages in thread
From: Shivaji Kant @ 2026-04-06  9:15 UTC (permalink / raw)
  To: Henrique Carvalho
  Cc: kbusch, axboe, Christoph Hellwig, sagi, linux-rdma, linux-kernel,
	Pranjal Shrivastava, kch, linux-nvme

Thanks for reviewing.

On Sun, Apr 5, 2026 at 9:59 PM Henrique Carvalho
<henrique.carvalho@suse.com> wrote:
>
> Reviewed-by: Henrique Carvalho <henrique.carvalho@suse.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-06  9:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02  7:30 [RFC PATCH v2] nvme: enable PCI P2PDMA support for RDMA transport Shivaji Kant
2026-04-02 16:03 ` Pranjal Shrivastava
2026-04-04  5:16 ` Shivaji Kant
2026-04-06  5:41 ` Christoph Hellwig
     [not found] ` <azabfvzjn4juc77xdq6qhszd6py6hkb35jgi2xymplpnkj5ra4@vpjpaoeenvlu>
2026-04-06  9:15   ` Shivaji Kant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox