[ofw] [PATCH] libibverbs: update interface to 1.1.12

Hefty, Sean sean.hefty at intel.com
Tue Jun 29 14:50:29 PDT 2010


libibverbs interfaces are at 1.1.8.  Update to 1.1.12.

This converts some enum's in the API to int's, plus adds definitions
for path record data to a new header file for windows, sa.h.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
 trunk/ulp/libibverbs/include/infiniband/sa.h    |   98 +++++++++++++++++++++++
 trunk/ulp/libibverbs/include/infiniband/verbs.h |   18 ++--
 trunk/ulp/libibverbs/src/verbs.cpp              |   10 +-
 trunk/ulp/librdmacm/include/rdma/rdma_cma.h     |    6 -
 4 files changed, 113 insertions(+), 19 deletions(-)
 create mode 100644 trunk/ulp/libibverbs/include/infiniband/sa.h

diff --git a/trunk/ulp/libibverbs/include/infiniband/sa.h b/trunk/ulp/libibverbs/include/infiniband/sa.h
new file mode 100644
index 0000000..0f427f3
--- /dev/null
+++ b/trunk/ulp/libibverbs/include/infiniband/sa.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2004 Topspin Communications.  All rights reserved.
+ * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2010 Intel.  All rights reserved.
+ *
+ * This software is available to you under the OpenFabrics.org BSD license
+ * below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef INFINIBAND_SA_H
+#define INFINIBAND_SA_H
+
+#include <infiniband/verbs.h>
+
+struct ibv_sa_path_rec {
+	/* reserved */
+	/* reserved */
+	union ibv_gid dgid;
+	union ibv_gid sgid;
+	uint16_t      dlid;
+	uint16_t      slid;
+	int           raw_traffic;
+	/* reserved */
+	uint32_t      flow_label;
+	uint8_t       hop_limit;
+	uint8_t       traffic_class;
+	int           reversible;
+	uint8_t       numb_path;
+	uint16_t      pkey;
+	/* reserved */
+	uint8_t       sl;
+	uint8_t       mtu_selector;
+	uint8_t	      mtu;
+	uint8_t       rate_selector;
+	uint8_t       rate;
+	uint8_t       packet_life_time_selector;
+	uint8_t       packet_life_time;
+	uint8_t       preference;
+};
+
+#define IBV_PATH_RECORD_REVERSIBLE 0x80
+
+struct ibv_path_record {
+	uint64_t		service_id;
+	union ibv_gid	dgid;
+	union ibv_gid	sgid;
+	uint16_t		dlid;
+	uint16_t		slid;
+	uint32_t		flowlabel_hoplimit; /* resv-31:28 flow label-27:8 hop limit-7:0*/
+	uint8_t			tclass;
+	uint8_t			reversible_numpath; /* reversible-7:7 num path-6:0 */
+	uint16_t		pkey;
+	uint16_t		qosclass_sl;	    /* qos class-15:4 sl-3:0 */
+	uint8_t			mtu;		    /* mtu selector-7:6 mtu-5:0 */
+	uint8_t			rate;		    /* rate selector-7:6 rate-5:0 */
+	uint8_t			packetlifetime;	    /* lifetime selector-7:6 lifetime-5:0 */
+	uint8_t			preference;
+	uint8_t			reserved[6];
+};
+
+#define IBV_PATH_FLAG_GMP	          (1<<0)
+#define IBV_PATH_FLAG_PRIMARY	      (1<<1)
+#define IBV_PATH_FLAG_ALTERNATE       (1<<2)
+#define IBV_PATH_FLAG_OUTBOUND	      (1<<3)
+#define IBV_PATH_FLAG_INBOUND	      (1<<4)
+#define IBV_PATH_FLAG_INBOUND_REVERSE (1<<5)
+#define IBV_PATH_FLAG_BIDIRECTIONAL   (IBV_PATH_FLAG_OUTBOUND |     \
+									   IBV_PATH_FLAG_INBOUND_REVERSE)
+
+struct ibv_path_data {
+	uint32_t				flags;
+	uint32_t				reserved;
+	struct ibv_path_record	path;
+};
+
+#endif /* INFINIBAND_SA_H */
diff --git a/trunk/ulp/libibverbs/include/infiniband/verbs.h b/trunk/ulp/libibverbs/include/infiniband/verbs.h
index 25584e5..2fd0a0c 100644
--- a/trunk/ulp/libibverbs/include/infiniband/verbs.h
+++ b/trunk/ulp/libibverbs/include/infiniband/verbs.h
@@ -45,7 +45,7 @@ extern "C" {
 #endif
 
 /*
- * Interfaces based on libibverbs 1.1.2.
+ * Interfaces based on libibverbs 1.1.4.
  */
 
 typedef unsigned __int8		uint8_t;
@@ -294,7 +294,7 @@ struct ibv_wc
 	uint32_t			vendor_err;
 	enum ibv_wc_status	status;
 
-	enum ibv_wc_flags	wc_flags;
+	int					wc_flags;
 	uint32_t			imm_data;	/* in network byte order */
 	uint32_t			src_qp;
 	uint16_t			pkey_index;
@@ -563,7 +563,7 @@ struct ibv_send_wr
 	struct ibv_sge			*sg_list;
 	int						num_sge;
 	enum ibv_wr_opcode		opcode;
-	enum ibv_send_flags		send_flags;
+	int						send_flags;
 	uint32_t				imm_data;	/* in network byte order */
 	union
 	{
@@ -606,8 +606,8 @@ struct ibv_mw_bind
 	struct ibv_mr			*mr;
 	void					*addr;
 	size_t					length;
-	enum ibv_send_flags		send_flags;
-	enum ibv_access_flags	mw_access_flags;
+	int						send_flags;
+	int						mw_access_flags;
 };
 
 struct ibv_srq
@@ -800,7 +800,7 @@ int ibv_dealloc_pd(struct ibv_pd *pd);
  */
 __declspec(dllexport)
 struct ibv_mr *ibv_reg_mr(struct ibv_pd *pd, void *addr,
-						  size_t length, enum ibv_access_flags access);
+						  size_t length, int access);
 
 /**
  * ibv_dereg_mr - Deregister a memory region
@@ -939,7 +939,7 @@ struct ibv_srq *ibv_create_srq(struct ibv_pd *pd,
 __declspec(dllexport)
 int ibv_modify_srq(struct ibv_srq *srq,
 				   struct ibv_srq_attr *srq_attr,
-				   enum ibv_srq_attr_mask srq_attr_mask);
+				   int srq_attr_mask);
 
 /**
  * ibv_query_srq - Returns the attribute list and current values for the
@@ -981,7 +981,7 @@ struct ibv_qp *ibv_create_qp(struct ibv_pd *pd,
  */
 __declspec(dllexport)
 int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
-				  enum ibv_qp_attr_mask attr_mask);
+				  int attr_mask);
 
 /**
  * ibv_query_qp - Returns the attribute list and current values for the
@@ -996,7 +996,7 @@ int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
  */
 __declspec(dllexport)
 int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
-				 enum ibv_qp_attr_mask attr_mask,
+				 int attr_mask,
 				 struct ibv_qp_init_attr *init_attr);
 
 /**
diff --git a/trunk/ulp/libibverbs/src/verbs.cpp b/trunk/ulp/libibverbs/src/verbs.cpp
index 8aa407d..3a22e95 100644
--- a/trunk/ulp/libibverbs/src/verbs.cpp
+++ b/trunk/ulp/libibverbs/src/verbs.cpp
@@ -278,7 +278,7 @@ int ibv_dealloc_pd(struct ibv_pd *pd)
 
 __declspec(dllexport)
 struct ibv_mr *ibv_reg_mr(struct ibv_pd *pd, void *addr,
-						  size_t length, enum ibv_access_flags access)
+						  size_t length, int access)
 {
 	struct ibv_mr *mr;
 	HRESULT hr;
@@ -494,7 +494,7 @@ struct ibv_srq *ibv_create_srq(struct ibv_pd *pd,
 __declspec(dllexport)
 int ibv_modify_srq(struct ibv_srq *srq,
 				   struct ibv_srq_attr *srq_attr,
-				   enum ibv_srq_attr_mask srq_attr_mask)
+				   int srq_attr_mask)
 {
 	ibv_srq_attr attr;
 
@@ -604,7 +604,7 @@ struct ibv_qp *ibv_create_qp(struct ibv_pd *pd,
 	/* qp_num set by ibv_query_qp */
 	qp->qp_type = qp_init_attr->qp_type;
 
-	hr = ibv_query_qp(qp, &attr, (enum ibv_qp_attr_mask) 0xFFFFFFFF, qp_init_attr);
+	hr = ibv_query_qp(qp, &attr, 0xFFFFFFFF, qp_init_attr);
 	if (FAILED(hr)) {
 		goto err;
 	}
@@ -618,7 +618,7 @@ err:
 
 __declspec(dllexport)
 int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
-				 enum ibv_qp_attr_mask attr_mask,
+				 int attr_mask,
 				 struct ibv_qp_init_attr *init_attr)
 {
 	WV_QP_ATTRIBUTES wv_attr;
@@ -677,7 +677,7 @@ int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 
 __declspec(dllexport)
 int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
-				  enum ibv_qp_attr_mask attr_mask)
+				  int attr_mask)
 {
 	WV_QP_ATTRIBUTES wv_attr;
 	HRESULT hr;
diff --git a/trunk/ulp/librdmacm/include/rdma/rdma_cma.h b/trunk/ulp/librdmacm/include/rdma/rdma_cma.h
index 0fd481c..0c9d305 100644
--- a/trunk/ulp/librdmacm/include/rdma/rdma_cma.h
+++ b/trunk/ulp/librdmacm/include/rdma/rdma_cma.h
@@ -34,6 +34,7 @@
 
 #include <windows.h>
 #include <infiniband\verbs.h>
+#include <infiniband\sa.h>
 #include <rdma\winverbs.h>
 
 #ifdef __cplusplus
@@ -104,11 +105,6 @@ struct rdma_addr
 	}	addr;
 };
 
-struct ibv_sa_path_rec
-{
-	uint8_t				data[64];
-};
-
 struct rdma_route
 {
 	struct rdma_addr		addr;




More information about the ofw mailing list