aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_main.c
diff options
context:
space:
mode:
authorLijun Ou <oulijun@huawei.com>2018-11-24 16:49:21 +0800
committerJason Gunthorpe <jgg@mellanox.com>2018-12-05 07:59:13 -0700
commitc7bcb13442e1bd8a4cc41c74540dd2e2f7058d16 (patch)
tree301ae2312829b4db8f8d9eba2d5ad8cd647f4ecc /drivers/infiniband/hw/hns/hns_roce_main.c
parentRDMA/hns: Init SRQ table for hip08 (diff)
downloadlinux-dev-c7bcb13442e1bd8a4cc41c74540dd2e2f7058d16.tar.xz
linux-dev-c7bcb13442e1bd8a4cc41c74540dd2e2f7058d16.zip
RDMA/hns: Add SRQ support for hip08 kernel mode
This patch implements the SRQ(Share Receive Queue) verbs and update the poll cq verbs to deal with SRQ complentions. 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_main.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index d183f13d206f..65ba43cee810 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -546,6 +546,21 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
ib_dev->map_mr_sg = hns_roce_map_mr_sg;
}
+ /* SRQ */
+ if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ) {
+ ib_dev->create_srq = hns_roce_create_srq;
+ ib_dev->modify_srq = hr_dev->hw->modify_srq;
+ ib_dev->query_srq = hr_dev->hw->query_srq;
+ ib_dev->destroy_srq = hns_roce_destroy_srq;
+ ib_dev->post_srq_recv = hr_dev->hw->post_srq_recv;
+ ib_dev->uverbs_cmd_mask |=
+ (1ULL << IB_USER_VERBS_CMD_CREATE_SRQ) |
+ (1ULL << IB_USER_VERBS_CMD_MODIFY_SRQ) |
+ (1ULL << IB_USER_VERBS_CMD_QUERY_SRQ) |
+ (1ULL << IB_USER_VERBS_CMD_DESTROY_SRQ) |
+ (1ULL << IB_USER_VERBS_CMD_POST_SRQ_RECV);
+ }
+
/* OTHERS */
ib_dev->get_port_immutable = hns_roce_port_immutable;
ib_dev->disassociate_ucontext = hns_roce_disassociate_ucontext;