RDMA/hns: Fix PBL page MTR find
authorChengchang Tang <tangchengchang@huawei.com>
Sat, 26 Nov 2022 10:29:08 +0000 (18:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:37 +0000 (13:32 +0100)
commitaaa589124d4c7e38a2cf198b96ad24a4ab4b0138
treeb7f77c0c2cd045176ff111ab54fc236056c1c4d7
parentd3238c4d3a4614048b2efe109ba2294ae2a8f605
RDMA/hns: Fix PBL page MTR find

[ Upstream commit 9fb39ef2ff3e18f1740625ba04093dfbef086d2b ]

Now, The address of the first two pages in the MR will be searched, which
use to speed up the lookup of the pbl table for hardware.  An exception
will occur when there is only one page in this MR.  This patch fix the
number of page to search.

Fixes: 9b2cf76c9f05 ("RDMA/hns: Optimize PBL buffer allocation process")
Link: https://lore.kernel.org/r/20221126102911.2921820-4-xuhaoyue1@hisilicon.com
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c