diff mbox series

[rdma-core,3/6] libhns: Add query srq verb for hip08 user mode

Message ID 1540637797-97065-4-git-send-email-oulijun@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series SRQ support for hip08 user space | expand

Commit Message

Lijun Ou Oct. 27, 2018, 10:56 a.m. UTC
This patch mainly implement the verbs of querying srq
for hip08 userspace library.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 providers/hns/hns_roce_u.c       | 1 +
 providers/hns/hns_roce_u.h       | 1 +
 providers/hns/hns_roce_u_verbs.c | 7 +++++++
 3 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c
index 81b74f3..9b46e25 100644
--- a/providers/hns/hns_roce_u.c
+++ b/providers/hns/hns_roce_u.c
@@ -80,6 +80,7 @@  static const struct verbs_context_ops hns_common_ops = {
 	.rereg_mr = hns_roce_u_rereg_mr,
 	.create_srq = hns_roce_u_create_srq,
 	.modify_srq = hns_roce_u_modify_srq,
+	.query_srq = hns_roce_u_query_srq,
 };
 
 static struct verbs_context *hns_roce_alloc_context(struct ibv_device *ibdev,
diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h
index dd9ba88..2b307e3 100644
--- a/providers/hns/hns_roce_u.h
+++ b/providers/hns/hns_roce_u.h
@@ -305,6 +305,7 @@  struct ibv_srq *hns_roce_u_create_srq(struct ibv_pd *pd,
 				      struct ibv_srq_init_attr *srq_init_attr);
 int hns_roce_u_modify_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr,
 			  int srq_attr_mask);
+int hns_roce_u_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr);
 struct ibv_qp *hns_roce_u_create_qp(struct ibv_pd *pd,
 				    struct ibv_qp_init_attr *attr);
 
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
index 379d78d..5106a35 100644
--- a/providers/hns/hns_roce_u_verbs.c
+++ b/providers/hns/hns_roce_u_verbs.c
@@ -589,6 +589,13 @@  int hns_roce_u_modify_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr,
 				  sizeof(cmd));
 }
 
+int hns_roce_u_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr)
+{
+	struct ibv_query_srq cmd;
+
+	return ibv_cmd_query_srq(srq, srq_attr, &cmd, sizeof(cmd));
+}
+
 static int hns_roce_verify_qp(struct ibv_qp_init_attr *attr,
 			      struct hns_roce_context *context)
 {