OSDN Git Service

RDMA/hns: Fix the issue of IOVA not page continuous in hip08
authorWei Hu\(Xavier\) <xavier.huwei@huawei.com>
Tue, 28 Nov 2017 07:10:26 +0000 (15:10 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 1 Dec 2017 19:21:27 +0000 (12:21 -0700)
commitdb270c41900d39a388990701da3ee2971094ebaa
tree27d0238a54c46ab323a7031a0fd8ffc6962c0d8a
parenta9cd1a673737dd81332fce1145801bfacfb90d90
RDMA/hns: Fix the issue of IOVA not page continuous in hip08

If the smmu is enabled, the length of sg obtained from
__iommu_map_sg_attrs is not 4kB. When the IOVA is set with the sg
dma address, the IOVA will not be page continuous. so, the current
code has MTPT configuration error that probably cause dma operation
failure. In order to fix this issue, the IOVA should be calculated
based on the sg length.

Fixes: 3958cc5("RDMA/hns: Configure the MTPT in hip08")
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Xiping Zhang (Francis) <zhangxiping3@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c