Skip to content

Commit

Permalink
RDMA/hns: Store mr len information into mr obj
Browse files Browse the repository at this point in the history
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/1588931159-56875-7-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Lang Cheng authored and Jason Gunthorpe committed May 19, 2020
1 parent d4d8138 commit 7b611d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/hns/hns_roce_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 7b611d2

Please sign in to comment.