Skip to contentSkip to conversation

nvme: enable PCI P2PDMA support for RDMA transport

RFC PATCH Superseded Shivaji Kant 3 participants 5 messages Apr 2 – Apr 6 1 message not in the archive

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 nvme: enable PCI P2PDMA support for RDMA transport

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].

---
[1] https://lore.kernel.org/all/[email protected]/

---
 drivers/nvme/host/rdma.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/nvme/host/rdma.c +8 -0
index 35c0822edb2d..09eefd7c3ff4 100644
@@ -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,
 };
 
 /*
Signature · 1 line
2.53.0.1185.g05d4b7b318-goog
Reviewed-by on v2 1/1
#1 lore raw
Quoted 33 lines · Shivaji Kant

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].

---
[1] https://lore.kernel.org/all/[email protected]/

---
 drivers/nvme/host/rdma.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/nvme/host/rdma.c +7 -0
index 35c0822edb2d..09eefd7c3ff4 100644
@@ -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,

drivers/nvme/host/rdma.c static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = { · line 2215

Quoted 6 lines
drivers/nvme/host/rdma.c +1 -0
@@ -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):

Thanks,
Praan

[1] https://lore.kernel.org/all/[email protected]/

#2 lore raw
In reply to Shivaji Kant
Quoted 42 lines · Shivaji Kant

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].

---
[1] https://lore.kernel.org/all/[email protected]/

---
 drivers/nvme/host/rdma.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/nvme/host/rdma.c +8 -1
index 35c0822edb2d..09eefd7c3ff4 100644
@@ -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,
 };
 
 /*
--
Quoted 2 lines

2.53.0.1185.g05d4b7b318-goog

JFYI the link to v1 patch:
https://lore.kernel.org/all/[email protected]/

Thanks
Shivaji

#3 lore raw
In reply to Shivaji Kant
Quoted 2 lines · Shivaji Kant

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

You can use up to 73 characters per line.

Quoted 3 lines

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.

A message that is not in the archive (sent off-list or not yet received): azabfvzjn4juc77xdq6qhszd6py6hkb35jgi2xymplpnkj5ra4@vpjpaoeenvlu