From 102a2b871dba4b496d019398dd00248c340869f7 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Thu, 22 Dec 2011 00:14:12 -0800 Subject: [PATCH] libibverbs: Support both OFED verbs and ibverbs From: Sean Hefty 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 --- Makefile.am | 5 +++-- include/infiniband/verbs.h | 8 ++++++++ src/libibverbs.map | 10 ++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index ee86c70..e1d3ac4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index a499a50..1dcd17f 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -39,6 +39,10 @@ #include #include +#ifdef OFED_VERBS +#include +#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 +#endif /* OFED_VERBS */ + #endif /* INFINIBAND_VERBS_H */ diff --git a/src/libibverbs.map b/src/libibverbs.map index efd6712..558bc69 100644 --- a/src/libibverbs.map +++ b/src/libibverbs.map @@ -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; -- 2.46.0