RDMA/hns: Optimize the usage of MTR
authorXi Wang <wangxi11@huawei.com>
Wed, 20 May 2020 13:53:19 +0000 (21:53 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 25 May 2020 17:02:13 +0000 (14:02 -0300)
commit8e029d386bcef651bb89091c8a48375c2506aefe
treed58be10d0440337fd98884b59e05123294046da3
parent494c3b312255a39d4450f37ec2e675f142a76c8c
RDMA/hns: Optimize the usage of MTR

Currently, the MTR region is configed before hns_roce_mtr_map() is
invoked, but in some scenarios, the region is configed at MTR creation,
the caller need to store this config and call hns_roce_mtr_map() later. So
optimize the usage by wrapping the MTR region config into MTR.

Link: https://lore.kernel.org/r/1589982799-28728-10-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_mr.c