aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLang Cheng <[email protected]>2020-05-08 17:45:56 +0800
committerJason Gunthorpe <[email protected]>2020-05-19 20:54:58 -0300
commit7b611d2f6e8b99b699996c52b823454f4a74978f (patch)
tree04e123f04b6ed05e853cb76eeb2934ea5fe751c8
parentd4d813874156063eae6542c66da2a6971592e46f (diff)
RDMA/hns: Store mr len information into mr obj
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. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lang Cheng <[email protected]> Signed-off-by: Weihang Li <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_mr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index ecd76759d47a..f727b1875af8 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;