[openib-general] [PATCH] add support for ibv_query_qp(), ibv_query_srq() to libipathverbs

Ralph Campbell ralphc at pathscale.com
Tue Jun 27 15:02:18 PDT 2006


This patch adds support for ibv_query_qp() and ibv_query_srq()
to libipathverbs which are new in libibverbs.so.2.
Note that it layers on top of my previous patch.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>

Index: src/userspace/libipathverbs/src/ipathverbs.h
===================================================================
--- src/userspace/libipathverbs/src/ipathverbs.h	(old)
+++ src/userspace/libipathverbs/src/ipathverbs.h	(new)
@@ -96,6 +96,10 @@
 struct ibv_qp *ipath_create_qp(struct ibv_pd *pd,
 			       struct ibv_qp_init_attr *attr);
 
+int ipath_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
+		   enum ibv_qp_attr_mask attr_mask,
+		   struct ibv_qp_init_attr *init_attr);
+
 int ipath_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 		    enum ibv_qp_attr_mask attr_mask);
 
@@ -114,6 +118,8 @@
 		     struct ibv_srq_attr *attr, 
 		     enum ibv_srq_attr_mask attr_mask);
 
+int ipath_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *attr);
+
 int ipath_destroy_srq(struct ibv_srq *srq);
 
 
Index: src/userspace/libipathverbs/src/verbs.c
===================================================================
--- libipathverbs/src/verbs.c	(old)
+++ libipathverbs/src/verbs.c	(new)
@@ -40,7 +40,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 #include <pthread.h>
 #include <netinet/in.h>
 
@@ -193,6 +193,16 @@
 	return qp;
 }
 
+int ipath_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
+		   enum ibv_qp_attr_mask attr_mask,
+		   struct ibv_qp_init_attr *init_attr)
+{
+	struct ibv_query_qp cmd;
+
+	return ibv_cmd_query_qp(qp, attr, attr_mask, init_attr,
+				&cmd, sizeof cmd);
+}
+
 int ipath_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 		    enum ibv_qp_attr_mask attr_mask)
 {
@@ -244,6 +254,13 @@
 	return ibv_cmd_modify_srq(srq, attr, attr_mask, &cmd, sizeof cmd);
 }
 
+int ipath_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *attr)
+{
+	struct ibv_query_srq cmd;
+
+	return ibv_cmd_query_srq(srq, attr, &cmd, sizeof cmd);
+}
+
 int ipath_destroy_srq(struct ibv_srq *srq)
 {
 	int ret;






More information about the general mailing list