RDMA/hns: Refactor hem table mhop check and calculation
authorLijun Ou <oulijun@huawei.com>
Mon, 8 Jul 2019 13:41:24 +0000 (21:41 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 25 Jul 2019 15:23:11 +0000 (12:23 -0300)
commitd7019c0f47ae497bae27be5397287ca72c704bf4
tree890c2896ba81080f34cfb54f93d280431c9f9a6d
parent3ee0e170d72c05172b0aa4e46d58795fdc19081e
RDMA/hns: Refactor hem table mhop check and calculation

The calculation of mhop for hem is duplicated in hns_roce_init_hem_table
and hns_roce_calc_hem_mhop, extracting it from them to a separate
function. Moreover, this patch refactors hns_roce_check_whether_mhop to
reduce complexity.

Link: https://lore.kernel.org/r/1562593285-8037-9-git-send-email-oulijun@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hem.c