]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
libibverbs: Support both OFED verbs and ibverbs
authorSean Hefty <sean.hefty@intel.com>
Thu, 22 Dec 2011 08:14:12 +0000 (00:14 -0800)
committerSean Hefty <sean.hefty@intel.com>
Thu, 22 Dec 2011 08:14:12 +0000 (00:14 -0800)
From: Sean Hefty <sean.hefty@intel.com>

This patch allows libibverbs to support both libibverbs API that
shipped with OFED 1.5 and the upstream libibverbs API.  This
supports existing apps that are compiled against the upstream
libibverbs (ibverbs).  And in ideal cases, an application
coded to the OFED version of libibverbs (ofverbs) would only
need to be recompiled with 'CFLAGS=-DOFED_VERBS' given as a
configuration option.

Support for OFED verbs is done using macros that convert the OFED
APIs to ibverbs APIs.  In most cases, simple data casts are all
that are necessary, with XRC support being the primary exception.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Makefile.am
include/infiniband/verbs.h
src/libibverbs.map

index ee86c70c5a343ec75a59d838d2c91962339b1fdc..e1d3ac4c78e9dfbb24179866c1b79eedfe542646 100644 (file)
@@ -11,7 +11,7 @@ libibverbs_version_script = @LIBIBVERBS_VERSION_SCRIPT@
 
 src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
                            src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
-                           src/enum_strs.c
+                           src/enum_strs.c src/ofverbs.c
 src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic \
     $(libibverbs_version_script)
 src_libibverbs_la_DEPENDENCIES = $(srcdir)/src/libibverbs.map
@@ -40,7 +40,8 @@ libibverbsincludedir = $(includedir)/infiniband
 
 libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
     include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
-    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
+    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h \
+    include/infiniband/ofverbs.h include/infiniband/ofverbs-defs.h
 
 man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1    \
     man/ibv_rc_pingpong.1 man/ibv_uc_pingpong.1 man/ibv_ud_pingpong.1  \
index a499a50c84db286b07ffa0559d779798be3d254a..1dcd17ffb25bbc1ebb52046c9c93f419c6de5a32 100644 (file)
 #include <stdint.h>
 #include <pthread.h>
 
+#ifdef OFED_VERBS
+#include <infiniband/ofverbs-defs.h>
+#endif /* OFED_VERBS */
+
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
 #  define END_C_DECLS   }
@@ -1245,4 +1249,8 @@ END_C_DECLS
 #  undef __attribute_const
 
 
+#ifdef OFED_VERBS
+#include <infiniband/ofverbs.h>
+#endif /* OFED_VERBS */
+
 #endif /* INFINIBAND_VERBS_H */
index efd671286f263d447de2cf91af409755d78c2c9a..558bc6983192f455007d0fa3462f20fc3728019a 100644 (file)
@@ -110,4 +110,14 @@ IBVERBS_1.1 {
                ibv_create_xsrq;
                ibv_cmd_open_qp;
                ibv_open_qp;
+
+               ofv_get_async_event;
+               ofv_ack_async_event;
+               ofv_open_xrc_domain;
+               ofv_close_xrc_domain;
+               ofv_create_xrc_rcv_qp;
+               ofv_modify_xrc_rcv_qp;
+               ofv_query_xrc_rcv_qp;
+               ofv_reg_xrc_rcv_qp;
+               ofv_unreg_xrc_rcv_qp;
 } IBVERBS_1.0;