diff options
author | Wei Hu(Xavier) <xavier.huwei@huawei.com> | 2017-08-30 17:23:04 +0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-09-27 08:34:55 -0400 |
commit | cfc85f3e4b7f9f2d66d0816e3121c4c8fcde1448 (patch) | |
tree | 14e231fa98af540b5530a517c0c75547395a7078 /drivers/infiniband/hw/hns/hns_roce_main.c | |
parent | a04ff739f2a93d0564a5c71bfb3f459a3c06dbb8 (diff) |
RDMA/hns: Add profile support for hip08 driver
The profile's content mainly set some specifications and obtain
some hardware resources by implementing the relative commands.
Because max sge num of send queue is not the same with receive
queue in hip08, we modified the calculation of props->max_sge
in query_device ops.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_main.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 4f5a6fd7219d..db6593e15e02 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -202,7 +202,7 @@ static int hns_roce_query_device(struct ib_device *ib_dev, props->max_qp_wr = hr_dev->caps.max_wqes; props->device_cap_flags = IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_RC_RNR_NAK_GEN; - props->max_sge = hr_dev->caps.max_sq_sg; + props->max_sge = max(hr_dev->caps.max_sq_sg, hr_dev->caps.max_rq_sg); props->max_sge_rd = 1; props->max_cq = hr_dev->caps.num_cqs; props->max_cqe = hr_dev->caps.max_cqes; @@ -686,7 +686,11 @@ int hns_roce_init(struct hns_roce_dev *hr_dev) } } - hr_dev->hw->hw_profile(hr_dev); + ret = hr_dev->hw->hw_profile(hr_dev); + if (ret) { + dev_err(dev, "Get RoCE engine profile failed!\n"); + goto error_failed_cmd_init; + } ret = hns_roce_cmd_init(hr_dev); if (ret) { |