aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_qp.c
diff options
context:
space:
mode:
authorYangyang Li <liyangyang20@huawei.com>2018-12-18 21:21:54 +0800
committerJason Gunthorpe <jgg@mellanox.com>2019-01-24 09:22:30 -0700
commitaa84fa18741b83daf0f8f160c46ae92f4d6f1343 (patch)
tree2734efc9879e24fc0c171197dcb74e4bd0d9d6c0 /drivers/infiniband/hw/hns/hns_roce_qp.c
parentRDMA/hns: Add SCC context allocation support for hip08 (diff)
downloadlinux-dev-aa84fa18741b83daf0f8f160c46ae92f4d6f1343.tar.xz
linux-dev-aa84fa18741b83daf0f8f160c46ae92f4d6f1343.zip
RDMA/hns: Add SCC context clr support for hip08
This patch adds SCC context clear support for DCQCN in kernel space driver. Signed-off-by: Yangyang Li <liyangyang20@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_qp.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_qp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
index dc9a30e3b7ce..73066bf38e47 100644
--- a/drivers/infiniband/hw/hns/hns_roce_qp.c
+++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
@@ -811,6 +811,13 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
if (ret)
goto err_qp;
}
+
+ if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_FLOW_CTRL) {
+ ret = hr_dev->hw->qp_flow_control_init(hr_dev, hr_qp);
+ if (ret)
+ goto err_qp;
+ }
+
hr_qp->event = hns_roce_ib_qp_event;
return 0;
@@ -1152,6 +1159,7 @@ int hns_roce_init_qp_table(struct hns_roce_dev *hr_dev)
int reserved_from_bot;
int ret;
+ mutex_init(&qp_table->scc_mutex);
spin_lock_init(&qp_table->lock);
INIT_RADIX_TREE(&hr_dev->qp_table_tree, GFP_ATOMIC);