diff mbox series

[for-next,6/9] RDMA/hns: Store mr len information into mr obj

Message ID 1588931159-56875-7-git-send-email-liweihang@huawei.com (mailing list archive)
State Mainlined
Commit 7b611d2f6e8b99b699996c52b823454f4a74978f
Delegated to: Jason Gunthorpe
Headers show
Series RDMA/hns: Various fixes and cleanups | expand

Commit Message

Weihang Li May 8, 2020, 9:45 a.m. UTC
From: Lang Cheng <chenglang@huawei.com>

The length information should be stored in the struct ib_mr object,
otherwise the length value of a valid mr object would always be 0.

Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_mr.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index ecd7675..f727b18 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -285,6 +285,7 @@  struct ib_mr *hns_roce_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
 		goto err_alloc_pbl;
 
 	mr->ibmr.rkey = mr->ibmr.lkey = mr->key;
+	mr->ibmr.length = length;
 
 	return &mr->ibmr;
 
@@ -451,6 +452,7 @@  struct ib_mr *hns_roce_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
 		goto err_pbl;
 
 	mr->ibmr.rkey = mr->ibmr.lkey = mr->key;
+	mr->ibmr.length = length;
 
 	return &mr->ibmr;