summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_srq.c
diff options
context:
space:
mode:
authorLijun Ou <oulijun@huawei.com>2018-11-24 16:49:20 +0800
committerJason Gunthorpe <jgg@mellanox.com>2018-12-05 07:59:13 -0700
commit5c1f167af112746eb97621f12b4053d4f66c0357 (patch)
treeeac9ef7cd402bf2f801ba986c4f1b090afa637d5 /drivers/infiniband/hw/hns/hns_roce_srq.c
parentd16da11992d44fb54d99b71408b201311d81e0af (diff)
downloadtalos-op-linux-5c1f167af112746eb97621f12b4053d4f66c0357.tar.gz
talos-op-linux-5c1f167af112746eb97621f12b4053d4f66c0357.zip
RDMA/hns: Init SRQ table for hip08
This patch inits hem resource for SRQ table, includes SRQWQE and SRQWQE index resource. Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_srq.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_srq.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_srq.c b/drivers/infiniband/hw/hns/hns_roce_srq.c
new file mode 100644
index 000000000000..d8a86130febe
--- /dev/null
+++ b/drivers/infiniband/hw/hns/hns_roce_srq.c
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
+/*
+ * Copyright (c) 2018 Hisilicon Limited.
+ */
+
+#include <rdma/ib_umem.h>
+#include <rdma/hns-abi.h>
+#include "hns_roce_device.h"
+#include "hns_roce_cmd.h"
+#include "hns_roce_hem.h"
+
+int hns_roce_init_srq_table(struct hns_roce_dev *hr_dev)
+{
+ struct hns_roce_srq_table *srq_table = &hr_dev->srq_table;
+
+ xa_init(&srq_table->xa);
+
+ return hns_roce_bitmap_init(&srq_table->bitmap, hr_dev->caps.num_srqs,
+ hr_dev->caps.num_srqs - 1,
+ hr_dev->caps.reserved_srqs, 0);
+}
+
+void hns_roce_cleanup_srq_table(struct hns_roce_dev *hr_dev)
+{
+ hns_roce_bitmap_cleanup(&hr_dev->srq_table.bitmap);
+}
OpenPOWER on IntegriCloud