Skip to contentSkip to conversation

RDMA/uverbs: Track dmabuf memory regions

PATCH Applied Gal Pressman 3 participants 3 messages Aug 12, 2021 – Aug 19, 2021 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/uverbs: Track dmabuf memory regions

The dmabuf memory registrations are missing the restrack handling and hence do not appear in rdma tool.

Fixes bfe0cc6eb249 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration")
---
 drivers/infiniband/core/uverbs_std_types_mr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/infiniband/core/uverbs_std_types_mr.c +3 -0
index f782d5e1aa25..03e1db5d1e8c 100644
@@ -249,6 +249,9 @@ static int UVERBS_HANDLER(UVERBS_METHOD_REG_DMABUF_MR)(
 	mr->uobject = uobj;
 	atomic_inc(&pd->usecnt);
 
+	rdma_restrack_new(&mr->res, RDMA_RESTRACK_MR);
+	rdma_restrack_set_name(&mr->res, NULL);
+	rdma_restrack_add(&mr->res);
 	uobj->object = mr;
 
 	uverbs_finalize_uobj_create(attrs, UVERBS_ATTR_REG_DMABUF_MR_HANDLE);
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gal Pressman

The dmabuf memory registrations are missing the restrack handling and hence do not appear in rdma tool.

Fixes bfe0cc6eb249 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration")
---
 drivers/infiniband/core/uverbs_std_types_mr.c | 3 +++
 1 file changed, 3 insertions(+)

Thanks,

maintainer Applied
#2 lore raw
In reply to Gal Pressman
Quoted 9 lines · Gal Pressman

The dmabuf memory registrations are missing the restrack handling and hence do not appear in rdma tool.

Fixes bfe0cc6eb249 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration")
---
 drivers/infiniband/core/uverbs_std_types_mr.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to for-rc, thanks

Jason