]> git.openfabrics.org - ~shefty/libibverbs.git/commit
Add ABI compatibility for apps linked against libibverbs 1.0
authorRoland Dreier <rolandd@cisco.com>
Mon, 29 Jan 2007 17:22:18 +0000 (09:22 -0800)
committerRoland Dreier <rolandd@cisco.com>
Mon, 29 Jan 2007 17:22:18 +0000 (09:22 -0800)
commitfd448acccecab2740b7f35f1fadc64fae6d6b9d3
tree510ea458030eb555e3b180460a85c63170bc4257
parent8b3d225476c99ea29a68109a7d40e5ef353d4388
Add ABI compatibility for apps linked against libibverbs 1.0

Add a compatibility layer that allows applications (but not low-level
drivers) linked against libibverbs 1.0 to work with libibverbs 1.1.
This is done by using Linux's versioned symbol linking support: the
native libibverbs entry points are given IBVERBS_1.1 versions, and
compatibility wrappers for entry points from libibverbs 1.0 are
created with an IBVERBS_1.0 version (to match what libibverbs 1.0
exported).

In essense these wrappers create compatible proxies for every
structure returned to the application (struct ibv_device, ibv_context,
ibv_pd, etc), and map between the proxy and the real object when the
application calls into libibverbs.  This code is mostly
straightforward, with a few complications in handling async events,
because the pointers in event structures must be translated back to
proxy structures when they are returned to the application.

There are a few further wrinkles because the calls to data path
functions (poll CQ, post send, etc) are actually inline functions that
call directly into the context ops, so the context ops proxy structure
must actually contain pointers to compatibility wrappers for these
functions as well.  This may have some performance impact but it seems
the overhead is unavoidable, and tests with NetPIPE on top of Open MPI
shows that the latency and throughput differences seem to be lost in
the noise anyway.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Makefile.am
configure.in
src/compat-1_0.c [new file with mode: 0644]
src/device.c
src/ibverbs.h
src/libibverbs.map
src/verbs.c