Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [RFC 0/4] nvme-rdma: dma-buf backed I/O
       [not found] <CGME20261118103434epcas5p4ddef3806fafdb60f309fe882e354881c@epcas5p4.samsung.com>
@ 2026-11-18 10:33 ` Anuj Gupta
  2026-11-18 10:33   ` [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core Anuj Gupta
                     ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Anuj Gupta @ 2026-11-18 10:33 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, jgg, leon, asml.silence
  Cc: nj.shetty, joshi.k, anuj1072538, linux-nvme, linux-rdma,
	Anuj Gupta

Hi all,

This series adds dma-buf support for NVMe over Fabrics using RDMA.

Patch 1 moves the NVMe dma-buf I/O context handling from nvme-pci to
nvme-core.

Patch 2 lets transports create and provide the dma-buf attachment.

Patch 3 adds an RDMA helper for attaching a dma-buf to the device used
for DMA.

Patch 4 adds dma-buf backed I/O support to nvme-rdma.

The series has been lightly tested with the liburing rw-dmabuf test
over NVMe/RDMA using Mellanox ConnectX-3 Pro adapters.

Anuj Gupta (1):
  RDMA/core: Add ib_dma_buf_dynamic_attach()

Nitesh Shetty (3):
  nvme: move dma-buf I/O context handling to nvme-core
  nvme: let transports provide the dma-buf attachment
  nvme-rdma: support dma-buf backed requests

 drivers/infiniband/core/verbs.c              |  28 +++
 drivers/nvme/host/Makefile                   |   2 +-
 drivers/nvme/host/{pci-dmabuf.c => dmabuf.c} |  93 ++++++++--
 drivers/nvme/host/{pci-dmabuf.h => dmabuf.h} |  46 ++++-
 drivers/nvme/host/pci.c                      |  14 +-
 drivers/nvme/host/rdma.c                     | 182 ++++++++++++++++++-
 include/rdma/ib_verbs.h                      |   7 +
 7 files changed, 334 insertions(+), 38 deletions(-)
 rename drivers/nvme/host/{pci-dmabuf.c => dmabuf.c} (58%)
 rename drivers/nvme/host/{pci-dmabuf.h => dmabuf.h} (51%)

-- 
2.25.1


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

* [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core
  2026-11-18 10:33 ` [RFC 0/4] nvme-rdma: dma-buf backed I/O Anuj Gupta
@ 2026-11-18 10:33   ` Anuj Gupta
  2026-11-18 11:36     ` sashiko-bot
  2026-11-18 10:33   ` [RFC 2/4] nvme: let transports provide the dma-buf attachment Anuj Gupta
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Anuj Gupta @ 2026-11-18 10:33 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, jgg, leon, asml.silence
  Cc: nj.shetty, joshi.k, anuj1072538, linux-nvme, linux-rdma,
	Anuj Gupta

From: Nitesh Shetty <nj.shetty@samsung.com>

The dma-buf I/O context handling in pci-dmabuf.c is not specific to
PCI. Move it to nvme-core so it can be shared by other transports.

Keep the PCI-specific PRP and SGL construction in pci.c.

No functional change.

Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/nvme/host/Makefile                   |  2 +-
 drivers/nvme/host/{pci-dmabuf.c => dmabuf.c} | 12 ++++++++----
 drivers/nvme/host/{pci-dmabuf.h => dmabuf.h} | 12 ++++++------
 drivers/nvme/host/pci.c                      |  5 ++---
 4 files changed, 17 insertions(+), 14 deletions(-)
 rename drivers/nvme/host/{pci-dmabuf.c => dmabuf.c} (92%)
 rename drivers/nvme/host/{pci-dmabuf.h => dmabuf.h} (85%)

diff --git a/drivers/nvme/host/Makefile b/drivers/nvme/host/Makefile
index 8288b986d713..5082a2788b31 100644
--- a/drivers/nvme/host/Makefile
+++ b/drivers/nvme/host/Makefile
@@ -19,9 +19,9 @@ nvme-core-$(CONFIG_BLK_DEV_ZONED)	+= zns.o
 nvme-core-$(CONFIG_FAULT_INJECTION_DEBUG_FS)	+= fault_inject.o
 nvme-core-$(CONFIG_NVME_HWMON)		+= hwmon.o
 nvme-core-$(CONFIG_NVME_HOST_AUTH)	+= auth.o
+nvme-core-$(CONFIG_DMA_SHARED_BUFFER)	+= dmabuf.o
 
 nvme-y					+= pci.o
-nvme-$(CONFIG_DMA_SHARED_BUFFER)	+= pci-dmabuf.o
 
 nvme-fabrics-y				+= fabrics.o
 
diff --git a/drivers/nvme/host/pci-dmabuf.c b/drivers/nvme/host/dmabuf.c
similarity index 92%
rename from drivers/nvme/host/pci-dmabuf.c
rename to drivers/nvme/host/dmabuf.c
index 161e4ffa6919..1f9104a5d75e 100644
--- a/drivers/nvme/host/pci-dmabuf.c
+++ b/drivers/nvme/host/dmabuf.c
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Code for supporting dma-buf I/O maps in the NVMe driver.
+ * Code for supporting dma-buf I/O maps in the NVMe host drivers.
  * Copyright (C) 2026 Pavel Begunkov <asml.silence@gmail.com>
  */
 
 #include <linux/dma-resv.h>
 
-#include "pci-dmabuf.h"
+#include "dmabuf.h"
 
 static void nvme_dmabuf_invalidate_mappings(struct dma_buf_attachment *attach)
 {
@@ -104,7 +104,7 @@ static void nvme_dma_buf_io_release(struct dma_buf_io_ctx *base_ctx)
 	kfree(ctx);
 }
 
-void __nvme_pci_remove_dmabuf(struct nvme_dma_buf_list *list)
+void __nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 {
 	struct nvme_dma_buf_io_ctx *ctx, *tmp;
 
@@ -117,8 +117,9 @@ void __nvme_pci_remove_dmabuf(struct nvme_dma_buf_list *list)
 	}
 	mutex_unlock(&list->lock);
 }
+EXPORT_SYMBOL_GPL(__nvme_remove_dmabufs);
 
-const struct dma_buf_io_ops nvme_dma_buf_io_ops = {
+static const struct dma_buf_io_ops nvme_dma_buf_io_ops = {
 	.map		= nvme_dma_buf_io_map,
 	.unmap		= nvme_dma_buf_io_unmap,
 	.release	= nvme_dma_buf_io_release,
@@ -167,3 +168,6 @@ int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 	mutex_unlock(&buf_list->lock);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(__nvme_init_dma_buf_io_ctx);
+
+MODULE_IMPORT_NS("DMA_BUF");
diff --git a/drivers/nvme/host/pci-dmabuf.h b/drivers/nvme/host/dmabuf.h
similarity index 85%
rename from drivers/nvme/host/pci-dmabuf.h
rename to drivers/nvme/host/dmabuf.h
index b3c9fd485878..08a5b8e5d771 100644
--- a/drivers/nvme/host/pci-dmabuf.h
+++ b/drivers/nvme/host/dmabuf.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2026 Pavel Begunkov <asml.silence@gmail.com>
  */
 
-#ifndef _NVME_PCI_DMABUF_H
-#define _NVME_PCI_DMABUF_H
+#ifndef _NVME_DMABUF_H
+#define _NVME_DMABUF_H
 
 #include <linux/dma-buf-io.h>
 
@@ -44,15 +44,15 @@ static inline struct nvme_dmabuf_map *nvme_req_to_map(struct request *req)
 	return to_nvme_dmabuf_map(map);
 }
 
-void __nvme_pci_remove_dmabuf(struct nvme_dma_buf_list *list);
+void __nvme_remove_dmabufs(struct nvme_dma_buf_list *list);
 int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
 		struct dma_buf_io_ctx *ctx);
 
-static inline void nvme_pci_remove_dmabuf(struct nvme_dma_buf_list *list)
+static inline void nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 {
 	if (IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
-		__nvme_pci_remove_dmabuf(list);
+		__nvme_remove_dmabufs(list);
 }
 
 static inline int nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
@@ -72,4 +72,4 @@ static inline void nvme_init_buf_list(struct nvme_dma_buf_list *buf_list)
 }
 
 
-#endif /* _NVME_PCI_DMABUF_H */
\ No newline at end of file
+#endif /* _NVME_DMABUF_H */
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 076603df01ab..1af356abde0b 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -30,7 +30,7 @@
 
 #include "trace.h"
 #include "nvme.h"
-#include "pci-dmabuf.h"
+#include "dmabuf.h"
 
 #define SQ_SIZE(q)	((q)->q_depth << (q)->sqes)
 #define CQ_SIZE(q)	((q)->q_depth * sizeof(struct nvme_completion))
@@ -4129,7 +4129,7 @@ static void nvme_remove(struct pci_dev *pdev)
 	nvme_stop_ctrl(&dev->ctrl);
 	nvme_remove_namespaces(&dev->ctrl);
 	nvme_dev_disable(dev, true);
-	nvme_pci_remove_dmabuf(&dev->dmabufs);
+	nvme_remove_dmabufs(&dev->dmabufs);
 	nvme_free_host_mem(dev);
 	nvme_dev_remove_admin(dev);
 	nvme_dbbuf_dma_free(dev);
@@ -4571,6 +4571,5 @@ MODULE_AUTHOR("Matthew Wilcox <willy@linux.intel.com>");
 MODULE_LICENSE("GPL");
 MODULE_VERSION("1.0");
 MODULE_DESCRIPTION("NVMe host PCIe transport driver");
-MODULE_IMPORT_NS("DMA_BUF");
 module_init(nvme_init);
 module_exit(nvme_exit);
-- 
2.25.1


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

* [RFC 2/4] nvme: let transports provide the dma-buf attachment
  2026-11-18 10:33 ` [RFC 0/4] nvme-rdma: dma-buf backed I/O Anuj Gupta
  2026-11-18 10:33   ` [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core Anuj Gupta
@ 2026-11-18 10:33   ` Anuj Gupta
  2026-11-18 11:37     ` sashiko-bot
  2026-11-18 10:33   ` [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach() Anuj Gupta
  2026-11-18 10:33   ` [RFC 4/4] nvme-rdma: support dma-buf backed requests Anuj Gupta
  3 siblings, 1 reply; 8+ messages in thread
From: Anuj Gupta @ 2026-11-18 10:33 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, jgg, leon, asml.silence
  Cc: nj.shetty, joshi.k, anuj1072538, linux-nvme, linux-rdma,
	Anuj Gupta

From: Nitesh Shetty <nj.shetty@samsung.com>

dma-bufs are currently attached to ctrl->dev by nvme-core. This works
for nvme-pci, but fabrics transports can use a different device for
data DMA.

Let transports create the attachment and pass it to nvme-core, which
takes ownership of it. nvme-pci continues to attach to its PCI device.

Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/nvme/host/dmabuf.c | 35 ++++++++++++++++++++++-------------
 drivers/nvme/host/dmabuf.h |  6 +++++-
 drivers/nvme/host/pci.c    | 11 ++++++++++-
 3 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/drivers/nvme/host/dmabuf.c b/drivers/nvme/host/dmabuf.c
index 1f9104a5d75e..f68ffa89e56f 100644
--- a/drivers/nvme/host/dmabuf.c
+++ b/drivers/nvme/host/dmabuf.c
@@ -15,10 +15,11 @@ static void nvme_dmabuf_invalidate_mappings(struct dma_buf_attachment *attach)
 	dma_buf_io_invalidate_mappings(ctx);
 }
 
-static const struct dma_buf_attach_ops nvme_dmabuf_importer_ops = {
+const struct dma_buf_attach_ops nvme_dmabuf_importer_ops = {
 	.invalidate_mappings	= nvme_dmabuf_invalidate_mappings,
 	.allow_peer2peer	= true,
 };
+EXPORT_SYMBOL_GPL(nvme_dmabuf_importer_ops);
 
 static struct dma_buf_io_map *nvme_dma_buf_io_map(struct dma_buf_io_ctx *ctx)
 {
@@ -127,23 +128,21 @@ static const struct dma_buf_io_ops nvme_dma_buf_io_ops = {
 
 static int nvme_init_io_ctx_locked(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach,
 		struct dma_buf_io_ctx *ctx)
 {
 	struct nvme_dma_buf_io_ctx *nvme_ctx;
-	struct dma_buf_attachment *attach;
+	int ret;
 
-	if (buf_list->dead)
-		return -ENODEV;
+	if (buf_list->dead) {
+		ret = -ENODEV;
+		goto err_detach;
+	}
 
 	nvme_ctx = kzalloc_obj(*nvme_ctx);
-	if (!nvme_ctx)
-		return -ENOMEM;
-
-	attach = dma_buf_dynamic_attach(ctx->dmabuf, ctrl->dev,
-					&nvme_dmabuf_importer_ops, ctx);
-	if (IS_ERR(attach)) {
-		kfree(nvme_ctx);
-		return PTR_ERR(attach);
+	if (!nvme_ctx) {
+		ret = -ENOMEM;
+		goto err_detach;
 	}
 
 	nvme_get_ctrl(ctrl);
@@ -155,16 +154,26 @@ static int nvme_init_io_ctx_locked(struct nvme_ctrl *ctrl,
 	ctx->dev_priv = nvme_ctx;
 	ctx->dev_ops = &nvme_dma_buf_io_ops;
 	return 0;
+
+err_detach:
+	dma_buf_detach(ctx->dmabuf, attach);
+	return ret;
 }
 
+/*
+ * @attach must have been created with nvme_dmabuf_importer_ops and @ctx as
+ * the importer private data. The context takes ownership of it, and it is
+ * detached on failure or when the context is released.
+ */
 int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach,
 		struct dma_buf_io_ctx *ctx)
 {
 	int ret;
 
 	mutex_lock(&buf_list->lock);
-	ret = nvme_init_io_ctx_locked(ctrl, buf_list, ctx);
+	ret = nvme_init_io_ctx_locked(ctrl, buf_list, attach, ctx);
 	mutex_unlock(&buf_list->lock);
 	return ret;
 }
diff --git a/drivers/nvme/host/dmabuf.h b/drivers/nvme/host/dmabuf.h
index 08a5b8e5d771..0c12ee6d3584 100644
--- a/drivers/nvme/host/dmabuf.h
+++ b/drivers/nvme/host/dmabuf.h
@@ -44,9 +44,12 @@ static inline struct nvme_dmabuf_map *nvme_req_to_map(struct request *req)
 	return to_nvme_dmabuf_map(map);
 }
 
+extern const struct dma_buf_attach_ops nvme_dmabuf_importer_ops;
+
 void __nvme_remove_dmabufs(struct nvme_dma_buf_list *list);
 int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach,
 		struct dma_buf_io_ctx *ctx);
 
 static inline void nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
@@ -57,11 +60,12 @@ static inline void nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 
 static inline int nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach,
 		struct dma_buf_io_ctx *ctx)
 {
 	if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
 		return -EOPNOTSUPP;
-	return __nvme_init_dma_buf_io_ctx(ctrl, buf_list, ctx);
+	return __nvme_init_dma_buf_io_ctx(ctrl, buf_list, attach, ctx);
 }
 
 static inline void nvme_init_buf_list(struct nvme_dma_buf_list *buf_list)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 1af356abde0b..412fbc3d9544 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3771,8 +3771,16 @@ static int nvme_pci_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct dma_buf_io_ctx *ctx)
 {
 	struct nvme_dev *dev = to_nvme_dev(ctrl);
+	struct dma_buf_attachment *attach;
 
-	return nvme_init_dma_buf_io_ctx(ctrl, &dev->dmabufs, ctx);
+	if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
+		return -EOPNOTSUPP;
+
+	attach = dma_buf_dynamic_attach(ctx->dmabuf, dev->dev,
+					&nvme_dmabuf_importer_ops, ctx);
+	if (IS_ERR(attach))
+		return PTR_ERR(attach);
+	return nvme_init_dma_buf_io_ctx(ctrl, &dev->dmabufs, attach, ctx);
 }
 
 static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
@@ -4571,5 +4579,6 @@ MODULE_AUTHOR("Matthew Wilcox <willy@linux.intel.com>");
 MODULE_LICENSE("GPL");
 MODULE_VERSION("1.0");
 MODULE_DESCRIPTION("NVMe host PCIe transport driver");
+MODULE_IMPORT_NS("DMA_BUF");
 module_init(nvme_init);
 module_exit(nvme_exit);
-- 
2.25.1


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

* [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach()
  2026-11-18 10:33 ` [RFC 0/4] nvme-rdma: dma-buf backed I/O Anuj Gupta
  2026-11-18 10:33   ` [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core Anuj Gupta
  2026-11-18 10:33   ` [RFC 2/4] nvme: let transports provide the dma-buf attachment Anuj Gupta
@ 2026-11-18 10:33   ` Anuj Gupta
  2026-11-18 11:36     ` sashiko-bot
  2026-11-18 10:33   ` [RFC 4/4] nvme-rdma: support dma-buf backed requests Anuj Gupta
  3 siblings, 1 reply; 8+ messages in thread
From: Anuj Gupta @ 2026-11-18 10:33 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, jgg, leon, asml.silence
  Cc: nj.shetty, joshi.k, anuj1072538, linux-nvme, linux-rdma,
	Anuj Gupta

ULPs must not use the DMA device of an ib_device directly, but a ULP
importing a dma-buf has to attach it to that device.

Add a helper that attaches a dma-buf to the DMA device of an ib_device.
Devices using virtual DMA, such as rxe and siw, have no DMA device and
are rejected with -EOPNOTSUPP.

Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/infiniband/core/verbs.c | 28 ++++++++++++++++++++++++++++
 include/rdma/ib_verbs.h         |  7 +++++++
 2 files changed, 35 insertions(+)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index c4eb1de44155..eb3036d6f7e1 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -38,6 +38,7 @@
 
 #include <linux/errno.h>
 #include <linux/err.h>
+#include <linux/dma-buf.h>
 #include <linux/export.h>
 #include <linux/string.h>
 #include <linux/slab.h>
@@ -3217,3 +3218,30 @@ void rdma_free_hw_stats_struct(struct rdma_hw_stats *stats)
 	kfree(stats);
 }
 EXPORT_SYMBOL(rdma_free_hw_stats_struct);
+
+/**
+ * ib_dma_buf_dynamic_attach - attach a dma-buf for DMA by an RDMA device
+ * @dev: RDMA device that will access the dma-buf
+ * @dmabuf: dma-buf to attach
+ * @importer_ops: importer callbacks, see dma_buf_dynamic_attach()
+ * @importer_priv: importer private data, see dma_buf_dynamic_attach()
+ *
+ * Attach @dmabuf to the device that does DMA for @dev. Devices using
+ * virtual DMA have no such device and are not supported.
+ *
+ * Return: the attachment, or an ERR_PTR() on failure.
+ */
+struct dma_buf_attachment *
+ib_dma_buf_dynamic_attach(struct ib_device *dev, struct dma_buf *dmabuf,
+			  const struct dma_buf_attach_ops *importer_ops,
+			  void *importer_priv)
+{
+	if (ib_uses_virt_dma(dev))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	return dma_buf_dynamic_attach(dmabuf, dev->dma_device, importer_ops,
+				      importer_priv);
+}
+EXPORT_SYMBOL_GPL(ib_dma_buf_dynamic_attach);
+
+MODULE_IMPORT_NS("DMA_BUF");
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index d6eaa3fee66e..c287bee1dd09 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4323,6 +4323,13 @@ static inline bool ib_dma_pci_p2p_dma_supported(struct ib_device *dev)
 	return dma_pci_p2pdma_supported(dev->dma_device);
 }
 
+struct dma_buf;
+struct dma_buf_attach_ops;
+struct dma_buf_attachment *
+ib_dma_buf_dynamic_attach(struct ib_device *dev, struct dma_buf *dmabuf,
+			  const struct dma_buf_attach_ops *importer_ops,
+			  void *importer_priv);
+
 /**
  * ib_virt_dma_to_ptr - Convert a dma_addr to a kernel pointer
  * @dma_addr: The DMA address
-- 
2.25.1


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

* [RFC 4/4] nvme-rdma: support dma-buf backed requests
  2026-11-18 10:33 ` [RFC 0/4] nvme-rdma: dma-buf backed I/O Anuj Gupta
                     ` (2 preceding siblings ...)
  2026-11-18 10:33   ` [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach() Anuj Gupta
@ 2026-11-18 10:33   ` Anuj Gupta
  3 siblings, 0 replies; 8+ messages in thread
From: Anuj Gupta @ 2026-11-18 10:33 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, jgg, leon, asml.silence
  Cc: nj.shetty, joshi.k, anuj1072538, linux-nvme, linux-rdma,
	Anuj Gupta

From: Nitesh Shetty <nj.shetty@samsung.com>

Implement ->init_dma_buf_io_ctx so that memory exported through dma-buf,
such as GPU memory, can be registered with io_uring and used for I/O to
an nvme-rdma namespace. The initiator RNIC can then DMA directly to and
from the dma-buf memory.

Map registered dma-bufs for the RDMA device and build the request
scatterlist from the retained DMA mapping. Register each request with a
fast-registration MR so the target can only access the requested range.
PI, software RDMA and multipath are not supported.

The controller's RDMA device is only available while the admin queue
exists and may change when the controller reconnects. Serialize
attachment with queue teardown and record the RDMA device each context
was attached for.

Detaching contexts on reconnect could deadlock on requeued requests that
still hold map references. Retain the contexts and fail requests whose
queues use a different RDMA device. Detach them when the controller is
deleted. Removing an RDMA device also deletes controllers that retain
contexts attached to it.

Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/nvme/host/dmabuf.c |  50 +++++++++-
 drivers/nvme/host/dmabuf.h |  28 ++++++
 drivers/nvme/host/rdma.c   | 182 +++++++++++++++++++++++++++++++++++--
 3 files changed, 248 insertions(+), 12 deletions(-)

diff --git a/drivers/nvme/host/dmabuf.c b/drivers/nvme/host/dmabuf.c
index f68ffa89e56f..142da218379c 100644
--- a/drivers/nvme/host/dmabuf.c
+++ b/drivers/nvme/host/dmabuf.c
@@ -120,20 +120,61 @@ void __nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 }
 EXPORT_SYMBOL_GPL(__nvme_remove_dmabufs);
 
+/**
+ * __nvme_dmabufs_use_owner - check whether any context has the given owner
+ * @list:	the controller's dma-buf context list
+ * @owner:	the owner to look for
+ *
+ * Return: true if a dma-buf context in @list was attached for @owner.
+ */
+bool __nvme_dmabufs_use_owner(struct nvme_dma_buf_list *list, void *owner)
+{
+	struct nvme_dma_buf_io_ctx *ctx;
+	bool found = false;
+
+	mutex_lock(&list->lock);
+	list_for_each_entry(ctx, &list->ctxs, list) {
+		if (ctx->owner == owner) {
+			found = true;
+			break;
+		}
+	}
+	mutex_unlock(&list->lock);
+	return found;
+}
+EXPORT_SYMBOL_GPL(__nvme_dmabufs_use_owner);
+
 static const struct dma_buf_io_ops nvme_dma_buf_io_ops = {
 	.map		= nvme_dma_buf_io_map,
 	.unmap		= nvme_dma_buf_io_unmap,
 	.release	= nvme_dma_buf_io_release,
 };
 
-static int nvme_init_io_ctx_locked(struct nvme_ctrl *ctrl,
+/**
+ * __nvme_init_dma_buf_io_ctx_locked - initialise a dma-buf I/O context
+ * @ctrl:	controller the context issues I/O to
+ * @buf_list:	the controller's dma-buf context list
+ * @attach:	attachment of the dma-buf, see __nvme_init_dma_buf_io_ctx()
+ * @owner:	identifies the device @attach was made for, may be NULL
+ * @ctx:	dma-buf I/O context to initialise
+ *
+ * Locked variant of __nvme_init_dma_buf_io_ctx(), for transports that select
+ * the device and create @attach under @buf_list->lock, which the caller must
+ * hold. The attachment requirements and ownership rules are the same.
+ *
+ * Return: 0 on success, or a negative errno code otherwise.
+ */
+int __nvme_init_dma_buf_io_ctx_locked(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
-		struct dma_buf_attachment *attach,
+		struct dma_buf_attachment *attach, void *owner,
 		struct dma_buf_io_ctx *ctx)
+	__must_hold(&buf_list->lock)
 {
 	struct nvme_dma_buf_io_ctx *nvme_ctx;
 	int ret;
 
+	lockdep_assert_held(&buf_list->lock);
+
 	if (buf_list->dead) {
 		ret = -ENODEV;
 		goto err_detach;
@@ -148,6 +189,7 @@ static int nvme_init_io_ctx_locked(struct nvme_ctrl *ctrl,
 	nvme_get_ctrl(ctrl);
 	list_add(&nvme_ctx->list, &buf_list->ctxs);
 	nvme_ctx->attach = attach;
+	nvme_ctx->owner = owner;
 	nvme_ctx->base = ctx;
 	nvme_ctx->ctrl = ctrl;
 	nvme_ctx->buf_list = buf_list;
@@ -159,6 +201,7 @@ static int nvme_init_io_ctx_locked(struct nvme_ctrl *ctrl,
 	dma_buf_detach(ctx->dmabuf, attach);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(__nvme_init_dma_buf_io_ctx_locked);
 
 /*
  * @attach must have been created with nvme_dmabuf_importer_ops and @ctx as
@@ -173,7 +216,8 @@ int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 	int ret;
 
 	mutex_lock(&buf_list->lock);
-	ret = nvme_init_io_ctx_locked(ctrl, buf_list, attach, ctx);
+	ret = __nvme_init_dma_buf_io_ctx_locked(ctrl, buf_list, attach, NULL,
+						ctx);
 	mutex_unlock(&buf_list->lock);
 	return ret;
 }
diff --git a/drivers/nvme/host/dmabuf.h b/drivers/nvme/host/dmabuf.h
index 0c12ee6d3584..5ea80d65aff8 100644
--- a/drivers/nvme/host/dmabuf.h
+++ b/drivers/nvme/host/dmabuf.h
@@ -21,6 +21,8 @@ struct nvme_dma_buf_io_ctx {
 	struct nvme_dma_buf_list *buf_list;
 	struct dma_buf_io_ctx *base;
 	struct nvme_ctrl *ctrl;
+	/* transport-specific device identifier */
+	void *owner;
 	struct list_head list;
 };
 
@@ -47,10 +49,16 @@ static inline struct nvme_dmabuf_map *nvme_req_to_map(struct request *req)
 extern const struct dma_buf_attach_ops nvme_dmabuf_importer_ops;
 
 void __nvme_remove_dmabufs(struct nvme_dma_buf_list *list);
+bool __nvme_dmabufs_use_owner(struct nvme_dma_buf_list *list, void *owner);
 int __nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
 		struct dma_buf_attachment *attach,
 		struct dma_buf_io_ctx *ctx);
+int __nvme_init_dma_buf_io_ctx_locked(struct nvme_ctrl *ctrl,
+		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach, void *owner,
+		struct dma_buf_io_ctx *ctx)
+	__must_hold(&buf_list->lock);
 
 static inline void nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 {
@@ -58,6 +66,14 @@ static inline void nvme_remove_dmabufs(struct nvme_dma_buf_list *list)
 		__nvme_remove_dmabufs(list);
 }
 
+static inline bool nvme_dmabufs_use_owner(struct nvme_dma_buf_list *list,
+		void *owner)
+{
+	if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
+		return false;
+	return __nvme_dmabufs_use_owner(list, owner);
+}
+
 static inline int nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 		struct nvme_dma_buf_list *buf_list,
 		struct dma_buf_attachment *attach,
@@ -68,6 +84,18 @@ static inline int nvme_init_dma_buf_io_ctx(struct nvme_ctrl *ctrl,
 	return __nvme_init_dma_buf_io_ctx(ctrl, buf_list, attach, ctx);
 }
 
+static inline int nvme_init_dma_buf_io_ctx_locked(struct nvme_ctrl *ctrl,
+		struct nvme_dma_buf_list *buf_list,
+		struct dma_buf_attachment *attach, void *owner,
+		struct dma_buf_io_ctx *ctx)
+	__must_hold(&buf_list->lock)
+{
+	if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
+		return -EOPNOTSUPP;
+	return __nvme_init_dma_buf_io_ctx_locked(ctrl, buf_list, attach, owner,
+						 ctx);
+}
+
 static inline void nvme_init_buf_list(struct nvme_dma_buf_list *buf_list)
 {
 	INIT_LIST_HEAD(&buf_list->ctxs);
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 32189fdfc0f5..e7c26bd4f77d 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -27,6 +27,7 @@
 
 #include "nvme.h"
 #include "fabrics.h"
+#include "dmabuf.h"
 
 
 #define NVME_RDMA_CM_TIMEOUT_MS		3000		/* 3 second */
@@ -139,6 +140,12 @@ struct nvme_rdma_ctrl {
 	struct nvme_ctrl	ctrl;
 	bool			use_inline_data;
 	u32			io_queues[HCTX_MAX_TYPES];
+
+	/*
+	 * dma-buf I/O contexts. Registration is refused while there is no
+	 * admin queue, as ctrl->device is not valid then.
+	 */
+	struct nvme_dma_buf_list dmabufs;
 };
 
 static inline struct nvme_rdma_ctrl *to_rdma_ctrl(struct nvme_ctrl *ctrl)
@@ -780,8 +787,17 @@ static int nvme_rdma_alloc_tag_set(struct nvme_ctrl *ctrl)
 			cmd_size);
 }
 
+static void nvme_rdma_set_dmabufs_dead(struct nvme_rdma_ctrl *ctrl, bool dead)
+{
+	mutex_lock(&ctrl->dmabufs.lock);
+	ctrl->dmabufs.dead = dead;
+	mutex_unlock(&ctrl->dmabufs.lock);
+}
+
 static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl)
 {
+	nvme_rdma_set_dmabufs_dead(ctrl, true);
+
 	if (ctrl->async_event_sqe.data) {
 		cancel_work_sync(&ctrl->ctrl.async_event_work);
 		nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
@@ -854,6 +870,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,
 	if (error)
 		goto out_quiesce_queue;
 
+	nvme_rdma_set_dmabufs_dead(ctrl, false);
 	return 0;
 
 out_quiesce_queue:
@@ -1249,6 +1266,13 @@ static void nvme_rdma_dma_unmap_req(struct ib_device *ibdev, struct request *rq)
 {
 	struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
 
+	/* dma-buf addresses are mapped for the lifetime of the map */
+	if (blk_mq_rq_is_dmabuf(rq)) {
+		sg_free_table_chained(&req->data_sgl.sg_table,
+				      NVME_INLINE_SG_CNT);
+		return;
+	}
+
 	if (blk_integrity_rq(rq)) {
 		ib_dma_unmap_sg(ibdev, req->metadata_sgl->sg_table.sgl,
 				req->metadata_sgl->nents, rq_dma_dir(rq));
@@ -1555,6 +1579,100 @@ static int nvme_rdma_dma_map_req(struct ib_device *ibdev, struct request *rq,
 	return ret;
 }
 
+/*
+ * Build the data scatterlist of a dma-buf request from the DMA address
+ * table of its map. The addresses are already mapped for the RDMA device
+ * the dma-buf is attached to, so there is no DMA mapping here.
+ */
+static int nvme_rdma_dma_map_dmabuf_req(struct nvme_rdma_queue *queue,
+		struct request *rq, int *count)
+{
+	struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
+	struct nvme_dmabuf_map *map = nvme_req_to_map(rq);
+	struct nvme_dma_buf_io_ctx *nvme_ctx = map->base.ctx->dev_priv;
+	size_t offset = rq->bio->bi_iter.bi_offset;
+	size_t remaining = blk_rq_payload_bytes(rq);
+	unsigned int first = offset / NVME_CTRL_PAGE_SIZE;
+	unsigned int last = (offset + remaining - 1) / NVME_CTRL_PAGE_SIZE;
+	dma_addr_t *dma_list = map->dma_list;
+	struct scatterlist *sg;
+	unsigned int i, nents = 1;
+	dma_addr_t addr;
+	size_t len;
+	int ret;
+
+	BUILD_BUG_ON(NVME_CTRL_PAGE_SIZE != SZ_4K);
+
+	/* A reconnect may have moved the controller to another RDMA device. */
+	if (unlikely(nvme_ctx->owner != queue->device->dev))
+		return -ENODEV;
+	if (WARN_ON_ONCE(!remaining || last >= map->nr_entries))
+		return -EINVAL;
+
+	for (i = first + 1; i <= last; i++)
+		if (dma_list[i] != dma_list[i - 1] + NVME_CTRL_PAGE_SIZE)
+			nents++;
+
+	req->data_sgl.sg_table.sgl = (struct scatterlist *)(req + 1);
+	ret = sg_alloc_table_chained(&req->data_sgl.sg_table, nents,
+			req->data_sgl.sg_table.sgl, NVME_INLINE_SG_CNT);
+	if (ret)
+		return -ENOMEM;
+
+	sg = req->data_sgl.sg_table.sgl;
+	addr = dma_list[first] + (offset & (NVME_CTRL_PAGE_SIZE - 1));
+	len = min_t(size_t, remaining,
+		    NVME_CTRL_PAGE_SIZE - (offset & (NVME_CTRL_PAGE_SIZE - 1)));
+	remaining -= len;
+
+	for (i = first + 1; i <= last; i++) {
+		size_t chunk = min_t(size_t, remaining, NVME_CTRL_PAGE_SIZE);
+
+		if (dma_list[i] != addr + len) {
+			sg_dma_address(sg) = addr;
+			sg_dma_len(sg) = len;
+			sg->length = len;
+			sg = sg_next(sg);
+			addr = dma_list[i];
+			len = 0;
+		}
+		len += chunk;
+		remaining -= chunk;
+	}
+	sg_dma_address(sg) = addr;
+	sg_dma_len(sg) = len;
+	sg->length = len;
+
+	req->data_sgl.nents = nents;
+	*count = nents;
+	return 0;
+}
+
+static int nvme_rdma_map_dmabuf(struct nvme_rdma_queue *queue,
+		struct request *rq, struct nvme_command *c)
+{
+	struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
+	int count, ret;
+
+	/* No PI support for dma-buf requests yet */
+	if (req->use_sig_mr || blk_integrity_rq(rq))
+		return -EOPNOTSUPP;
+
+	ret = nvme_rdma_dma_map_dmabuf_req(queue, rq, &count);
+	if (unlikely(ret))
+		return ret;
+
+	/*
+	 * Always register a memory region, so that the target can only access
+	 * the range of the dma-buf this request covers.
+	 */
+	ret = nvme_rdma_map_sg_fr(queue, req, c, count);
+	if (unlikely(ret))
+		sg_free_table_chained(&req->data_sgl.sg_table,
+				      NVME_INLINE_SG_CNT);
+	return ret;
+}
+
 static int nvme_rdma_map_data(struct nvme_rdma_queue *queue,
 		struct request *rq, struct nvme_command *c)
 {
@@ -1572,6 +1690,9 @@ static int nvme_rdma_map_data(struct nvme_rdma_queue *queue,
 	if (!blk_rq_nr_phys_segments(rq))
 		return nvme_rdma_set_sg_null(c);
 
+	if (blk_mq_rq_is_dmabuf(rq))
+		return nvme_rdma_map_dmabuf(queue, rq, c);
+
 	ret = nvme_rdma_dma_map_req(ibdev, rq, &count, &pi_count);
 	if (unlikely(ret))
 		return ret;
@@ -2194,9 +2315,13 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown)
 	nvme_rdma_teardown_admin_queue(ctrl, shutdown);
 }
 
-static void nvme_rdma_delete_ctrl(struct nvme_ctrl *ctrl)
+static void nvme_rdma_delete_ctrl(struct nvme_ctrl *nctrl)
 {
-	nvme_rdma_shutdown_ctrl(to_rdma_ctrl(ctrl), true);
+	struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl);
+
+	nvme_rdma_shutdown_ctrl(ctrl, true);
+	/* Namespace removal has drained I/O, so detach the contexts. */
+	nvme_remove_dmabufs(&ctrl->dmabufs);
 }
 
 static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
@@ -2232,6 +2357,37 @@ static bool nvme_rdma_supports_pci_p2pdma(struct nvme_ctrl *ctrl)
 	return ib_dma_pci_p2p_dma_supported(r_ctrl->device->dev);
 }
 
+static int nvme_rdma_init_dma_buf_io_ctx(struct nvme_ctrl *nctrl,
+		struct dma_buf_io_ctx *ctx)
+{
+	struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl);
+	struct dma_buf_attachment *attach;
+	struct ib_device *ibdev;
+	int ret;
+
+	/*
+	 * Attach for the RDMA device the controller is currently connected
+	 * through. ctrl->device is valid while the context list is not dead.
+	 */
+	mutex_lock(&ctrl->dmabufs.lock);
+	if (ctrl->dmabufs.dead) {
+		ret = -ENODEV;
+		goto out_unlock;
+	}
+	ibdev = ctrl->device->dev;
+	attach = ib_dma_buf_dynamic_attach(ibdev, ctx->dmabuf,
+					   &nvme_dmabuf_importer_ops, ctx);
+	if (IS_ERR(attach)) {
+		ret = PTR_ERR(attach);
+		goto out_unlock;
+	}
+	ret = nvme_init_dma_buf_io_ctx_locked(nctrl, &ctrl->dmabufs, attach,
+					      ibdev, ctx);
+out_unlock:
+	mutex_unlock(&ctrl->dmabufs.lock);
+	return ret;
+}
+
 static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
 	.name			= "rdma",
 	.module			= THIS_MODULE,
@@ -2247,6 +2403,7 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
 	.stop_ctrl		= nvme_rdma_stop_ctrl,
 	.get_virt_boundary	= nvme_get_virt_boundary,
 	.supports_pci_p2pdma	= nvme_rdma_supports_pci_p2pdma,
+	.init_dma_buf_io_ctx	= nvme_rdma_init_dma_buf_io_ctx,
 };
 
 /*
@@ -2344,6 +2501,9 @@ static struct nvme_rdma_ctrl *nvme_rdma_alloc_ctrl(struct device *dev,
 	for (i = 0; i < ctrl->ctrl.queue_count; i++)
 		ctrl->queues[i].ctrl = ctrl;
 
+	nvme_init_buf_list(&ctrl->dmabufs);
+	ctrl->dmabufs.dead = true;
+
 	ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_rdma_ctrl_ops,
 				0 /* no quirks, we're perfect! */);
 	if (ret)
@@ -2413,7 +2573,7 @@ static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
 {
 	struct nvme_rdma_ctrl *ctrl;
 	struct nvme_rdma_device *ndev;
-	bool found = false;
+	bool found = false, need_flush;
 
 	mutex_lock(&device_list_mutex);
 	list_for_each_entry(ndev, &device_list, entry) {
@@ -2423,20 +2583,24 @@ static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
 		}
 	}
 	mutex_unlock(&device_list_mutex);
+	need_flush = found;
 
-	if (!found)
-		return;
-
-	/* Delete all controllers using this device */
+	/*
+	 * Delete controllers using this device, and controllers that
+	 * reconnected elsewhere but still have dma-bufs attached to it.
+	 */
 	mutex_lock(&nvme_rdma_ctrl_mutex);
 	list_for_each_entry(ctrl, &nvme_rdma_ctrl_list, list) {
-		if (ctrl->device->dev != ib_device)
+		if (!(found && ctrl->device->dev == ib_device) &&
+		    !nvme_dmabufs_use_owner(&ctrl->dmabufs, ib_device))
 			continue;
 		nvme_delete_ctrl(&ctrl->ctrl);
+		need_flush = true;
 	}
 	mutex_unlock(&nvme_rdma_ctrl_mutex);
 
-	flush_workqueue(nvme_delete_wq);
+	if (need_flush)
+		flush_workqueue(nvme_delete_wq);
 }
 
 static struct ib_client nvme_rdma_ib_client = {
-- 
2.25.1


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

* Re: [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach()
  2026-11-18 10:33   ` [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach() Anuj Gupta
@ 2026-11-18 11:36     ` sashiko-bot
  0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-11-18 11:36 UTC (permalink / raw)
  To: Anuj Gupta; +Cc: linux-rdma

> ULPs must not use the DMA device of an ib_device directly, but a ULP
> importing a dma-buf has to attach it to that device.
> 
> Add a helper that attaches a dma-buf to the DMA device of an ib_device.
> Devices using virtual DMA, such as rxe and siw, have no DMA device and
> are rejected with -EOPNOTSUPP.
> 
> Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118103327.1788667-1-anuj20.g@samsung.com?part=3


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

* Re: [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core
  2026-11-18 10:33   ` [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core Anuj Gupta
@ 2026-11-18 11:36     ` sashiko-bot
  0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-11-18 11:36 UTC (permalink / raw)
  To: Anuj Gupta; +Cc: linux-rdma

> From: Nitesh Shetty <nj.shetty@samsung.com>
> 
> The dma-buf I/O context handling in pci-dmabuf.c is not specific to
> PCI. Move it to nvme-core so it can be shared by other transports.
> 
> Keep the PCI-specific PRP and SGL construction in pci.c.
> 
> No functional change.
> 
> Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118103327.1788667-1-anuj20.g@samsung.com?part=1


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

* Re: [RFC 2/4] nvme: let transports provide the dma-buf attachment
  2026-11-18 10:33   ` [RFC 2/4] nvme: let transports provide the dma-buf attachment Anuj Gupta
@ 2026-11-18 11:37     ` sashiko-bot
  0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-11-18 11:37 UTC (permalink / raw)
  To: Anuj Gupta; +Cc: linux-rdma

> From: Nitesh Shetty <nj.shetty@samsung.com>
> 
> dma-bufs are currently attached to ctrl->dev by nvme-core. This works
> for nvme-pci, but fabrics transports can use a different device for
> data DMA.
> 
> Let transports create the attachment and pass it to nvme-core, which
> takes ownership of it. nvme-pci continues to attach to its PCI device.
> 
> Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118103327.1788667-1-anuj20.g@samsung.com?part=2


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

end of thread, other threads:[~2026-11-18 11:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20261118103434epcas5p4ddef3806fafdb60f309fe882e354881c@epcas5p4.samsung.com>
2026-11-18 10:33 ` [RFC 0/4] nvme-rdma: dma-buf backed I/O Anuj Gupta
2026-11-18 10:33   ` [RFC 1/4] nvme: move dma-buf I/O context handling to nvme-core Anuj Gupta
2026-11-18 11:36     ` sashiko-bot
2026-11-18 10:33   ` [RFC 2/4] nvme: let transports provide the dma-buf attachment Anuj Gupta
2026-11-18 11:37     ` sashiko-bot
2026-11-18 10:33   ` [RFC 3/4] RDMA/core: Add ib_dma_buf_dynamic_attach() Anuj Gupta
2026-11-18 11:36     ` sashiko-bot
2026-11-18 10:33   ` [RFC 4/4] nvme-rdma: support dma-buf backed requests Anuj Gupta

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