提交 5b4fa4b4 编写于 作者: W Weihang Li 提交者: Xie XiuQi

RDMA/hns: use page shift of umem instead of constant page shift

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

User application would set page shift of umem, and expect to use
this value during create mr.

Feature or Bugfix: Bugfix
Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4089a51b
......@@ -2440,7 +2440,7 @@ static int set_mtpt_pbl(struct hns_roce_v2_mpt_entry *mpt_entry,
i = 0;
for_each_sg(mr->umem->sg_head.sgl, sg, mr->umem->nmap, entry) {
len = sg_dma_len(sg) >> PAGE_SHIFT;
len = sg_dma_len(sg) >> mr->umem->page_shift;
for (j = 0; j < len; ++j) {
page_addr = sg_dma_address(sg) +
(j << mr->umem->page_shift);
......
......@@ -1128,7 +1128,7 @@ int hns_roce_ib_umem_write_mr(struct hns_roce_dev *hr_dev,
pbl_bt_sz = 1 << (hr_dev->caps.pbl_ba_pg_sz + PAGE_SHIFT);
for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) {
len = sg_dma_len(sg) >> PAGE_SHIFT;
len = sg_dma_len(sg) >> umem->page_shift;
for (k = 0; k < len; ++k) {
page_addr = sg_dma_address(sg) +
(k << umem->page_shift);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册