nvme: enable PCI P2PDMA support for RDMA transport
Subsystems (2)
PATCH v3 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.
Suggested-by Pranjal Shrivastava <[email protected]>
Reviewed-by Pranjal Shrivastava <[email protected]>
Reviewed-by Henrique Carvalho <[email protected]>
Signed-off-by Shivaji Kant <[email protected]>
---
v2: https://lore.kernel.org/all/[email protected]/
Changes in v3:
Dropped the reference to multiplath patch from git log as commented by Christoph Hellwig.
--- drivers/nvme/host/rdma.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/nvme/host/rdma.c +8 -0
@@ -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.1213.gd9a14994de-goog
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>
Quoted 2 lines · Shivaji Kant
Enable
BLK_FEAT_PCI_P2PDMAon the NVMe when the underlying RDMA controller supports it.
Thanks, applied to nvme-7.1.