diff options
author | Yangyang Li <liyangyang20@huawei.com> | 2021-06-10 13:50:14 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-21 20:42:54 +0200 |
commit | da43b7bebc3504f232b0849c04b787ca1544bee2 (patch) | |
tree | 80c03d0f26d6898de04a8524db33ed6d1854f9dc /drivers/infiniband/hw/hns/hns_roce_main.c | |
parent | RDMA/hns: Use IDA interface to manage pd index (diff) | |
download | linux-da43b7bebc3504f232b0849c04b787ca1544bee2.tar.xz linux-da43b7bebc3504f232b0849c04b787ca1544bee2.zip |
RDMA/hns: Use IDA interface to manage xrcd index
Switch xrcd index allocation and release from hns own bitmap interface
to IDA interface.
Link: https://lore.kernel.org/r/1623325814-55737-7-git-send-email-liweihang@huawei.com
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_main.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_main.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 0e558b537569..2d79cf64008b 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -750,14 +750,8 @@ static int hns_roce_setup_hca(struct hns_roce_dev *hr_dev) hns_roce_init_pd_table(hr_dev); - if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC) { - ret = hns_roce_init_xrcd_table(hr_dev); - if (ret) { - dev_err(dev, "failed to init xrcd table, ret = %d.\n", - ret); - goto err_pd_table_free; - } - } + if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC) + hns_roce_init_xrcd_table(hr_dev); hns_roce_init_mr_table(hr_dev); @@ -788,9 +782,8 @@ err_cq_table_free: ida_destroy(&hr_dev->mr_table.mtpt_ida.ida); if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC) - hns_roce_cleanup_xrcd_table(hr_dev); + ida_destroy(&hr_dev->xrcd_ida.ida); -err_pd_table_free: ida_destroy(&hr_dev->pd_ida.ida); hns_roce_uar_free(hr_dev, &hr_dev->priv_uar); |