[Pkg-ofed-commits] [librdmacm] 10/18: Imported Upstream version 1.0.14

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Wed Jul 2 13:58:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository librdmacm.

commit 469d81714ae161bff1dc450a93e008b8c7764475
Author: Ana Guerrero López <ana at ekaia.org>
Date:   Wed Jul 2 15:58:07 2014 +0200

    Imported Upstream version 1.0.14
---
 Makefile.am                      |   42 +-
 Makefile.in                      |  169 +++++--
 aclocal.m4                       |   42 +-
 config.h.in                      |    6 +
 config/config.guess              |   19 +-
 config/config.sub                |   34 +-
 config/ltmain.sh                 |   12 +-
 configure                        |  629 ++++++++++++++++-------
 configure.in                     |   23 +-
 examples/cmatose.c               |   53 +-
 examples/mckey.c                 |   60 ++-
 examples/rdma_client.c           |  134 +++++
 examples/rdma_server.c           |  149 ++++++
 examples/rping.c                 |   12 +-
 include/infiniband/ib.h          |  107 ++++
 include/rdma/rdma_cma.h          |  119 ++++-
 include/rdma/rdma_cma_abi.h      |   75 ++-
 include/rdma/rdma_verbs.h        |  296 +++++++++++
 librdmacm.spec                   |    4 +-
 librdmacm.spec.in                |    2 +-
 man/mckey.1                      |    5 +
 man/rdma_accept.3                |    3 +
 man/rdma_ack_cm_event.3          |    3 +
 man/rdma_bind_addr.3             |    3 +
 man/rdma_client.1                |   31 ++
 man/rdma_cm.7                    |  133 ++++-
 man/rdma_connect.3               |    8 +-
 man/rdma_create_ep.3             |   60 +++
 man/rdma_create_event_channel.3  |    3 +
 man/rdma_create_id.3             |   19 +-
 man/rdma_create_qp.3             |   21 +-
 man/rdma_dereg_mr.3              |   28 ++
 man/rdma_destroy_ep.3            |   21 +
 man/rdma_destroy_event_channel.3 |    3 +
 man/rdma_destroy_id.3            |    7 +-
 man/rdma_destroy_qp.3            |    3 +
 man/rdma_disconnect.3            |    3 +
 man/rdma_event_str.3             |    2 +
 man/rdma_free_devices.3          |    2 +
 man/rdma_get_cm_event.3          |   17 +-
 man/rdma_get_devices.3           |    3 +
 man/rdma_get_dst_port.3          |    3 +
 man/rdma_get_local_addr.3        |    4 +
 man/rdma_get_peer_addr.3         |    4 +
 man/rdma_get_recv_comp.3         |   31 ++
 man/rdma_get_request.3           |   34 ++
 man/rdma_get_send_comp.3         |   31 ++
 man/rdma_get_src_port.3          |    3 +
 man/rdma_getaddrinfo.3           |   91 ++++
 man/rdma_join_multicast.3        |    3 +
 man/rdma_leave_multicast.3       |    3 +
 man/rdma_listen.3                |    3 +
 man/rdma_migrate_id.3            |    9 +-
 man/rdma_notify.3                |    5 +
 man/rdma_post_read.3             |   55 +++
 man/rdma_post_readv.3            |   52 ++
 man/rdma_post_recv.3             |   50 ++
 man/rdma_post_recvv.3            |   47 ++
 man/rdma_post_send.3             |   51 ++
 man/rdma_post_sendv.3            |   48 ++
 man/rdma_post_ud_send.3          |   54 ++
 man/rdma_post_write.3            |   55 +++
 man/rdma_post_writev.3           |   52 ++
 man/rdma_reg_msgs.3              |   42 ++
 man/rdma_reg_read.3              |   41 ++
 man/rdma_reg_write.3             |   41 ++
 man/rdma_reject.3                |    3 +
 man/rdma_resolve_addr.3          |    3 +
 man/rdma_resolve_route.3         |    3 +
 man/rdma_server.1                |   26 +
 man/rdma_set_option.3            |    3 +
 src/acm.c                        |  324 ++++++++++++
 src/addrinfo.c                   |  248 ++++++++++
 src/cma.c                        | 1013 +++++++++++++++++++++++++++++++-------
 src/cma.h                        |  132 +++++
 src/librdmacm.map                |    5 +
 76 files changed, 4394 insertions(+), 543 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 290cbc3..4e92e35 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,7 @@ INCLUDES = -I$(srcdir)/include
 
 lib_LTLIBRARIES = src/librdmacm.la
 
+ACLOCAL_AMFLAGS = -I config
 AM_CFLAGS = -g -Wall -D_GNU_SOURCE
 
 src_librdmacm_la_CFLAGS = $(AM_CFLAGS)
@@ -12,12 +13,13 @@ else
     librdmacm_version_script =
 endif
 
-src_librdmacm_la_SOURCES = src/cma.c
+src_librdmacm_la_SOURCES = src/cma.c src/addrinfo.c src/acm.c
 src_librdmacm_la_LDFLAGS = -version-info 1 -export-dynamic \
 			   $(librdmacm_version_script)
 src_librdmacm_la_DEPENDENCIES =  $(srcdir)/src/librdmacm.map
 
-bin_PROGRAMS = examples/ucmatose examples/rping examples/udaddy examples/mckey
+bin_PROGRAMS = examples/ucmatose examples/rping examples/udaddy examples/mckey \
+	       examples/rdma_client examples/rdma_server
 examples_ucmatose_SOURCES = examples/cmatose.c
 examples_ucmatose_LDADD = $(top_builddir)/src/librdmacm.la
 examples_rping_SOURCES = examples/rping.c
@@ -26,11 +28,19 @@ examples_udaddy_SOURCES = examples/udaddy.c
 examples_udaddy_LDADD = $(top_builddir)/src/librdmacm.la
 examples_mckey_SOURCES = examples/mckey.c
 examples_mckey_LDADD = $(top_builddir)/src/librdmacm.la
+examples_rdma_client_SOURCES = examples/rdma_client.c
+examples_rdma_client_LDADD = $(top_builddir)/src/librdmacm.la
+examples_rdma_server_SOURCES = examples/rdma_server.c
+examples_rdma_server_LDADD = $(top_builddir)/src/librdmacm.la
 
 librdmacmincludedir = $(includedir)/rdma
+infinibandincludedir = $(includedir)/infiniband
 
-librdmacminclude_HEADERS = include/rdma/rdma_cma_abi.h \
-			   include/rdma/rdma_cma.h
+librdmacminclude_HEADERS = $(top_srcdir)/include/rdma/rdma_cma_abi.h \
+			   $(top_srcdir)/include/rdma/rdma_cma.h \
+			   $(top_srcdir)/include/rdma/rdma_verbs.h
+
+infinibandinclude_HEADERS = $(top_srcdir)/include/infiniband/ib.h
 
 man_MANS = \
 	man/rdma_accept.3 \
@@ -61,14 +71,34 @@ man_MANS = \
 	man/rdma_resolve_route.3 \
 	man/rdma_event_str.3 \
 	man/rdma_set_option.3 \
+	man/rdma_get_request.3 \
+	man/rdma_create_ep.3 \
+	man/rdma_destroy_ep.3 \
+	man/rdma_getaddrinfo.3 \
+	man/rdma_dereg_mr.3 \
+	man/rdma_get_recv_comp.3 \
+	man/rdma_get_send_comp.3 \
+	man/rdma_post_read.3 \
+	man/rdma_post_readv.3 \
+	man/rdma_post_recv.3 \
+	man/rdma_post_recvv.3 \
+	man/rdma_post_send.3 \
+	man/rdma_post_sendv.3 \
+	man/rdma_post_ud_send.3 \
+	man/rdma_post_write.3 \
+	man/rdma_post_writev.3 \
+	man/rdma_reg_msgs.3 \
+	man/rdma_reg_read.3 \
+	man/rdma_reg_write.3 \
 	man/ucmatose.1 \
 	man/udaddy.1 \
 	man/mckey.1 \
 	man/rping.1 \
+	man/rdma_server.1 \
+	man/rdma_client.1 \
 	man/rdma_cm.7
 
-EXTRA_DIST = include/rdma/rdma_cma_abi.h include/rdma/rdma_cma.h \
-	     src/librdmacm.map librdmacm.spec.in $(man_MANS)
+EXTRA_DIST = src/cma.h src/librdmacm.map librdmacm.spec.in $(man_MANS)
 
 dist-hook: librdmacm.spec
 	cp librdmacm.spec $(distdir)
diff --git a/Makefile.in b/Makefile.in
index 21cb41d..8b9ff38 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -39,8 +39,10 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = examples/ucmatose$(EXEEXT) examples/rping$(EXEEXT) \
-	examples/udaddy$(EXEEXT) examples/mckey$(EXEEXT)
-DIST_COMMON = README $(am__configure_deps) $(librdmacminclude_HEADERS) \
+	examples/udaddy$(EXEEXT) examples/mckey$(EXEEXT) \
+	examples/rdma_client$(EXEEXT) examples/rdma_server$(EXEEXT)
+DIST_COMMON = README $(am__configure_deps) \
+	$(infinibandinclude_HEADERS) $(librdmacminclude_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/config.h.in $(srcdir)/librdmacm.spec.in \
 	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
@@ -65,11 +67,13 @@ am__vpath_adj = case $$p in \
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
 	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
-	"$(DESTDIR)$(man7dir)" "$(DESTDIR)$(librdmacmincludedir)"
+	"$(DESTDIR)$(man7dir)" "$(DESTDIR)$(infinibandincludedir)" \
+	"$(DESTDIR)$(librdmacmincludedir)"
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 src_librdmacm_la_LIBADD =
-am_src_librdmacm_la_OBJECTS = src_librdmacm_la-cma.lo
+am_src_librdmacm_la_OBJECTS = src_librdmacm_la-cma.lo \
+	src_librdmacm_la-addrinfo.lo src_librdmacm_la-acm.lo
 src_librdmacm_la_OBJECTS = $(am_src_librdmacm_la_OBJECTS)
 am__dirstamp = $(am__leading_dot)dirstamp
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@@ -77,6 +81,12 @@ PROGRAMS = $(bin_PROGRAMS)
 am_examples_mckey_OBJECTS = mckey.$(OBJEXT)
 examples_mckey_OBJECTS = $(am_examples_mckey_OBJECTS)
 examples_mckey_DEPENDENCIES = $(top_builddir)/src/librdmacm.la
+am_examples_rdma_client_OBJECTS = rdma_client.$(OBJEXT)
+examples_rdma_client_OBJECTS = $(am_examples_rdma_client_OBJECTS)
+examples_rdma_client_DEPENDENCIES = $(top_builddir)/src/librdmacm.la
+am_examples_rdma_server_OBJECTS = rdma_server.$(OBJEXT)
+examples_rdma_server_OBJECTS = $(am_examples_rdma_server_OBJECTS)
+examples_rdma_server_DEPENDENCIES = $(top_builddir)/src/librdmacm.la
 am_examples_rping_OBJECTS = rping.$(OBJEXT)
 examples_rping_OBJECTS = $(am_examples_rping_OBJECTS)
 examples_rping_DEPENDENCIES = $(top_builddir)/src/librdmacm.la
@@ -98,18 +108,21 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(src_librdmacm_la_SOURCES) $(examples_mckey_SOURCES) \
-	$(examples_rping_SOURCES) $(examples_ucmatose_SOURCES) \
-	$(examples_udaddy_SOURCES)
+	$(examples_rdma_client_SOURCES) \
+	$(examples_rdma_server_SOURCES) $(examples_rping_SOURCES) \
+	$(examples_ucmatose_SOURCES) $(examples_udaddy_SOURCES)
 DIST_SOURCES = $(src_librdmacm_la_SOURCES) $(examples_mckey_SOURCES) \
-	$(examples_rping_SOURCES) $(examples_ucmatose_SOURCES) \
-	$(examples_udaddy_SOURCES)
+	$(examples_rdma_client_SOURCES) \
+	$(examples_rdma_server_SOURCES) $(examples_rping_SOURCES) \
+	$(examples_ucmatose_SOURCES) $(examples_udaddy_SOURCES)
 man1dir = $(mandir)/man1
 man3dir = $(mandir)/man3
 man7dir = $(mandir)/man7
 NROFF = nroff
 MANS = $(man_MANS)
+infinibandincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 librdmacmincludeHEADERS_INSTALL = $(INSTALL_HEADER)
-HEADERS = $(librdmacminclude_HEADERS)
+HEADERS = $(infinibandinclude_HEADERS) $(librdmacminclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -223,11 +236,12 @@ sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 INCLUDES = -I$(srcdir)/include
 lib_LTLIBRARIES = src/librdmacm.la
+ACLOCAL_AMFLAGS = -I config
 AM_CFLAGS = -g -Wall -D_GNU_SOURCE
 src_librdmacm_la_CFLAGS = $(AM_CFLAGS)
 @HAVE_LD_VERSION_SCRIPT_FALSE at librdmacm_version_script = 
 @HAVE_LD_VERSION_SCRIPT_TRUE at librdmacm_version_script = -Wl,--version-script=$(srcdir)/src/librdmacm.map
-src_librdmacm_la_SOURCES = src/cma.c
+src_librdmacm_la_SOURCES = src/cma.c src/addrinfo.c src/acm.c
 src_librdmacm_la_LDFLAGS = -version-info 1 -export-dynamic \
 			   $(librdmacm_version_script)
 
@@ -240,10 +254,17 @@ examples_udaddy_SOURCES = examples/udaddy.c
 examples_udaddy_LDADD = $(top_builddir)/src/librdmacm.la
 examples_mckey_SOURCES = examples/mckey.c
 examples_mckey_LDADD = $(top_builddir)/src/librdmacm.la
+examples_rdma_client_SOURCES = examples/rdma_client.c
+examples_rdma_client_LDADD = $(top_builddir)/src/librdmacm.la
+examples_rdma_server_SOURCES = examples/rdma_server.c
+examples_rdma_server_LDADD = $(top_builddir)/src/librdmacm.la
 librdmacmincludedir = $(includedir)/rdma
-librdmacminclude_HEADERS = include/rdma/rdma_cma_abi.h \
-			   include/rdma/rdma_cma.h
+infinibandincludedir = $(includedir)/infiniband
+librdmacminclude_HEADERS = $(top_srcdir)/include/rdma/rdma_cma_abi.h \
+			   $(top_srcdir)/include/rdma/rdma_cma.h \
+			   $(top_srcdir)/include/rdma/rdma_verbs.h
 
+infinibandinclude_HEADERS = $(top_srcdir)/include/infiniband/ib.h
 man_MANS = \
 	man/rdma_accept.3 \
 	man/rdma_ack_cm_event.3 \
@@ -273,15 +294,34 @@ man_MANS = \
 	man/rdma_resolve_route.3 \
 	man/rdma_event_str.3 \
 	man/rdma_set_option.3 \
+	man/rdma_get_request.3 \
+	man/rdma_create_ep.3 \
+	man/rdma_destroy_ep.3 \
+	man/rdma_getaddrinfo.3 \
+	man/rdma_dereg_mr.3 \
+	man/rdma_get_recv_comp.3 \
+	man/rdma_get_send_comp.3 \
+	man/rdma_post_read.3 \
+	man/rdma_post_readv.3 \
+	man/rdma_post_recv.3 \
+	man/rdma_post_recvv.3 \
+	man/rdma_post_send.3 \
+	man/rdma_post_sendv.3 \
+	man/rdma_post_ud_send.3 \
+	man/rdma_post_write.3 \
+	man/rdma_post_writev.3 \
+	man/rdma_reg_msgs.3 \
+	man/rdma_reg_read.3 \
+	man/rdma_reg_write.3 \
 	man/ucmatose.1 \
 	man/udaddy.1 \
 	man/mckey.1 \
 	man/rping.1 \
+	man/rdma_server.1 \
+	man/rdma_client.1 \
 	man/rdma_cm.7
 
-EXTRA_DIST = include/rdma/rdma_cma_abi.h include/rdma/rdma_cma.h \
-	     src/librdmacm.map librdmacm.spec.in $(man_MANS)
-
+EXTRA_DIST = src/cma.h src/librdmacm.map librdmacm.spec.in $(man_MANS)
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -405,6 +445,12 @@ examples/$(am__dirstamp):
 examples/mckey$(EXEEXT): $(examples_mckey_OBJECTS) $(examples_mckey_DEPENDENCIES) examples/$(am__dirstamp)
 	@rm -f examples/mckey$(EXEEXT)
 	$(LINK) $(examples_mckey_LDFLAGS) $(examples_mckey_OBJECTS) $(examples_mckey_LDADD) $(LIBS)
+examples/rdma_client$(EXEEXT): $(examples_rdma_client_OBJECTS) $(examples_rdma_client_DEPENDENCIES) examples/$(am__dirstamp)
+	@rm -f examples/rdma_client$(EXEEXT)
+	$(LINK) $(examples_rdma_client_LDFLAGS) $(examples_rdma_client_OBJECTS) $(examples_rdma_client_LDADD) $(LIBS)
+examples/rdma_server$(EXEEXT): $(examples_rdma_server_OBJECTS) $(examples_rdma_server_DEPENDENCIES) examples/$(am__dirstamp)
+	@rm -f examples/rdma_server$(EXEEXT)
+	$(LINK) $(examples_rdma_server_LDFLAGS) $(examples_rdma_server_OBJECTS) $(examples_rdma_server_LDADD) $(LIBS)
 examples/rping$(EXEEXT): $(examples_rping_OBJECTS) $(examples_rping_DEPENDENCIES) examples/$(am__dirstamp)
 	@rm -f examples/rping$(EXEEXT)
 	$(LINK) $(examples_rping_LDFLAGS) $(examples_rping_OBJECTS) $(examples_rping_LDADD) $(LIBS)
@@ -423,7 +469,11 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cmatose.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mckey.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rdma_client.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rdma_server.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rping.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_librdmacm_la-acm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_librdmacm_la-addrinfo.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_librdmacm_la-cma.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/udaddy.Po at am__quote@
 
@@ -455,6 +505,20 @@ src_librdmacm_la-cma.lo: src/cma.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_librdmacm_la_CFLAGS) $(CFLAGS) -c -o src_librdmacm_la-cma.lo `test -f 'src/cma.c' || echo '$(srcdir)/'`src/cma.c
 
+src_librdmacm_la-addrinfo.lo: src/addrinfo.c
+ at am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_librdmacm_la_CFLAGS) $(CFLAGS) -MT src_librdmacm_la-addrinfo.lo -MD -MP -MF "$(DEPDIR)/src_librdmacm_la-addrinfo.Tpo" -c -o src_librdmacm_la-addrinfo.lo `test -f 'src/addrinfo.c' || echo '$(srcdir)/'`src/addrinfo.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/src_librdmacm_la-addrinfo.Tpo" "$(DEPDIR)/src_librdmacm_la-addrinfo.Plo"; else rm -f "$(DEPDIR)/src_librdmacm_la-addrinfo.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/addrinfo.c' object='src_librdmacm_la-addrinfo.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_librdmacm_la_CFLAGS) $(CFLAGS) -c -o src_librdmacm_la-addrinfo.lo `test -f 'src/addrinfo.c' || echo '$(srcdir)/'`src/addrinfo.c
+
+src_librdmacm_la-acm.lo: src/acm.c
+ at am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_librdmacm_la_CFLAGS) $(CFLAGS) -MT src_librdmacm_la-acm.lo -MD -MP -MF "$(DEPDIR)/src_librdmacm_la-acm.Tpo" -c -o src_librdmacm_la-acm.lo `test -f 'src/acm.c' || echo '$(srcdir)/'`src/acm.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/src_librdmacm_la-acm.Tpo" "$(DEPDIR)/src_librdmacm_la-acm.Plo"; else rm -f "$(DEPDIR)/src_librdmacm_la-acm.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/acm.c' object='src_librdmacm_la-acm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_librdmacm_la_CFLAGS) $(CFLAGS) -c -o src_librdmacm_la-acm.lo `test -f 'src/acm.c' || echo '$(srcdir)/'`src/acm.c
+
 mckey.o: examples/mckey.c
 @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mckey.o -MD -MP -MF "$(DEPDIR)/mckey.Tpo" -c -o mckey.o `test -f 'examples/mckey.c' || echo '$(srcdir)/'`examples/mckey.c; \
 @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mckey.Tpo" "$(DEPDIR)/mckey.Po"; else rm -f "$(DEPDIR)/mckey.Tpo"; exit 1; fi
@@ -469,6 +533,34 @@ mckey.obj: examples/mckey.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mckey.obj `if test -f 'examples/mckey.c'; then $(CYGPATH_W) 'examples/mckey.c'; else $(CYGPATH_W) '$(srcdir)/examples/mckey.c'; fi`
 
+rdma_client.o: examples/rdma_client.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdma_client.o -MD -MP -MF "$(DEPDIR)/rdma_client.Tpo" -c -o rdma_client.o `test -f 'examples/rdma_client.c' || echo '$(srcdir)/'`examples/rdma_client.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/rdma_client.Tpo" "$(DEPDIR)/rdma_client.Po"; else rm -f "$(DEPDIR)/rdma_client.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='examples/rdma_client.c' object='rdma_client.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdma_client.o `test -f 'examples/rdma_client.c' || echo '$(srcdir)/'`examples/rdma_client.c
+
+rdma_client.obj: examples/rdma_client.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdma_client.obj -MD -MP -MF "$(DEPDIR)/rdma_client.Tpo" -c -o rdma_client.obj `if test -f 'examples/rdma_client.c'; then $(CYGPATH_W) 'examples/rdma_client.c'; else $(CYGPATH_W) '$(srcdir)/examples/rdma_client.c'; fi`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/rdma_client.Tpo" "$(DEPDIR)/rdma_client.Po"; else rm -f "$(DEPDIR)/rdma_client.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='examples/rdma_client.c' object='rdma_client.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdma_client.obj `if test -f 'examples/rdma_client.c'; then $(CYGPATH_W) 'examples/rdma_client.c'; else $(CYGPATH_W) '$(srcdir)/examples/rdma_client.c'; fi`
+
+rdma_server.o: examples/rdma_server.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdma_server.o -MD -MP -MF "$(DEPDIR)/rdma_server.Tpo" -c -o rdma_server.o `test -f 'examples/rdma_server.c' || echo '$(srcdir)/'`examples/rdma_server.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/rdma_server.Tpo" "$(DEPDIR)/rdma_server.Po"; else rm -f "$(DEPDIR)/rdma_server.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='examples/rdma_server.c' object='rdma_server.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdma_server.o `test -f 'examples/rdma_server.c' || echo '$(srcdir)/'`examples/rdma_server.c
+
+rdma_server.obj: examples/rdma_server.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdma_server.obj -MD -MP -MF "$(DEPDIR)/rdma_server.Tpo" -c -o rdma_server.obj `if test -f 'examples/rdma_server.c'; then $(CYGPATH_W) 'examples/rdma_server.c'; else $(CYGPATH_W) '$(srcdir)/examples/rdma_server.c'; fi`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/rdma_server.Tpo" "$(DEPDIR)/rdma_server.Po"; else rm -f "$(DEPDIR)/rdma_server.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='examples/rdma_server.c' object='rdma_server.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdma_server.obj `if test -f 'examples/rdma_server.c'; then $(CYGPATH_W) 'examples/rdma_server.c'; else $(CYGPATH_W) '$(srcdir)/examples/rdma_server.c'; fi`
+
 rping.o: examples/rping.c
 @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rping.o -MD -MP -MF "$(DEPDIR)/rping.Tpo" -c -o rping.o `test -f 'examples/rping.c' || echo '$(srcdir)/'`examples/rping.c; \
 @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/rping.Tpo" "$(DEPDIR)/rping.Po"; else rm -f "$(DEPDIR)/rping.Tpo"; exit 1; fi
@@ -656,6 +748,23 @@ uninstall-man7:
 	  echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \
 	  rm -f "$(DESTDIR)$(man7dir)/$$inst"; \
 	done
+install-infinibandincludeHEADERS: $(infinibandinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(infinibandincludedir)" || $(mkdir_p) "$(DESTDIR)$(infinibandincludedir)"
+	@list='$(infinibandinclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(infinibandincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(infinibandincludedir)/$$f'"; \
+	  $(infinibandincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(infinibandincludedir)/$$f"; \
+	done
+
+uninstall-infinibandincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(infinibandinclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(infinibandincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(infinibandincludedir)/$$f"; \
+	done
 install-librdmacmincludeHEADERS: $(librdmacminclude_HEADERS)
 	@$(NORMAL_INSTALL)
 	test -z "$(librdmacmincludedir)" || $(mkdir_p) "$(DESTDIR)$(librdmacmincludedir)"
@@ -725,7 +834,7 @@ distclean-tags:
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/include/rdma $(distdir)/man $(distdir)/src
+	$(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/include/infiniband $(distdir)/include/rdma $(distdir)/man $(distdir)/src
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 	list='$(DISTFILES)'; for file in $$list; do \
@@ -859,7 +968,7 @@ all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \
 install-binPROGRAMS: install-libLTLIBRARIES
 
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(librdmacmincludedir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(infinibandincludedir)" "$(DESTDIR)$(librdmacmincludedir)"; do \
 	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
 	done
 install: install-am
@@ -910,7 +1019,8 @@ info: info-am
 
 info-am:
 
-install-data-am: install-librdmacmincludeHEADERS install-man
+install-data-am: install-infinibandincludeHEADERS \
+	install-librdmacmincludeHEADERS install-man
 
 install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
 
@@ -940,9 +1050,9 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
-	uninstall-libLTLIBRARIES uninstall-librdmacmincludeHEADERS \
-	uninstall-man
+uninstall-am: uninstall-binPROGRAMS uninstall-infinibandincludeHEADERS \
+	uninstall-info-am uninstall-libLTLIBRARIES \
+	uninstall-librdmacmincludeHEADERS uninstall-man
 
 uninstall-man: uninstall-man1 uninstall-man3 uninstall-man7
 
@@ -954,14 +1064,15 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man7
 	distclean-libtool distclean-tags distcleancheck distdir \
 	distuninstallcheck dvi dvi-am html html-am info info-am \
 	install install-am install-binPROGRAMS install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-libLTLIBRARIES \
-	install-librdmacmincludeHEADERS install-man install-man1 \
-	install-man3 install-man7 install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-binPROGRAMS \
+	install-data-am install-exec install-exec-am \
+	install-infinibandincludeHEADERS install-info install-info-am \
+	install-libLTLIBRARIES install-librdmacmincludeHEADERS \
+	install-man install-man1 install-man3 install-man7 \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-infinibandincludeHEADERS \
 	uninstall-info-am uninstall-libLTLIBRARIES \
 	uninstall-librdmacmincludeHEADERS uninstall-man uninstall-man1 \
 	uninstall-man3 uninstall-man7
diff --git a/aclocal.m4 b/aclocal.m4
index 5baa59e..094df7b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,7 +13,7 @@
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# serial 48 Debian 1.5.22-2 AC_PROG_LIBTOOL
+# serial 48 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -1593,18 +1593,6 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 knetbsd*-gnu)
   version_type=linux
   need_lib_prefix=no
@@ -2380,7 +2368,7 @@ linux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -3389,7 +3377,7 @@ case $host_os in
 	;;
     esac
     ;;
-  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  netbsd*)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -5013,7 +5001,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	    ;;
 	esac
 	;;
-      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      netbsd*)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -5365,12 +5353,6 @@ ifelse([$1],[CXX],[
   cygwin* | mingw*)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
-  kfreebsd*-gnu)
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
-  ;;
-  linux*)
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
-  ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -5567,13 +5549,12 @@ EOF
   $echo "local: *; };" >> $output_objdir/$libname.ver~
 	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
       else
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -5903,20 +5884,11 @@ _LT_EOF
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-      
-    # GNU/kFreeBSD uses gcc -shared to do shared libraries.
-    kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
       ;;
 
     hpux9*)
@@ -6014,7 +5986,7 @@ _LT_EOF
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
diff --git a/config.h.in b/config.h.in
index 48a9db8..1de8d63 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,5 +1,8 @@
 /* config.h.in.  Generated from configure.in by autoheader.  */
 
+/* adding path record definition */
+#undef DEFINE_PATH_RECORD
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
@@ -60,6 +63,9 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Define to 1 to use IB ACM for endpoint resolution */
+#undef USE_IB_ACM
+
 /* Version number of package */
 #undef VERSION
 
diff --git a/config/config.guess b/config/config.guess
index ad5281e..e3ef63f 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2005-08-03'
+timestamp='2005-12-13'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -779,7 +779,7 @@ EOF
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
-    x86:Interix*:[34]*)
+    x86:Interix*:[345]*)
 	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 	exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
@@ -851,7 +851,7 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     mips64:Linux:*:*)
@@ -870,7 +870,7 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
@@ -919,6 +919,9 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-gnu
 	exit ;;
@@ -964,7 +967,7 @@ EOF
 	LIBC=gnulibc1
 	# endif
 	#else
-	#ifdef __INTEL_COMPILER
+	#if defined(__INTEL_COMPILER) || defined(__PGI)
 	LIBC=gnu
 	#else
 	LIBC=gnuaout
@@ -974,7 +977,7 @@ EOF
 	LIBC=dietlibc
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`"
 	test x"${LIBC}" != x && {
 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 		exit
@@ -1185,7 +1188,6 @@ EOF
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
-	    *86) UNAME_PROCESSOR=i686 ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1264,6 +1266,9 @@ EOF
     i*86:skyos:*:*)
 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
 	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/config/config.sub b/config/config.sub
index 1c366df..2851647 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2005-07-08'
+timestamp='2005-12-11'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -119,8 +119,9 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -171,6 +172,10 @@ case $os in
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -187,6 +192,10 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -257,7 +266,7 @@ case $basic_machine in
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
-	| ms1 \
+	| mt \
 	| msp430 \
 	| ns16k | ns32k \
 	| or32 \
@@ -286,6 +295,9 @@ case $basic_machine in
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -336,7 +348,7 @@ case $basic_machine in
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
-	| ms1-* \
+	| mt-* \
 	| msp430-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| orion-* \
@@ -696,6 +708,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-msdos
 		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -859,6 +874,10 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -1181,14 +1200,15 @@ case $os in
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku*)
+	      | -skyos* | -haiku* | -rdos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
diff --git a/config/ltmain.sh b/config/ltmain.sh
index 8fc56db..06823e0 100644
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -43,7 +43,7 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="1.5.22 Debian 1.5.22-2"
+VERSION=1.5.22
 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
 # See if we are running on zsh, and set the options which allow our
@@ -2082,10 +2082,7 @@ EOF
 	case $pass in
 	dlopen) libs="$dlfiles" ;;
 	dlpreopen) libs="$dlprefiles" ;;
-	link)
-	  libs="$deplibs %DEPLIBS%"
-	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
-	  ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
       if test "$pass" = dlopen; then
@@ -3204,11 +3201,6 @@ EOF
 	    age="$number_minor"
 	    revision="$number_minor"
 	    ;;
-	  *)
-	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
-	    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	    exit $EXIT_FAILURE
-	    ;;
 	  esac
 	  ;;
 	no)
diff --git a/configure b/configure
index 9299a2b..161d7ef 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for librdmacm 1.0.10.
+# Generated by GNU Autoconf 2.59 for librdmacm 1.0.14.
 #
 # Report bugs to <general at lists.openfabrics.org>.
 #
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='librdmacm'
 PACKAGE_TARNAME='librdmacm'
-PACKAGE_VERSION='1.0.10'
-PACKAGE_STRING='librdmacm 1.0.10'
+PACKAGE_VERSION='1.0.14'
+PACKAGE_STRING='librdmacm 1.0.14'
 PACKAGE_BUGREPORT='general at lists.openfabrics.org'
 
 ac_unique_file="src/cma.c"
@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures librdmacm 1.0.10 to adapt to many kinds of systems.
+\`configure' configures librdmacm 1.0.14 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1020,7 +1020,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of librdmacm 1.0.10:";;
+     short | recursive ) echo "Configuration of librdmacm 1.0.14:";;
    esac
   cat <<\_ACEOF
 
@@ -1047,6 +1047,7 @@ Optional Packages:
   --with-tags[=TAGS]
                           include additional configurations [automatic]
   --with-valgrind         Enable valgrind annotations - default NO
+  --with-ib_acm           Use IB ACM for route resolution - default NO
 
 Some influential environment variables:
   CC          C compiler command
@@ -1154,14 +1155,14 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd "$ac_popdir"
+    cd $ac_popdir
   done
 fi
 
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-librdmacm configure 1.0.10
+librdmacm configure 1.0.14
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1175,7 +1176,7 @@ cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by librdmacm $as_me 1.0.10, which was
+It was created by librdmacm $as_me 1.0.14, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1537,6 +1538,17 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
+case config in
+  [\\/]* | ?:[\\/]* ) ac_macro_dir=config         ;;
+  *)                      ac_macro_dir=$srcdir/config ;;
+esac
+if test -d "$ac_macro_dir"; then :
+else
+  { { echo "$as_me:$LINENO: error: cannot find macro directory \`config'" >&5
+echo "$as_me: error: cannot find macro directory \`config'" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
           ac_config_headers="$ac_config_headers config.h"
 
 am__api_version="1.9"
@@ -1821,7 +1833,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=librdmacm
- VERSION=1.0.10
+ VERSION=1.0.14
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2711,7 +2723,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2769,7 +2782,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2885,7 +2899,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2939,7 +2954,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2984,7 +3000,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3028,7 +3045,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3553,7 +3571,7 @@ linux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -3670,7 +3688,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3673 "configure"' > conftest.$ac_ext
+  echo '#line 3691 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -3790,7 +3808,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4119,7 +4138,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4289,7 +4309,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4356,7 +4377,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4616,7 +4638,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4674,7 +4697,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4745,7 +4769,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4789,7 +4814,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5261,7 +5287,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5264:" \
+echo "$as_me:5290:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5307,7 +5333,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5356,7 +5383,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6322,11 +6350,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6325: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6353: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6329: \$? = $ac_status" >&5
+   echo "$as_me:6357: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6590,11 +6618,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6593: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6621: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6597: \$? = $ac_status" >&5
+   echo "$as_me:6625: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6694,11 +6722,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6697: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6725: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6701: \$? = $ac_status" >&5
+   echo "$as_me:6729: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -6949,13 +6977,12 @@ EOF
   $echo "local: *; };" >> $output_objdir/$libname.ver~
 	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
-	link_all_deplibs=no
       else
 	ld_shlibs=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -7171,7 +7198,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7231,7 +7259,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7385,22 +7414,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       hardcode_shlibpath_var=no
       ;;
 
-    # GNU/kFreeBSD uses gcc -shared to do shared libraries.
-    kfreebsd*-gnu)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      link_all_deplibs=no
-      ;;
-
     hpux9*)
       if test "$GCC" = yes; then
 	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
@@ -7496,7 +7516,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       link_all_deplibs=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -8182,18 +8202,6 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 knetbsd*-gnu)
   version_type=linux
   need_lib_prefix=no
@@ -8519,7 +8527,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8622,7 +8631,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8687,7 +8697,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8780,7 +8791,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8845,7 +8857,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8911,7 +8924,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8977,7 +8991,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9052,7 +9067,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9055 "configure"
+#line 9070 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9152,7 +9167,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9155 "configure"
+#line 9170 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10235,7 +10250,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10296,7 +10312,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10728,7 +10745,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	;;
     esac
     ;;
-  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  netbsd*)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -11381,7 +11398,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	    ;;
 	esac
 	;;
-      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      netbsd*)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -11490,11 +11507,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11493: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11510: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11497: \$? = $ac_status" >&5
+   echo "$as_me:11514: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11594,11 +11611,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11597: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11614: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11601: \$? = $ac_status" >&5
+   echo "$as_me:11618: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11666,12 +11683,6 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   cygwin* | mingw*)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
-  kfreebsd*-gnu)
-    link_all_deplibs_CXX=no
-  ;;
-  linux*)
-    link_all_deplibs_CXX=no
-  ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -12147,18 +12158,6 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 knetbsd*-gnu)
   version_type=linux
   need_lib_prefix=no
@@ -13182,11 +13181,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13185: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13184: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13189: \$? = $ac_status" >&5
+   echo "$as_me:13188: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13286,11 +13285,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13289: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13288: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13293: \$? = $ac_status" >&5
+   echo "$as_me:13292: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13541,13 +13540,12 @@ EOF
   $echo "local: *; };" >> $output_objdir/$libname.ver~
 	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
-	link_all_deplibs_F77=no
       else
 	ld_shlibs_F77=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -13753,7 +13751,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13803,7 +13802,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13957,22 +13957,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_F77='-R$libdir'
       hardcode_direct_F77=yes
       hardcode_shlibpath_var_F77=no
       ;;
 
-    # GNU/kFreeBSD uses gcc -shared to do shared libraries.
-    kfreebsd*-gnu)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      link_all_deplibs_F77=no
-      ;;
-
     hpux9*)
       if test "$GCC" = yes; then
 	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
@@ -14068,7 +14059,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       link_all_deplibs_F77=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -14754,18 +14745,6 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 knetbsd*-gnu)
   version_type=linux
   need_lib_prefix=no
@@ -15509,11 +15488,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15512: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15491: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15516: \$? = $ac_status" >&5
+   echo "$as_me:15495: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15777,11 +15756,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15780: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15759: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15784: \$? = $ac_status" >&5
+   echo "$as_me:15763: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15881,11 +15860,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15884: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15863: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15888: \$? = $ac_status" >&5
+   echo "$as_me:15867: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16136,13 +16115,12 @@ EOF
   $echo "local: *; };" >> $output_objdir/$libname.ver~
 	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
-	link_all_deplibs_GCJ=no
       else
 	ld_shlibs_GCJ=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -16358,7 +16336,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16418,7 +16397,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16572,20 +16552,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    # GNU/kFreeBSD uses gcc -shared to do shared libraries.
-    kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_GCJ='-R$libdir'
       hardcode_direct_GCJ=yes
       hardcode_shlibpath_var_GCJ=no
-      link_all_deplibs_GCJ=no
       ;;
 
     hpux9*)
@@ -16683,7 +16654,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       link_all_deplibs_GCJ=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -17369,18 +17340,6 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 knetbsd*-gnu)
   version_type=linux
   need_lib_prefix=no
@@ -18587,6 +18546,21 @@ _ACEOF
 	fi
 fi
 
+
+# Check whether --with-ib_acm or --without-ib_acm was given.
+if test "${with_ib_acm+set}" = set; then
+  withval="$with_ib_acm"
+
+fi;
+
+if test "$with_ib_acm" != "" && test "$with_ib_acm" != "no"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_IB_ACM 1
+_ACEOF
+
+fi
+
 # Check whether --enable-libcheck or --disable-libcheck was given.
 if test "${enable_libcheck+set}" = set; then
   enableval="$enable_libcheck"
@@ -18963,7 +18937,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19021,7 +18996,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19137,7 +19113,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19191,7 +19168,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19236,7 +19214,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19280,7 +19259,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19504,7 +19484,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19567,7 +19548,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19629,7 +19611,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19669,7 +19652,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19725,7 +19709,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19765,7 +19750,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19829,7 +19815,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19860,8 +19847,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19982,7 +19971,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20022,6 +20012,120 @@ fi
 
 fi
 
+echo "$as_me:$LINENO: checking for struct ibv_path_record.service_id" >&5
+echo $ECHO_N "checking for struct ibv_path_record.service_id... $ECHO_C" >&6
+if test "${ac_cv_member_struct_ibv_path_record_service_id+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <infiniband/sa.h>
+
+int
+main ()
+{
+static struct ibv_path_record ac_aggr;
+if (ac_aggr.service_id)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_member_struct_ibv_path_record_service_id=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <infiniband/sa.h>
+
+int
+main ()
+{
+static struct ibv_path_record ac_aggr;
+if (sizeof ac_aggr.service_id)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_member_struct_ibv_path_record_service_id=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_ibv_path_record_service_id=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ibv_path_record_service_id" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ibv_path_record_service_id" >&6
+if test $ac_cv_member_struct_ibv_path_record_service_id = yes; then
+  :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFINE_PATH_RECORD 1
+_ACEOF
+
+fi
+
+
 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
@@ -20055,7 +20159,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20218,7 +20323,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20365,7 +20471,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20482,6 +20589,155 @@ fi
 
 fi
 
+if test "$with_ib_acm" != "" && test "$with_ib_acm" != "no"; then
+if test "${ac_cv_header_infiniband_acm_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for infiniband/acm.h" >&5
+echo $ECHO_N "checking for infiniband/acm.h... $ECHO_C" >&6
+if test "${ac_cv_header_infiniband_acm_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_acm_h" >&5
+echo "${ECHO_T}$ac_cv_header_infiniband_acm_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking infiniband/acm.h usability" >&5
+echo $ECHO_N "checking infiniband/acm.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <infiniband/acm.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking infiniband/acm.h presence" >&5
+echo $ECHO_N "checking infiniband/acm.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <infiniband/acm.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: infiniband/acm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: infiniband/acm.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: infiniband/acm.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: infiniband/acm.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: infiniband/acm.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: infiniband/acm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: infiniband/acm.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/acm.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: infiniband/acm.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## -------------------------------------------- ##
+## Report this to general at lists.openfabrics.org ##
+## -------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for infiniband/acm.h" >&5
+echo $ECHO_N "checking for infiniband/acm.h... $ECHO_C" >&6
+if test "${ac_cv_header_infiniband_acm_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_infiniband_acm_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_acm_h" >&5
+echo "${ECHO_T}$ac_cv_header_infiniband_acm_h" >&6
+
+fi
+if test $ac_cv_header_infiniband_acm_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: IB ACM requested but <infiniband/acm.h> not found." >&5
+echo "$as_me: error: IB ACM requested but <infiniband/acm.h> not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+fi
+
 fi
 
 echo "$as_me:$LINENO: checking whether ld accepts --version-script" >&5
@@ -20908,7 +21164,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by librdmacm $as_me 1.0.10, which was
+This file was extended by librdmacm $as_me 1.0.14, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20971,7 +21227,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-librdmacm config.status 1.0.10
+librdmacm config.status 1.0.14
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -21405,6 +21661,11 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -21443,12 +21704,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
diff --git a/configure.in b/configure.in
index 0dfd666..d4ae89f 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,12 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(librdmacm, 1.0.10, general at lists.openfabrics.org)
+AC_INIT(librdmacm, 1.0.14, general at lists.openfabrics.org)
 AC_CONFIG_SRCDIR([src/cma.c])
 AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR(config)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(librdmacm, 1.0.10)
+AM_INIT_AUTOMAKE(librdmacm, 1.0.14)
 
 AM_PROG_LIBTOOL
 
@@ -21,6 +22,15 @@ if test "$with_valgrind" != "" && test "$with_valgrind" != "no"; then
 	fi
 fi
 
+AC_ARG_WITH([ib_acm],
+    AC_HELP_STRING([--with-ib_acm],
+		   [Use IB ACM for route resolution - default NO]))
+
+if test "$with_ib_acm" != "" && test "$with_ib_acm" != "no"; then
+	AC_DEFINE([USE_IB_ACM], 1,
+		  [Define to 1 to use IB ACM for endpoint resolution])
+fi
+
 AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
 [       if test "$enableval" = "no"; then
                 disable_libcheck=yes
@@ -40,6 +50,10 @@ AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  librdmacm requires libibverbs.]))
 fi
 
+AC_CHECK_MEMBER(struct ibv_path_record.service_id, [],
+    AC_DEFINE(DEFINE_PATH_RECORD, 1, [adding path record definition]),
+    [#include <infiniband/sa.h>])
+
 dnl Checks for header files.
 AC_HEADER_STDC
 if test "$disable_libcheck" != "yes"; then
@@ -51,6 +65,11 @@ AC_CHECK_HEADER(valgrind/memcheck.h, [],
     AC_MSG_ERROR([valgrind requested but <valgrind/memcheck.h> not found.]))
 fi
 
+if test "$with_ib_acm" != "" && test "$with_ib_acm" != "no"; then
+AC_CHECK_HEADER(infiniband/acm.h, [],
+    AC_MSG_ERROR([IB ACM requested but <infiniband/acm.h> not found.]))
+fi
+
 fi
 
 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
diff --git a/examples/cmatose.c b/examples/cmatose.c
index 8c12347..84831ec 100644
--- a/examples/cmatose.c
+++ b/examples/cmatose.c
@@ -75,10 +75,7 @@ struct cmatest {
 	int			connects_left;
 	int			disconnects_left;
 
-	struct sockaddr_in	dst_in;
-	struct sockaddr		*dst_addr;
-	struct sockaddr_in	src_in;
-	struct sockaddr		*src_addr;
+	struct rdma_addr	addr;
 };
 
 static struct cmatest test;
@@ -505,7 +502,7 @@ static int migrate_channel(struct rdma_cm_id *listen_id)
 	return ret;
 }
 
-static int get_addr(char *dst, struct sockaddr_in *addr)
+static int get_addr(char *dst, struct sockaddr *addr)
 {
 	struct addrinfo *res;
 	int ret;
@@ -516,15 +513,15 @@ static int get_addr(char *dst, struct sockaddr_in *addr)
 		return ret;
 	}
 
-	if (res->ai_family != PF_INET) {
+	if (res->ai_family == PF_INET)
+		memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in));
+	else if (res->ai_family == PF_INET6)
+		memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in6));
+	else
 		ret = -1;
-		goto out;
-	}
 
-	*addr = *(struct sockaddr_in *) res->ai_addr;
-out:
-	freeaddrinfo(res);
-	return ret;
+        freeaddrinfo(res);
+        return ret;
 }
 
 static int run_server(void)
@@ -540,14 +537,21 @@ static int run_server(void)
 	}
 
 	if (src_addr) {
-		ret = get_addr(src_addr, &test.src_in);
+		ret = get_addr(src_addr, &test.addr.src_addr);
 		if (ret)
 			goto out;
-	} else
-		test.src_in.sin_family = PF_INET;
+		if (test.addr.src_addr.sa_family == AF_INET)
+			((struct sockaddr_in *) &test.addr.src_addr)->sin_port = port;
+		else
+			((struct sockaddr_in6 *) &test.addr.src_addr)->sin6_port = port;
+		
+	} else {
+		test.addr.src_addr.sa_family = PF_INET;
+		((struct sockaddr_in *) &test.addr.src_addr)->sin_port = port;
+	}
+
+	ret = rdma_bind_addr(listen_id, &test.addr.src_addr);
 
-	test.src_in.sin_port = port;
-	ret = rdma_bind_addr(listen_id, test.src_addr);
 	if (ret) {
 		perror("cmatose: bind address failed");
 		goto out;
@@ -614,22 +618,25 @@ static int run_client(void)
 
 	printf("cmatose: starting client\n");
 	if (src_addr) {
-		ret = get_addr(src_addr, &test.src_in);
+		ret = get_addr(src_addr, &test.addr.src_addr);
 		if (ret)
 			return ret;
 	}
 
-	ret = get_addr(dst_addr, &test.dst_in);
+	ret = get_addr(dst_addr, &test.addr.dst_addr);
 	if (ret)
 		return ret;
 
-	test.dst_in.sin_port = port;
+	if (test.addr.dst_addr.sa_family == AF_INET)
+		((struct sockaddr_in *) &test.addr.dst_addr)->sin_port = port;
+	else
+		((struct sockaddr_in6 *) &test.addr.dst_addr)->sin6_port = port;
 
 	printf("cmatose: connecting\n");
 	for (i = 0; i < connections; i++) {
 		ret = rdma_resolve_addr(test.nodes[i].cma_id,
-					src_addr ? test.src_addr : NULL,
-					test.dst_addr, 2000);
+					src_addr ? &test.addr.src_addr : NULL,
+					&test.addr.dst_addr, 2000);
 		if (ret) {
 			perror("cmatose: failure getting addr");
 			connect_error();
@@ -717,8 +724,6 @@ int main(int argc, char **argv)
 		}
 	}
 
-	test.dst_addr = (struct sockaddr *) &test.dst_in;
-	test.src_addr = (struct sockaddr *) &test.src_in;
 	test.connects_left = connections;
 	test.disconnects_left = connections;
 
diff --git a/examples/mckey.c b/examples/mckey.c
index 467873d..a6b5c4d 100644
--- a/examples/mckey.c
+++ b/examples/mckey.c
@@ -46,6 +46,7 @@
 #include <getopt.h>
 
 #include <rdma/rdma_cma.h>
+#include <infiniband/ib.h>
 
 struct cmatest_node {
 	int			id;
@@ -62,13 +63,14 @@ struct cmatest_node {
 
 struct cmatest {
 	struct rdma_event_channel *channel;
+	pthread_t 		cmathread;
 	struct cmatest_node	*nodes;
 	int			conn_index;
 	int			connects_left;
 
-	struct sockaddr_in6	dst_in;
+	struct sockaddr_storage	dst_in;
 	struct sockaddr		*dst_addr;
-	struct sockaddr_in6	src_in;
+	struct sockaddr_storage	src_in;
 	struct sockaddr		*src_addr;
 };
 
@@ -273,7 +275,8 @@ static int join_handler(struct cmatest_node *node,
 	char buf[40];
 
 	inet_ntop(AF_INET6, param->ah_attr.grh.dgid.raw, buf, 40);
-	printf("mckey: joined dgid: %s\n", buf);
+	printf("mckey: joined dgid: %s mlid 0x%x sl %d\n", buf,
+		param->ah_attr.dlid, param->ah_attr.sl);
 
 	node->remote_qpn = param->qp_num;
 	node->remote_qkey = param->qkey;
@@ -319,6 +322,33 @@ static int cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	return ret;
 }
 
+static void *cma_thread(void *arg)
+{
+	struct rdma_cm_event *event;
+	int ret;
+
+	while (1) {
+		ret = rdma_get_cm_event(test.channel, &event);
+		if (ret) {
+			perror("rdma_get_cm_event");
+			break;
+		}
+
+		switch (event->event) {
+		case RDMA_CM_EVENT_MULTICAST_ERROR:
+		case RDMA_CM_EVENT_ADDR_CHANGE:
+			printf("mckey: event: %s, status: %d\n",
+			       rdma_event_str(event->event), event->status);
+			break;
+		default:
+			break;
+		}
+
+		rdma_ack_cm_event(event);
+	}
+	return NULL;
+}
+
 static void destroy_node(struct cmatest_node *node)
 {
 	if (!node->cma_id)
@@ -431,6 +461,20 @@ static int get_addr(char *dst, struct sockaddr *addr)
 	return ret;
 }
 
+static int get_dst_addr(char *dst, struct sockaddr *addr)
+{
+	struct sockaddr_ib *sib;
+
+	if (!unmapped_addr)
+		return get_addr(dst, addr);
+
+	sib = (struct sockaddr_ib *) addr;
+	memset(sib, 0, sizeof *sib);
+	sib->sib_family = AF_IB;
+	inet_pton(AF_INET6, dst, &sib->sib_addr);
+	return 0;
+}
+
 static int run(void)
 {
 	int i, ret;
@@ -442,7 +486,7 @@ static int run(void)
 			return ret;
 	}
 
-	ret = get_addr(dst_addr, (struct sockaddr *) &test.dst_in);
+	ret = get_dst_addr(dst_addr, (struct sockaddr *) &test.dst_in);
 	if (ret)
 		return ret;
 
@@ -475,6 +519,8 @@ static int run(void)
 	if (ret)
 		goto out;
 
+	pthread_create(&test.cmathread, NULL, cma_thread, NULL);
+
 	/*
 	 * Pause to give SM chance to configure switches.  We don't want to
 	 * handle reliability issue in this simple test program.
@@ -556,6 +602,12 @@ int main(int argc, char **argv)
 		}
 	}
 
+	if (unmapped_addr && !src_addr) {
+		printf("unmapped multicast address requires binding "
+			"to source address\n");
+		exit(1);
+	}
+
 	test.dst_addr = (struct sockaddr *) &test.dst_in;
 	test.connects_left = connections;
 
diff --git a/examples/rdma_client.c b/examples/rdma_client.c
new file mode 100644
index 0000000..7a59d97
--- /dev/null
+++ b/examples/rdma_client.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under the OpenIB.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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#include <rdma/rdma_cma.h>
+#include <rdma/rdma_verbs.h>
+
+static char *server = "127.0.0.1";
+static char *port = "7471";
+
+struct rdma_cm_id *id;
+struct ibv_mr *mr;
+uint8_t send_msg[16];
+uint8_t recv_msg[16];
+
+static int run(void)
+{
+	struct rdma_addrinfo hints, *res;
+	struct ibv_qp_init_attr attr;
+	struct ibv_wc wc;
+	int ret;
+
+	memset(&hints, 0, sizeof hints);
+	hints.ai_port_space = RDMA_PS_TCP;
+	ret = rdma_getaddrinfo(server, port, &hints, &res);
+	if (ret) {
+		printf("rdma_getaddrinfo %d\n", errno);
+		return ret;
+	}
+
+	memset(&attr, 0, sizeof attr);
+	attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
+	attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
+	attr.cap.max_inline_data = 16;
+	attr.qp_context = id;
+	attr.sq_sig_all = 1;
+	ret = rdma_create_ep(&id, res, NULL, &attr);
+	rdma_freeaddrinfo(res);
+	if (ret) {
+		printf("rdma_create_ep %d\n", errno);
+		return ret;
+	}
+
+	mr = rdma_reg_msgs(id, recv_msg, 16);
+	if (!mr) {
+		printf("rdma_reg_msgs %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
+	if (ret) {
+		printf("rdma_post_recv %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_connect(id, NULL);
+	if (ret) {
+		printf("rdma_connect %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
+	if (ret) {
+		printf("rdma_post_send %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_get_recv_comp(id, &wc);
+	if (ret <= 0) {
+		printf("rdma_get_recv_comp %d\n", ret);
+		return ret;
+	}
+
+	rdma_disconnect(id);
+	rdma_dereg_mr(mr);
+	rdma_destroy_ep(id);
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int op, ret;
+
+	while ((op = getopt(argc, argv, "s:p:")) != -1) {
+		switch (op) {
+		case 's':
+			server = optarg;
+			break;
+		case 'p':
+			port = optarg;
+			break;
+		default:
+			printf("usage: %s\n", argv[0]);
+			printf("\t[-s server_address]\n");
+			printf("\t[-p port_number]\n");
+			exit(1);
+		}
+	}
+
+	printf("rdma_client: start\n");
+	ret = run();
+	printf("rdma_client: end %d\n", ret);
+	return ret;
+}
diff --git a/examples/rdma_server.c b/examples/rdma_server.c
new file mode 100644
index 0000000..2831d0c
--- /dev/null
+++ b/examples/rdma_server.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2005-2009 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under the OpenIB.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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#include <netdb.h>
+#include <rdma/rdma_cma.h>
+#include <rdma/rdma_verbs.h>
+
+static char *port = "7471";
+
+struct rdma_cm_id *listen_id, *id;
+struct ibv_mr *mr;
+uint8_t send_msg[16];
+uint8_t recv_msg[16];
+
+static int run(void)
+{
+	struct rdma_addrinfo hints, *res;
+	struct ibv_qp_init_attr attr;
+	struct ibv_wc wc;
+	int ret;
+
+	memset(&hints, 0, sizeof hints);
+	hints.ai_flags = RAI_PASSIVE;
+	hints.ai_port_space = RDMA_PS_TCP;
+	ret = rdma_getaddrinfo(NULL, port, &hints, &res);
+	if (ret) {
+		printf("rdma_getaddrinfo %d\n", errno);
+		return ret;
+	}
+
+	memset(&attr, 0, sizeof attr);
+	attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
+	attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
+	attr.cap.max_inline_data = 16;
+	attr.sq_sig_all = 1;
+	ret = rdma_create_ep(&listen_id, res, NULL, &attr);
+	rdma_freeaddrinfo(res);
+	if (ret) {
+		printf("rdma_create_ep %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_listen(listen_id, 0);
+	if (ret) {
+		printf("rdma_listen %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_get_request(listen_id, &id);
+	if (ret) {
+		printf("rdma_get_request %d\n", errno);
+		return ret;
+	}
+
+	mr = rdma_reg_msgs(id, recv_msg, 16);
+	if (!mr) {
+		printf("rdma_reg_msgs %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
+	if (ret) {
+		printf("rdma_post_recv %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_accept(id, NULL);
+	if (ret) {
+		printf("rdma_connect %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_get_recv_comp(id, &wc);
+	if (ret <= 0) {
+		printf("rdma_get_recv_comp %d\n", ret);
+		return ret;
+	}
+
+	ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
+	if (ret) {
+		printf("rdma_post_send %d\n", errno);
+		return ret;
+	}
+
+	ret = rdma_get_send_comp(id, &wc);
+	if (ret <= 0) {
+		printf("rdma_get_send_comp %d\n", ret);
+		return ret;
+	}
+
+	rdma_disconnect(id);
+	rdma_dereg_mr(mr);
+	rdma_destroy_ep(id);
+	rdma_destroy_ep(listen_id);
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int op, ret;
+
+	while ((op = getopt(argc, argv, "p:")) != -1) {
+		switch (op) {
+		case 'p':
+			port = optarg;
+			break;
+		default:
+			printf("usage: %s\n", argv[0]);
+			printf("\t[-p port_number]\n");
+			exit(1);
+		}
+	}
+
+	printf("rdma_server: start\n");
+	ret = run();
+	printf("rdma_server: end %d\n", ret);
+	return ret;
+}
diff --git a/examples/rping.c b/examples/rping.c
index 91952e7..ee292ec 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -280,10 +280,11 @@ static int rping_cq_event_handler(struct rping_cb *cb)
 		ret = 0;
 
 		if (wc.status) {
-			fprintf(stderr, "cq completion failed status %d\n",
-				wc.status);
 			if (wc.status != IBV_WC_WR_FLUSH_ERR)
-				ret = -1;
+				fprintf(stderr,
+					"cq completion failed status %d\n",
+					wc.status);
+			ret = -1;
 			goto error;
 		}
 
@@ -800,10 +801,9 @@ static void *rping_persistent_server_thread(void *arg)
 
 	rping_test_server(cb);
 	rdma_disconnect(cb->child_cm_id);
+	pthread_join(cb->cqthread, NULL);
 	rping_free_buffers(cb);
 	rping_free_qp(cb);
-	pthread_cancel(cb->cqthread);
-	pthread_join(cb->cqthread, NULL);
 	rdma_destroy_id(cb->child_cm_id);
 	free_cb(cb);
 	return NULL;
@@ -888,6 +888,7 @@ static int rping_run_server(struct rping_cb *cb)
 
 	rping_test_server(cb);
 	rdma_disconnect(cb->child_cm_id);
+	pthread_join(cb->cqthread, NULL);
 	rdma_destroy_id(cb->child_cm_id);
 err2:
 	rping_free_buffers(cb);
@@ -1055,6 +1056,7 @@ static int rping_run_client(struct rping_cb *cb)
 
 	rping_test_client(cb);
 	rdma_disconnect(cb->cm_id);
+	pthread_join(cb->cqthread, NULL);
 err2:
 	rping_free_buffers(cb);
 err1:
diff --git a/include/infiniband/ib.h b/include/infiniband/ib.h
new file mode 100644
index 0000000..2e5029a
--- /dev/null
+++ b/include/infiniband/ib.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.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 AND
+ * 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.
+ */
+
+#if !defined(_RDMA_IB_H)
+#define _RDMA_IB_H
+
+#include <linux/types.h>
+#include <string.h>
+
+#ifndef AF_IB
+#define AF_IB 27
+#endif
+#ifndef PF_IB
+#define PF_IB AF_IB
+#endif
+
+#ifndef __be16
+#define __be16 __u16
+#endif
+#ifndef __be32
+#define __be32 __u32
+#endif
+#ifndef __be64
+#define __be64 __u64
+#endif
+
+struct ib_addr {
+	union {
+		__u8		uib_addr8[16];
+		__be16		uib_addr16[8];
+		__be32		uib_addr32[4];
+		__be64		uib_addr64[2];
+	} ib_u;
+#define sib_addr8		ib_u.uib_addr8
+#define sib_addr16		ib_u.uib_addr16
+#define sib_addr32		ib_u.uib_addr32
+#define sib_addr64		ib_u.uib_addr64
+#define sib_raw			ib_u.uib_addr8
+#define sib_subnet_prefix	ib_u.uib_addr64[0]
+#define sib_interface_id	ib_u.uib_addr64[1]
+};
+
+static inline int ib_addr_any(const struct ib_addr *a)
+{
+	return ((a->sib_addr64[0] | a->sib_addr64[1]) == 0);
+}
+
+static inline int ib_addr_loopback(const struct ib_addr *a)
+{
+	return ((a->sib_addr32[0] | a->sib_addr32[1] |
+		 a->sib_addr32[2] | (a->sib_addr32[3] ^ htonl(1))) == 0);
+}
+
+static inline void ib_addr_set(struct ib_addr *addr,
+			       __be32 w1, __be32 w2, __be32 w3, __be32 w4)
+{
+	addr->sib_addr32[0] = w1;
+	addr->sib_addr32[1] = w2;
+	addr->sib_addr32[2] = w3;
+	addr->sib_addr32[3] = w4;
+}
+
+static inline int ib_addr_cmp(const struct ib_addr *a1, const struct ib_addr *a2)
+{
+	return memcmp(a1, a2, sizeof(struct ib_addr));
+}
+
+struct sockaddr_ib {
+	unsigned short int	sib_family;	/* AF_IB */
+	__be16			sib_pkey;
+	__be32			sib_flowinfo;
+	struct ib_addr		sib_addr;
+	__be64			sib_sid;
+	__be64			sib_sid_mask;
+	__u64			sib_scope_id;
+};
+
+#endif /* _RDMA_IB_H */
diff --git a/include/rdma/rdma_cma.h b/include/rdma/rdma_cma.h
old mode 100644
new mode 100755
index 534489d..b48cd2e
--- a/include/rdma/rdma_cma.h
+++ b/include/rdma/rdma_cma.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005 Voltaire Inc.  All rights reserved.
- * Copyright (c) 2005-2007 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2005-2010 Intel Corporation.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -67,18 +67,24 @@ enum rdma_cm_event_type {
 };
 
 enum rdma_port_space {
-	RDMA_PS_IPOIB= 0x0002,
-	RDMA_PS_TCP  = 0x0106,
-	RDMA_PS_UDP  = 0x0111,
+	RDMA_PS_IPOIB = 0x0002,
+	RDMA_PS_IB    = 0x0003,
+	RDMA_PS_TCP   = 0x0106,
+	RDMA_PS_UDP   = 0x0111,
 };
 
+#define RDMA_IB_IP_PS_MASK   0xFFFFFFFFFFFF0000ULL
+#define RDMA_IB_IP_PORT_MASK 0x000000000000FFFFULL
+#define RDMA_IB_IP_PS_TCP    0x0000000001060000ULL
+#define RDMA_IB_IP_PS_UDP    0x0000000001110000ULL
+
 /*
  * Global qkey value for UDP QPs and multicast groups created via the 
  * RDMA CM.
  */
 #define RDMA_UDP_QKEY 0x01234567
 
-struct ib_addr {
+struct rdma_ib_addr {
 	union ibv_gid	sgid;
 	union ibv_gid	dgid;
 	uint16_t	pkey;
@@ -92,7 +98,7 @@ struct rdma_addr {
 	uint8_t			dst_pad[sizeof(struct sockaddr_storage) -
 					sizeof(struct sockaddr)];
 	union {
-		struct ib_addr	ibaddr;
+		struct rdma_ib_addr	ibaddr;
 	} addr;
 };
 
@@ -114,6 +120,16 @@ struct rdma_cm_id {
 	struct rdma_route	 route;
 	enum rdma_port_space	 ps;
 	uint8_t			 port_num;
+	struct rdma_cm_event	*event;
+	struct ibv_comp_channel *send_cq_channel;
+	struct ibv_cq		*send_cq;
+	struct ibv_comp_channel *recv_cq_channel;
+	struct ibv_cq		*recv_cq;
+};
+
+enum {
+	RDMA_MAX_RESP_RES = 0xFF,
+	RDMA_MAX_INIT_DEPTH = 0xFF
 };
 
 struct rdma_conn_param {
@@ -148,6 +164,28 @@ struct rdma_cm_event {
 	} param;
 };
 
+#define RAI_PASSIVE		0x00000001
+#define RAI_NUMERICHOST		0x00000002
+#define RAI_NOROUTE		0x00000004
+
+struct rdma_addrinfo {
+	int			ai_flags;
+	int			ai_family;
+	int			ai_qp_type;
+	int			ai_port_space;
+	socklen_t		ai_src_len;
+	socklen_t		ai_dst_len;
+	struct sockaddr		*ai_src_addr;
+	struct sockaddr		*ai_dst_addr;
+	char			*ai_src_canonname;
+	char			*ai_dst_canonname;
+	size_t			ai_route_len;
+	void			*ai_route;
+	size_t			ai_connect_len;
+	void			*ai_connect;
+	struct rdma_addrinfo	*ai_next;
+};
+
 /**
  * rdma_create_event_channel - Open a channel used to report communication events.
  * Description:
@@ -202,6 +240,43 @@ int rdma_create_id(struct rdma_event_channel *channel,
 		   enum rdma_port_space ps);
 
 /**
+ * rdma_create_ep - Allocate a communication identifier and qp.
+ * @id: A reference where the allocated communication identifier will be
+ *   returned.
+ * @res: Result from rdma_getaddrinfo, which specifies the source and
+ *   destination addresses, plus optional routing and connection information.
+ * @pd: Optional protection domain.  This parameter is ignored if qp_init_attr
+ *   is NULL.
+ * @qp_init_attr: Optional attributes for a QP created on the rdma_cm_id.
+ * Description:
+ *   Create an identifier and option QP used for communication.
+ * Notes:
+ *   If qp_init_attr is provided, then a queue pair will be allocated and
+ *   associated with the rdma_cm_id.  If a pd is provided, the QP will be
+ *   created on that PD.  Otherwise, the QP will be allocated on a default
+ *   PD.
+ *   The rdma_cm_id will be set to use synchronous operations (connect,
+ *   listen, and get_request).  To convert to asynchronous operation, the
+ *   rdma_cm_id should be migrated to a user allocated event channel.
+ * See also:
+ *   rdma_create_id, rdma_create_qp, rdma_migrate_id, rdma_connect,
+ *   rdma_listen
+ */
+int rdma_create_ep(struct rdma_cm_id **id, struct rdma_addrinfo *res,
+		   struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr);
+
+/**
+ * rdma_destroy_ep - Deallocates a communication identifier and qp.
+ * @id: The communication identifer to destroy.
+ * Description:
+ *   Destroys the specified rdma_cm_id and any associated QP created
+ *   on that id.
+ * See also:
+ *   rdma_create_ep
+ */
+void rdma_destroy_ep(struct rdma_cm_id *id);
+
+/**
  * rdma_destroy_id - Release a communication identifier.
  * @id: The communication identifier to destroy.
  * Description:
@@ -278,7 +353,7 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms);
 /**
  * rdma_create_qp - Allocate a QP.
  * @id: RDMA identifier.
- * @pd: protection domain for the QP.
+ * @pd: Optional protection domain for the QP.
  * @qp_init_attr: initial QP attributes.
  * Description:
  *  Allocate a QP associated with the specified rdma_cm_id and transition it
@@ -290,6 +365,8 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms);
  *   librdmacm through their states.  After being allocated, the QP will be
  *   ready to handle posting of receives.  If the QP is unconnected, it will
  *   be ready to post sends.
+ *   If pd is NULL, then the QP will be allocated using a default protection
+ *   domain associated with the underlying RDMA device.
  * See also:
  *   rdma_bind_addr, rdma_resolve_addr, rdma_destroy_qp, ibv_create_qp,
  *   ibv_modify_qp
@@ -313,7 +390,7 @@ void rdma_destroy_qp(struct rdma_cm_id *id);
 /**
  * rdma_connect - Initiate an active connection request.
  * @id: RDMA identifier.
- * @conn_param: connection parameters.
+ * @conn_param: optional connection parameters.
  * Description:
  *   For a connected rdma_cm_id, this call initiates a connection request
  *   to a remote destination.  For an unconnected rdma_cm_id, it initiates
@@ -321,6 +398,8 @@ void rdma_destroy_qp(struct rdma_cm_id *id);
  * Notes:
  *   Users must have resolved a route to the destination address
  *   by having called rdma_resolve_route before calling this routine.
+ *   A user may override the default connection parameters and exchange
+ *   private data as part of the connection by using the conn_param parameter.
  * See also:
  *   rdma_resolve_route, rdma_disconnect, rdma_listen, rdma_get_cm_event
  */
@@ -347,9 +426,14 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
 int rdma_listen(struct rdma_cm_id *id, int backlog);
 
 /**
+ * rdma_get_request
+ */
+int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id);
+
+/**
  * rdma_accept - Called to accept a connection request.
  * @id: Connection identifier associated with the request.
- * @conn_param: Information needed to establish the connection.
+ * @conn_param: Optional information needed to establish the connection.
  * Description:
  *   Called from the listening side to accept a connection or datagram
  *   service lookup request.
@@ -360,6 +444,8 @@ int rdma_listen(struct rdma_cm_id *id, int backlog);
  *   events give the user a newly created rdma_cm_id, similar to a new
  *   socket, but the rdma_cm_id is bound to a specific RDMA device.
  *   rdma_accept is called on the new rdma_cm_id.
+ *   A user may override the default connection parameters and exchange
+ *   private data as part of the connection by using the conn_param parameter.
  * See also:
  *   rdma_listen, rdma_reject, rdma_get_cm_event
  */
@@ -547,12 +633,14 @@ const char *rdma_event_str(enum rdma_cm_event_type event);
 
 /* Option levels */
 enum {
-	RDMA_OPTION_ID		= 0
+	RDMA_OPTION_ID		= 0,
+	RDMA_OPTION_IB		= 1
 };
 
 /* Option details */
 enum {
-	RDMA_OPTION_ID_TOS	= 0	/* uint8_t: RFC 2474 */
+	RDMA_OPTION_ID_TOS	= 0,	/* uint8_t: RFC 2474 */
+	RDMA_OPTION_IB_PATH	= 1	/* struct ibv_path_data[] */
 };
 
 /**
@@ -573,6 +661,15 @@ int rdma_set_option(struct rdma_cm_id *id, int level, int optname,
  */
 int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel);
 
+/**
+ * rdma_getaddrinfo - RDMA address and route resolution service.
+ */
+int rdma_getaddrinfo(char *node, char *service,
+		     struct rdma_addrinfo *hints,
+		     struct rdma_addrinfo **res);
+
+void rdma_freeaddrinfo(struct rdma_addrinfo *res);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/rdma/rdma_cma_abi.h b/include/rdma/rdma_cma_abi.h
index 1a3a9c2..ddd0d90 100644
--- a/include/rdma/rdma_cma_abi.h
+++ b/include/rdma/rdma_cma_abi.h
@@ -35,6 +35,7 @@
 
 #include <infiniband/kern-abi.h>
 #include <infiniband/sa-kern-abi.h>
+#include <infiniband/sa.h>
 
 /*
  * This file must be kept in sync with the kernel's version of rdma_user_cm.h
@@ -48,8 +49,8 @@
 enum {
 	UCMA_CMD_CREATE_ID,
 	UCMA_CMD_DESTROY_ID,
-	UCMA_CMD_BIND_ADDR,
-	UCMA_CMD_RESOLVE_ADDR,
+	UCMA_CMD_BIND_IP,
+	UCMA_CMD_RESOLVE_IP,
 	UCMA_CMD_RESOLVE_ROUTE,
 	UCMA_CMD_QUERY_ROUTE,
 	UCMA_CMD_CONNECT,
@@ -62,9 +63,13 @@ enum {
 	UCMA_CMD_GET_OPTION,
 	UCMA_CMD_SET_OPTION,
 	UCMA_CMD_NOTIFY,
- 	UCMA_CMD_JOIN_MCAST,
+ 	UCMA_CMD_JOIN_IP_MCAST,
  	UCMA_CMD_LEAVE_MCAST,
-	UCMA_CMD_MIGRATE_ID
+	UCMA_CMD_MIGRATE_ID,
+	UCMA_CMD_QUERY,
+	UCMA_CMD_BIND,
+	UCMA_CMD_RESOLVE_ADDR,
+	UCMA_CMD_JOIN_MCAST
 };
 
 struct ucma_abi_cmd_hdr {
@@ -77,7 +82,8 @@ struct ucma_abi_create_id {
 	__u64 uid;
 	__u64 response;
 	__u16 ps;
-	__u8  reserved[6];
+	__u8  qp_type;
+	__u8  reserved[5];
 };
 
 struct ucma_abi_create_id_resp {
@@ -94,28 +100,51 @@ struct ucma_abi_destroy_id_resp {
 	__u32 events_reported;
 };
 
-struct ucma_abi_bind_addr {
+struct ucma_abi_bind_ip {
 	__u64 response;
 	struct sockaddr_in6 addr;
 	__u32 id;
 };
 
-struct ucma_abi_resolve_addr {
+struct ucma_abi_bind {
+	__u32 id;
+	__u16 addr_size;
+	__u16 reserved;
+	struct sockaddr_storage addr;
+};
+
+struct ucma_abi_resolve_ip {
 	struct sockaddr_in6 src_addr;
 	struct sockaddr_in6 dst_addr;
 	__u32 id;
 	__u32 timeout_ms;
 };
 
+struct ucma_abi_resolve_addr {
+	__u32 id;
+	__u32 timeout_ms;
+	__u16 src_size;
+	__u16 dst_size;
+	__u32 reserved;
+	struct sockaddr_storage src_addr;
+	struct sockaddr_storage dst_addr;
+};
+
 struct ucma_abi_resolve_route {
 	__u32 id;
 	__u32 timeout_ms;
 };
 
-struct ucma_abi_query_route {
+enum {
+	UCMA_QUERY_ADDR,
+	UCMA_QUERY_PATH,
+	UCMA_QUERY_GID
+};
+
+struct ucma_abi_query {
 	__u64 response;
 	__u32 id;
-	__u32 reserved;
+	__u32 option;
 };
 
 struct ucma_abi_query_route_resp {
@@ -128,6 +157,23 @@ struct ucma_abi_query_route_resp {
 	__u8 reserved[3];
 };
 
+struct ucma_abi_query_addr_resp {
+	__u64 node_guid;
+	__u8  port_num;
+	__u8  reserved;
+	__u16 pkey;
+	__u16 src_size;
+	__u16 dst_size;
+	struct sockaddr_storage src_addr;
+	struct sockaddr_storage dst_addr;
+};
+
+struct ucma_abi_query_path_resp {
+	__u32 num_paths;
+	__u32 reserved;
+	struct ibv_path_data path_data[0];
+};
+
 struct ucma_abi_conn_param {
 	__u32 qp_num;
 	__u32 reserved;
@@ -192,13 +238,22 @@ struct ucma_abi_notify {
 	__u32 event;
 };
 
-struct ucma_abi_join_mcast {
+struct ucma_abi_join_ip_mcast {
 	__u64 response;		/* ucma_abi_create_id_resp */
 	__u64 uid;
 	struct sockaddr_in6 addr;
 	__u32 id;
 };
 
+struct ucma_abi_join_mcast {
+	__u64 response;		/* rdma_ucma_create_id_resp */
+	__u64 uid;
+	__u32 id;
+	__u16 addr_size;
+	__u16 reserved;
+	struct sockaddr_storage addr;
+};
+
 struct ucma_abi_get_event {
 	__u64 response;
 };
diff --git a/include/rdma/rdma_verbs.h b/include/rdma/rdma_verbs.h
new file mode 100644
index 0000000..e6a6b42
--- /dev/null
+++ b/include/rdma/rdma_verbs.h
@@ -0,0 +1,296 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.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 AND
+ * 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.
+ */
+
+#if !defined(RDMA_VERBS_H)
+#define RDMA_VERBS_H
+
+#include <assert.h>
+#include <infiniband/verbs.h>
+#include <rdma/rdma_cma.h>
+#include <errno.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline int rdma_seterrno(int ret)
+{
+	if (ret) {
+		errno = ret;
+		ret = -1;
+	}
+	return ret;
+}
+
+/*
+ * Memory registration helpers.
+ */
+static inline struct ibv_mr *
+rdma_reg_msgs(struct rdma_cm_id *id, void *addr, size_t length)
+{
+	return ibv_reg_mr(id->qp->pd, addr, length, IBV_ACCESS_LOCAL_WRITE);
+}
+
+static inline struct ibv_mr *
+rdma_reg_read(struct rdma_cm_id *id, void *addr, size_t length)
+{
+	return ibv_reg_mr(id->qp->pd, addr, length, IBV_ACCESS_LOCAL_WRITE |
+						    IBV_ACCESS_REMOTE_READ);
+}
+
+static inline struct ibv_mr *
+rdma_reg_write(struct rdma_cm_id *id, void *addr, size_t length)
+{
+	return ibv_reg_mr(id->qp->pd, addr, length, IBV_ACCESS_LOCAL_WRITE |
+						    IBV_ACCESS_REMOTE_WRITE);
+}
+
+static inline int
+rdma_dereg_mr(struct ibv_mr *mr)
+{
+	return rdma_seterrno(ibv_dereg_mr(mr));
+}
+
+
+/*
+ * Vectored send, receive, and RDMA operations.
+ * Support multiple scatter-gather entries.
+ */
+static inline int
+rdma_post_recvv(struct rdma_cm_id *id, void *context, struct ibv_sge *sgl,
+		int nsge)
+{
+	struct ibv_recv_wr wr, *bad;
+
+	wr.wr_id = (uintptr_t) context;
+	wr.next = NULL;
+	wr.sg_list = sgl;
+	wr.num_sge = nsge;
+
+	return rdma_seterrno(ibv_post_recv(id->qp, &wr, &bad));
+}
+
+static inline int
+rdma_post_sendv(struct rdma_cm_id *id, void *context, struct ibv_sge *sgl,
+		int nsge, int flags)
+{
+	struct ibv_send_wr wr, *bad;
+
+	wr.wr_id = (uintptr_t) context;
+	wr.next = NULL;
+	wr.sg_list = sgl;
+	wr.num_sge = nsge;
+	wr.opcode = IBV_WR_SEND;
+	wr.send_flags = flags;
+
+	return rdma_seterrno(ibv_post_send(id->qp, &wr, &bad));
+}
+
+static inline int
+rdma_post_readv(struct rdma_cm_id *id, void *context, struct ibv_sge *sgl,
+		int nsge, int flags, uint64_t remote_addr, uint32_t rkey)
+{
+	struct ibv_send_wr wr, *bad;
+
+	wr.wr_id = (uintptr_t) context;
+	wr.next = NULL;
+	wr.sg_list = sgl;
+	wr.num_sge = nsge;
+	wr.opcode = IBV_WR_RDMA_READ;
+	wr.send_flags = flags;
+	wr.wr.rdma.remote_addr = remote_addr;
+	wr.wr.rdma.rkey = rkey;
+
+	return rdma_seterrno(ibv_post_send(id->qp, &wr, &bad));
+}
+
+static inline int
+rdma_post_writev(struct rdma_cm_id *id, void *context, struct ibv_sge *sgl,
+		 int nsge, int flags, uint64_t remote_addr, uint32_t rkey)
+{
+	struct ibv_send_wr wr, *bad;
+
+	wr.wr_id = (uintptr_t) context;
+	wr.next = NULL;
+	wr.sg_list = sgl;
+	wr.num_sge = nsge;
+	wr.opcode = IBV_WR_RDMA_WRITE;
+	wr.send_flags = flags;
+	wr.wr.rdma.remote_addr = remote_addr;
+	wr.wr.rdma.rkey = rkey;
+
+	return rdma_seterrno(ibv_post_send(id->qp, &wr, &bad));
+}
+
+/*
+ * Simple send, receive, and RDMA calls.
+ */
+static inline int
+rdma_post_recv(struct rdma_cm_id *id, void *context, void *addr,
+	       size_t length, struct ibv_mr *mr)
+{
+	struct ibv_sge sge;
+
+	assert((addr >= mr->addr) &&
+		(((uint8_t *) addr + length) <= ((uint8_t *) mr->addr + mr->length)));
+	sge.addr = (uint64_t) (uintptr_t) addr;
+	sge.length = (uint32_t) length;
+	sge.lkey = mr->lkey;
+
+	return rdma_post_recvv(id, context, &sge, 1);
+}
+
+static inline int
+rdma_post_send(struct rdma_cm_id *id, void *context, void *addr,
+	       size_t length, struct ibv_mr *mr, int flags)
+{
+	struct ibv_sge sge;
+
+	sge.addr = (uint64_t) (uintptr_t) addr;
+	sge.length = (uint32_t) length;
+	sge.lkey = mr ? mr->lkey : 0;
+
+	return rdma_post_sendv(id, context, &sge, 1, flags);
+}
+
+static inline int
+rdma_post_read(struct rdma_cm_id *id, void *context, void *addr,
+	       size_t length, struct ibv_mr *mr, int flags,
+	       uint64_t remote_addr, uint32_t rkey)
+{
+	struct ibv_sge sge;
+
+	sge.addr = (uint64_t) (uintptr_t) addr;
+	sge.length = (uint32_t) length;
+	sge.lkey = mr->lkey;
+
+	return rdma_post_readv(id, context, &sge, 1, flags, remote_addr, rkey);
+}
+
+static inline int
+rdma_post_write(struct rdma_cm_id *id, void *context, void *addr,
+		size_t length, struct ibv_mr *mr, int flags,
+		uint64_t remote_addr, uint32_t rkey)
+{
+	struct ibv_sge sge;
+
+	sge.addr = (uint64_t) (uintptr_t) addr;
+	sge.length = (uint32_t) length;
+	sge.lkey = mr ? mr->lkey : 0;
+
+	return rdma_post_writev(id, context, &sge, 1, flags, remote_addr, rkey);
+}
+
+static inline int
+rdma_post_ud_send(struct rdma_cm_id *id, void *context, void *addr,
+		  size_t length, struct ibv_mr *mr, int flags,
+		  struct ibv_ah *ah, uint32_t remote_qpn)
+{
+	struct ibv_send_wr wr, *bad;
+	struct ibv_sge sge;
+
+	sge.addr = (uint64_t) (uintptr_t) addr;
+	sge.length = (uint32_t) length;
+	sge.lkey = mr ? mr->lkey : 0;
+
+	wr.wr_id = (uintptr_t) context;
+	wr.next = NULL;
+	wr.sg_list = &sge;
+	wr.num_sge = 1;
+	wr.opcode = IBV_WR_SEND;
+	wr.send_flags = flags;
+	wr.wr.ud.ah = ah;
+	wr.wr.ud.remote_qpn = remote_qpn;
+	wr.wr.ud.remote_qkey = RDMA_UDP_QKEY;
+
+	return rdma_seterrno(ibv_post_send(id->qp, &wr, &bad));
+}
+
+static inline int
+rdma_get_send_comp(struct rdma_cm_id *id, struct ibv_wc *wc)
+{
+	struct ibv_cq *cq;
+	void *context;
+	int ret;
+
+	ret = ibv_poll_cq(id->send_cq, 1, wc);
+	if (ret)
+		goto out;
+
+	ret = ibv_req_notify_cq(id->send_cq, 0);
+	if (ret)
+		return rdma_seterrno(ret);
+
+	while (!(ret = ibv_poll_cq(id->send_cq, 1, wc))) {
+		ret = ibv_get_cq_event(id->send_cq_channel, &cq, &context);
+		if (ret)
+			return rdma_seterrno(ret);
+
+		assert(cq == id->send_cq && context == id);
+		ibv_ack_cq_events(id->send_cq, 1);
+	}
+out:
+	return (ret < 0) ? rdma_seterrno(ret) : ret;
+}
+
+static inline int
+rdma_get_recv_comp(struct rdma_cm_id *id, struct ibv_wc *wc)
+{
+	struct ibv_cq *cq;
+	void *context;
+	int ret;
+
+	ret = ibv_poll_cq(id->recv_cq, 1, wc);
+	if (ret)
+		goto out;
+
+	ret = ibv_req_notify_cq(id->recv_cq, 0);
+	if (ret)
+		return rdma_seterrno(ret);
+
+	while (!(ret = ibv_poll_cq(id->recv_cq, 1, wc))) {
+		ret = ibv_get_cq_event(id->recv_cq_channel, &cq, &context);
+		if (ret)
+			return rdma_seterrno(ret);
+
+		assert(cq == id->recv_cq && context == id);
+		ibv_ack_cq_events(id->recv_cq, 1);
+	}
+out:
+	return (ret < 0) ? rdma_seterrno(ret) : ret;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDMA_CMA_H */
diff --git a/librdmacm.spec b/librdmacm.spec
index adb33bb..65eff40 100644
--- a/librdmacm.spec
+++ b/librdmacm.spec
@@ -1,7 +1,7 @@
-%define ver 1.0.10
+%define ver 1.0.14
 
 Name: librdmacm
-Version: 1.0.10
+Version: 1.0.14
 Release: 1%{?dist}
 Summary: Userspace RDMA Connection Manager
 
diff --git a/librdmacm.spec.in b/librdmacm.spec.in
index 2339ecb..fccca3b 100644
--- a/librdmacm.spec.in
+++ b/librdmacm.spec.in
@@ -1,7 +1,7 @@
 %define ver @VERSION@
 
 Name: librdmacm
-Version: 1.0.10
+Version: 1.0.14
 Release: 1%{?dist}
 Summary: Userspace RDMA Connection Manager
 
diff --git a/man/mckey.1 b/man/mckey.1
index da31156..4418819 100644
--- a/man/mckey.1
+++ b/man/mckey.1
@@ -47,6 +47,11 @@ UDP (0x0111) or IPoIB (0x0002) port space.  (default RDMA_PS_UDP)
 Basic usage is to start mckey -m multicast_address on a server system,
 then run mckey -m multicast_address -s on a client system.
 .P
+Unique Infiniband SA assigned multicast GIDs can be retrived by
+invoking mckey with a zero MGID or IP address.  (Example, -M 0 or
+-m 0.0.0.0).  The assigned address will be displayed to allow
+mckey clients to join the created group. 
+.P
 Because this test maps RDMA resources to userspace, users must ensure
 that they have available system resources and permissions.  See the
 libibverbs README file for additional details.
diff --git a/man/rdma_accept.3 b/man/rdma_accept.3
index bdf90bd..ac04e2c 100644
--- a/man/rdma_accept.3
+++ b/man/rdma_accept.3
@@ -16,6 +16,9 @@ below for details.
 .SH "DESCRIPTION"
 Called from the listening side to accept a connection or datagram
 service lookup request.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Unlike the socket accept routine, rdma_accept is not called on a
 listening rdma_cm_id.  Instead, after calling rdma_listen, the user
diff --git a/man/rdma_ack_cm_event.3 b/man/rdma_ack_cm_event.3
index 3c24357..bcf20f7 100644
--- a/man/rdma_ack_cm_event.3
+++ b/man/rdma_ack_cm_event.3
@@ -14,5 +14,8 @@ All events which are allocated by rdma_get_cm_event must be released,
 there should be a one-to-one correspondence between successful gets
 and acks.  This call frees the event structure and any memory that it
 references.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "SEE ALSO"
 rdma_get_cm_event(3), rdma_destroy_id(3)
diff --git a/man/rdma_bind_addr.3 b/man/rdma_bind_addr.3
index 06f30ce..8f9bc60 100644
--- a/man/rdma_bind_addr.3
+++ b/man/rdma_bind_addr.3
@@ -16,6 +16,9 @@ Local address information.  Wildcard values are permitted.
 Associates a source address with an rdma_cm_id.  The address may be
 wildcarded.  If binding to a specific local address, the rdma_cm_id
 will also be bound to a local RDMA device.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Typically, this routine is called before calling rdma_listen to bind
 to a specific port number, but it may also be called on the active side
diff --git a/man/rdma_client.1 b/man/rdma_client.1
new file mode 100644
index 0000000..68bfc76
--- /dev/null
+++ b/man/rdma_client.1
@@ -0,0 +1,31 @@
+.TH "RDMA_CLIENT" 1 "2010-07-19" "librdmacm" "librdmacm" librdmacm
+.SH NAME
+rdma_client \- simple RDMA CM connection and ping-pong test.
+.SH SYNOPSIS
+.sp
+.nf
+\fIrdma_client\fR [-s server_address] [-p server_port]
+.fi
+.SH "DESCRIPTION"
+Uses synchronous librdmam calls to establish an RDMA connection between
+two nodes.  This example is intended to provide a very simple coding
+example of how to use RDMA.
+.SH "OPTIONS"
+.TP
+\-s server_address
+Specifies the address of the system that the rdma_server is running on.
+By default, the client will attempt to connect to the server using
+127.0.0.1.
+.TP
+\-p server_port
+Specifies the port number that the server listens on.  By default the server
+listens on port 7471.
+.SH "NOTES"
+Basic usage is to start rdma_server, then connect to the server using the
+rdma_client program.
+.P
+Because this test maps RDMA resources to userspace, users must ensure
+that they have available system resources and permissions.  See the
+libibverbs README file for additional details.
+.SH "SEE ALSO"
+rdma_cm(7), udaddy(1), mckey(1), rping(1), rdma_server(1)
diff --git a/man/rdma_cm.7 b/man/rdma_cm.7
index fd04959..ee8427a 100644
--- a/man/rdma_cm.7
+++ b/man/rdma_cm.7
@@ -1,4 +1,4 @@
-.TH "RDMA_CM" 7 "2008-01-02" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.TH "RDMA_CM" 7 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
 .SH NAME
 rdma_cm \- RDMA communication manager.
 .SH SYNOPSIS
@@ -8,17 +8,70 @@ Used to establish communication over RDMA transports.
 .SH "NOTES"
 The RDMA CM is a communication manager used to setup reliable, connected
 and unreliable datagram data transfers.  It provides an RDMA transport
-neutral interface for establishing connections.  The API is based on sockets,
-but adapted for queue pair (QP) based semantics: communication must be
-over a specific RDMA device, and data transfers are message based.
+neutral interface for establishing connections.  The API concepts are
+based on sockets, but adapted for queue pair (QP) based semantics:
+communication must be over a specific RDMA device, and data transfers
+are message based.
 .P
-The RDMA CM only provides the communication management (connection setup /
-teardown) portion of an RDMA API.  It works in conjunction with the verbs
+The RDMA CM can control both the QP and communication management (connection setup /
+teardown) portions of an RDMA API, or only the communication management
+piece.  It works in conjunction with the verbs
 API defined by the libibverbs library.  The libibverbs library provides the
-interfaces needed to send and receive data.
+underlying interfaces needed to send and receive data.
+.P
+The RDMA CM can operate asynchronously or synchronously.  The mode of
+operation is controlled by the user through the use of the rdma_cm event channel
+parameter in specific calls.  If an event channel is provided, an rdma_cm identifier
+will report its event data (results of connecting, for example), on that channel.
+If a channel is not provided, then all rdma_cm operations for the selected
+rdma_cm identifier will block until they complete.
+.SH "RDMA VERBS"
+The rdma_cm supports the full range of verbs available through the libibverbs
+library and interfaces.  However, it also provides wrapper functions for some
+of the more commonly used verbs funcationality.  The full set of abstracted
+verb calls are:
+.P
+rdma_reg_msgs  - register an array of buffers for sending and receiving
+.P
+rdma_reg_read  - registers a buffer for RDMA read operations
+.P
+rdma_reg_write - registers a buffer for RDMA write operations
+.P
+rdma_dereg_mr  - deregisters a memory region
+.P
+rdma_post_recv  - post a buffer to receive a message
+.P
+rdma_post_send  - post a buffer to send a message
+.P
+rdma_post_read  - post an RDMA to read data into a buffer
+.P
+rdma_post_write - post an RDMA to send data from a buffer
+.P
+rdma_post_recvv  - post a vector of buffers to receive a message
+.P
+rdma_post_sendv  - post a vector of buffers to send a message
+.P
+rdma_post_readv  - post a vector of buffers to receive an RDMA read
+.P
+rdma_post_writev - post a vector of buffers to send an RDMA write
+.P
+rdma_post_ud_send - post a buffer to send a message on a UD QP
+.P
+rdma_get_send_comp - get completion status for a send or RDMA operation
+.P
+rdma_get_recv_comp - get information about a completed receive
 .SH "CLIENT OPERATION"
 This section provides a general overview of the basic operation for the active,
-or client, side of communication.  A general connection flow would be:
+or client, side of communication.  This flow assume asynchronous operation with
+low level call details shown.  For
+synchronous operation, calls to rdma_create_event_channel, rdma_get_cm_event,
+rdma_ack_cm_event, and rdma_destroy_event_channel
+would be eliminated.  Abstracted calls, such as rdma_create_ep encapsulate
+serveral of these calls under a single API.
+Users may also refer to the example applications for
+code samples.  A general connection flow would be:
+.IP rdma_getaddrinfo
+retrieve address information of the destination
 .IP rdma_create_event_channel
 create channel to receive events
 .IP rdma_create_id
@@ -109,7 +162,7 @@ success
 .IP "= -1"
 error - see errno for more details
 .P
-Librdmacm functions return 0 to indicate success, and a -1 return value
+Most librdmacm functions return 0 to indicate success, and a -1 return value
 to indicate failure.  If a function operates asynchronously, a return value of 0
 means that the operation was successfully started.  The operation could still
 complete in error; users should check the status of the related event.  If the
@@ -121,12 +174,56 @@ related to ENOMEM, ENODEV, ENODATA, EINVAL, and EADDRNOTAVAIL codes. Application
 that want to check these codes and have compatability with prior library versions
 must manually set errno to the negative of the return code if it is < -1.
 .SH "SEE ALSO"
-rdma_create_event_channel(3), rdma_get_cm_event(3), rdma_create_id(3),
-rdma_resolve_addr(3), rdma_bind_addr(3), rdma_create_qp(3),
-rdma_resolve_route(3), rdma_connect(3), rdma_listen(3), rdma_accept(3),
-rdma_reject(3), rdma_join_multicast(3), rdma_leave_multicast(3), rdma_notify(3),
-rdma_ack_cm_event(3), rdma_disconnect(3), rdma_destroy_qp(3), rdma_destroy_id(3),
-rdma_destroy_event_channel(3), rdma_get_devices(3), rdma_free_devices(3),
-rdma_get_peer_addr(3), rdma_get_local_addr(3),
-rdma_get_dst_port(3), rdma_get_src_port(3), rdma_set_option(3)
-ucmatose(1), udaddy(1), mckey(1), rping(1)
+rdma_accept(3),
+rdma_ack_cm_event(3),
+rdma_bind_addr(3),
+rdma_connect(3),
+rdma_create_ep(3),
+rdma_create_event_channel(3),
+rdma_create_id(3),
+rdma_create_qp(3),
+rdma_dereg_mr(3),
+rdma_destroy_ep(3),
+rdma_destroy_event_channel(3),
+rdma_destroy_id(3),
+rdma_destroy_qp(3),
+rdma_disconnect(3),
+rdma_event_str(3),
+rdma_free_devices(3),
+rdma_getaddrinfo(3),
+rdma_get_cm_event(3),
+rdma_get_devices(3),
+rdma_get_dst_port(3),
+rdma_get_local_addr(3),
+rdma_get_peer_addr(3),
+rdma_get_recv_comp(3),
+rdma_get_request(3),
+rdma_get_send_comp(3),
+rdma_get_src_port(3),
+rdma_join_multicast(3),
+rdma_leave_multicast(3),
+rdma_listen(3),
+rdma_migrate_id(3),
+rdma_notify(3),
+rdma_post_read(3)
+rdma_post_readv(3),
+rdma_post_recv(3),
+rdma_post_recvv(3),
+rdma_post_send(3),
+rdma_post_sendv(3),
+rdma_post_ud_send(3),
+rdma_post_write(3),
+rdma_post_writev(3),
+rdma_reg_msgs(3),
+rdma_reg_read(3),
+rdma_reg_write(3),
+rdma_reject(3),
+rdma_resolve_addr(3),
+rdma_resolve_route(3),
+rdma_set_option(3)
+mckey(1),
+rdma_client(1),
+rdma_server(1),
+rping(1),
+ucmatose(1),
+udaddy(1)
diff --git a/man/rdma_connect.3 b/man/rdma_connect.3
index 8dab9ee..b0cc51e 100644
--- a/man/rdma_connect.3
+++ b/man/rdma_connect.3
@@ -1,4 +1,4 @@
-.TH "RDMA_CONNECT" 3 "2007-10-31" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.TH "RDMA_CONNECT" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
 .SH NAME
 rdma_connect \- Initiate an active connection request.
 .SH SYNOPSIS
@@ -16,9 +16,13 @@ connection parameters.  See CONNECTION PROPERTIES below for details.
 For an rdma_cm_id of type RDMA_PS_TCP, this call initiates a connection request
 to a remote destination.  For an rdma_cm_id of type RDMA_PS_UDP, it initiates
 a lookup of the remote QP providing the datagram service.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Users must have resolved a route to the destination address
-by having called rdma_resolve_route before calling this routine.
+by having called rdma_resolve_route or rdma_create_ep before calling
+this routine.
 .SH "CONNECTION PROPERTIES"
 The following properties are used to configure the communication and specified
 by the conn_param parameter when connecting or establishing datagram
diff --git a/man/rdma_create_ep.3 b/man/rdma_create_ep.3
new file mode 100644
index 0000000..cb9b8b6
--- /dev/null
+++ b/man/rdma_create_ep.3
@@ -0,0 +1,60 @@
+.TH "RDMA_CREATE_EP" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_create_ep \- Allocate a communication identifier and optional QP.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_cma.h>"
+.P
+.B "int" rdma_create_ep
+.BI "(struct rdma_cm_id **" id ","
+.BI "struct rdma_addrinfo *" res ","
+.BI "struct ibv_pd  *" pd ","
+.BI "struct ibv_qp_init_attr *" qp_init_attr ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference where the allocated communication identifier will be
+returned.
+.IP "res" 12
+Address information associated with the rdma_cm_id returned from
+rdma_getaddrinfo.
+.IP "pd" 12
+Optional protection domain if a QP is associated with the rdma_cm_id.
+.IP "qp_init_attr" 12
+Optional initial QP attributes.
+.SH "DESCRIPTION"
+Creates an identifier that is used to track communication information.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+After resolving address information using rdma_getaddrinfo, a user
+may use this call to allocate an rdma_cm_id based on the results.
+.P
+If the rdma_cm_id will be used on the active side of a connection,
+meaning that res->ai_flag does not have RAI_PASSIVE set, rdma_create_ep
+will automatically create a QP on the rdma_cm_id if qp_init_attr is
+not NULL.  The QP will be associated with the specified protection
+domain, if provided, or a default protection domain if not.  Users
+should see rdma_create_qp for details on the use of the pd and
+qp_init_attr parameters.  After calling rdma_create_ep, the returned
+rdma_cm_id may be connected by calling rdma_connect.  The active side
+calls rdma_resolve_addr and rdma_resolve_route are not necessary.
+.P
+If the rdma_cm_id will be used on the passive side of a connection,
+indicated by having res->ai_flag RAI_PASSIVE set, this call will save
+the provided pd and qp_init_attr parameters.  When a new connection
+request is retrieved by calling rdma_get_request, the rdma_cm_id
+associated with the new connection will automatically be associated
+with a QP using the pd and qp_init_attr parameters.  After calling
+rdma_create_ep, the returned rdma_cm_id may be placed into a listening
+state by immediately calling rdma_listen.  The passive side call
+rdma_bind_addr is not necessary.  Connection requests may then be
+retrieved by calling rdma_get_request.
+.P
+The newly created rdma_cm_id will be set to use synchronous operation.
+Users that wish asynchronous operation must migrate the rdma_cm_id
+to a user created event channel using rdma_migrate_id.
+.P
+Users must release the created rdma_cm_id by calling rdma_destroy_ep.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_getaddrinfo(3), rdma_create_event_channel(3),
+rdma_connect(3), rdma_listen(3), rdma_destroy_ep(3), rdma_migrate_id(3)
diff --git a/man/rdma_create_event_channel.3 b/man/rdma_create_event_channel.3
index 67db268..baa48a6 100644
--- a/man/rdma_create_event_channel.3
+++ b/man/rdma_create_event_channel.3
@@ -11,6 +11,9 @@ rdma_create_event_channel \- Open a channel used to report communication events.
 no arguments
 .SH "DESCRIPTION"
 Asynchronous events are reported to users through event channels.
+.SH "RETURN VALUE"
+Returns a pointer to the created event channel, or NULL if the request
+fails.  On failure, errno will be set to indicate the failure reason.
 .SH "NOTES"
 Event channels are used to direct all events on an rdma_cm_id.  For many
 clients, a single event channel may be sufficient, however, when managing
diff --git a/man/rdma_create_id.3 b/man/rdma_create_id.3
index eb29f3c..da333fb 100644
--- a/man/rdma_create_id.3
+++ b/man/rdma_create_id.3
@@ -1,4 +1,4 @@
-.TH "RDMA_CREATE_ID" 3 "2007-08-06" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.TH "RDMA_CREATE_ID" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
 .SH NAME
 rdma_create_id \- Allocate a communication identifier.
 .SH SYNOPSIS
@@ -12,7 +12,7 @@ rdma_create_id \- Allocate a communication identifier.
 .SH ARGUMENTS
 .IP "channel" 12
 The communication channel that events associated with the
-allocated rdma_cm_id will be reported on.
+allocated rdma_cm_id will be reported on.  This may be NULL.
 .IP "id" 12
 A reference where the allocated communication identifier will be
 returned.
@@ -22,13 +22,22 @@ User specified context associated with the rdma_cm_id.
 RDMA port space.
 .SH "DESCRIPTION"
 Creates an identifier that is used to track communication information.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Rdma_cm_id's are conceptually equivalent to a socket for RDMA
 communication.  The difference is that RDMA communication requires
 explicitly binding to a specified RDMA device before communication
-can occur, and most operations are asynchronous in nature.  Communication
-events on an rdma_cm_id are reported through the associated event
-channel.  Users must release the rdma_cm_id by calling rdma_destroy_id.
+can occur, and most operations are asynchronous in nature.  Asynchronous
+communication events on an rdma_cm_id are reported through the associated
+event channel.  If the channel parameter is NULL, the rdma_cm_id will
+be placed into synchronous operation.  While operating synchronously,
+calls that result in an event will block until the operation completes.
+The event will be returned to the user through the rdma_cm_id structure,
+and be available for access until another rdma_cm call is made.
+.P
+Users must release the rdma_cm_id by calling rdma_destroy_id.
 .SH "PORT SPACE"
 Details of the services provided by the different port spaces are outlined
 below.
diff --git a/man/rdma_create_qp.3 b/man/rdma_create_qp.3
index 0931499..7445db3 100644
--- a/man/rdma_create_qp.3
+++ b/man/rdma_create_qp.3
@@ -12,12 +12,15 @@ rdma_create_qp \- Allocate a QP.
 .IP "id" 12
 RDMA identifier.
 .IP "pd" 12
-protection domain for the QP.
+Optional protection domain for the QP.
 .IP "qp_init_attr" 12
-initial QP attributes.
+Initial QP attributes.
 .SH "DESCRIPTION"
 Allocate a QP associated with the specified rdma_cm_id and transition it
 for sending and receiving.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 The rdma_cm_id must be bound to a local RDMA device before calling this
 function, and the protection domain must be for that same device.
@@ -25,6 +28,20 @@ QPs allocated to an rdma_cm_id are automatically transitioned by the
 librdmacm through their states.  After being allocated, the QP will be
 ready to handle posting of receives.  If the QP is unconnected, it will
 be ready to post sends.
+.P
+If a protection domain is not given - pd parameter is NULL - then
+the rdma_cm_id will be created using a default protection domain.  One
+default protection domain is allocated per RDMA device.
+.P
+The initial QP attributes are specified by the qp_init_attr parameter.  The
+send_cq and recv_cq fields in the ibv_qp_init_attr are optional.  If
+a send or receive completion queue is not specified, then a CQ will be
+allocated by the rdma_cm for the QP, along with corresponding completion
+channels.  Completion channels and CQ data created by the rdma_cm are
+exposed to the user through the rdma_cm_id structure.
+.P
+The actual capabilities and properties of the created QP will be
+returned to the user through the qp_init_attr parameter.
 .SH "SEE ALSO"
 rdma_bind_addr(3), rdma_resolve_addr(3), rdma_destroy_qp(3), ibv_create_qp(3),
 ibv_modify_qp(3)
diff --git a/man/rdma_dereg_mr.3 b/man/rdma_dereg_mr.3
new file mode 100644
index 0000000..298e886
--- /dev/null
+++ b/man/rdma_dereg_mr.3
@@ -0,0 +1,28 @@
+.TH "RDMA_DEREG_MR" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_dereg_mr \- deregisters a registered memory region.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "struct ibv_mr *" rdma_dereg_mr
+.BI "(struct ibv_mr *" mr ");"
+.SH ARGUMENTS
+.IP "mr" 12
+A reference to a registered memory buffer.
+.SH "DESCRIPTION"
+Deregisters a memory buffer that had been registered for RDMA
+or message operations.  A user should call rdma_dereg_mr for all
+registered memory associated with an rdma_cm_id before destroying
+the rdma_cm_id.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+All memory registered with an rdma_cm_id is associated with the
+protection domain associated with the id.  Users must deregister
+all registered memory before the protection domain can be destroyed.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3),
+rdma_destroy_id(3), rdma_destroy_ep(3),
+rdma_reg_msgs(3), rdma_reg_read(3), rdma_reg_write(3),
+ibv_reg_mr(3), ibv_dereg_mr(3)
diff --git a/man/rdma_destroy_ep.3 b/man/rdma_destroy_ep.3
new file mode 100644
index 0000000..13a8766
--- /dev/null
+++ b/man/rdma_destroy_ep.3
@@ -0,0 +1,21 @@
+.TH "RDMA_DESTROY_EP" 3 "2007-05-15" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_destroy_ep \- Release a communication identifier.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_cma.h>"
+.P
+.B "int" rdma_destroy_ep
+.BI "(struct rdma_cm_id *" id ");"
+.SH ARGUMENTS
+.IP "id" 12
+The communication identifier to destroy.
+.SH "DESCRIPTION"
+Destroys the specified rdma_cm_id and all associated resources
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+rdma_destroy_ep will automatically destroy any QP associated with
+the rdma_cm_id.
+.SH "SEE ALSO"
+rdma_create_ep(3)
diff --git a/man/rdma_destroy_event_channel.3 b/man/rdma_destroy_event_channel.3
index ed4636e..2c5b8d6 100644
--- a/man/rdma_destroy_event_channel.3
+++ b/man/rdma_destroy_event_channel.3
@@ -12,6 +12,9 @@ The communication channel to destroy.
 .SH "DESCRIPTION"
 Release all resources associated with an event channel and closes the
 associated file descriptor.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 All rdma_cm_id's associated with the event channel must be destroyed,
 and all returned events must be acked before calling this function.
diff --git a/man/rdma_destroy_id.3 b/man/rdma_destroy_id.3
index 77e8151..0fef7a8 100644
--- a/man/rdma_destroy_id.3
+++ b/man/rdma_destroy_id.3
@@ -1,4 +1,4 @@
-.TH "RDMA_DESTROY_ID" 3 "2007-05-15" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.TH "RDMA_DESTROY_ID" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
 .SH NAME
 rdma_destroy_id \- Release a communication identifier.
 .SH SYNOPSIS
@@ -12,8 +12,11 @@ The communication identifier to destroy.
 .SH "DESCRIPTION"
 Destroys the specified rdma_cm_id and cancels any outstanding
 asynchronous operation.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Users must free any associated QP with the rdma_cm_id before
-calling this routine and ack an related events.
+calling this routine and ack all related events.
 .SH "SEE ALSO"
 rdma_create_id(3), rdma_destroy_qp(3), rdma_ack_cm_event(3)
diff --git a/man/rdma_destroy_qp.3 b/man/rdma_destroy_qp.3
index bb1360e..aeff667 100644
--- a/man/rdma_destroy_qp.3
+++ b/man/rdma_destroy_qp.3
@@ -11,6 +11,9 @@ rdma_destroy_qp \- Deallocate a QP.
 RDMA identifier.
 .SH "DESCRIPTION"
 Destroy a QP allocated on the rdma_cm_id.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Users must destroy any QP associated with an rdma_cm_id before
 destroying the ID.
diff --git a/man/rdma_disconnect.3 b/man/rdma_disconnect.3
index 8b2a035..cd934cb 100644
--- a/man/rdma_disconnect.3
+++ b/man/rdma_disconnect.3
@@ -15,5 +15,8 @@ which will flush any posted work requests to the completion queue.  This
 routine may be called by both the client and server side of a connection.
 After successfully disconnecting, an RDMA_CM_EVENT_DISCONNECTED event will be
 generated on both sides of the connection.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "SEE ALSO"
 rdma_connect(3), rdma_listen(3), rdma_accept(3), rdma_get_cm_event(3)
diff --git a/man/rdma_event_str.3 b/man/rdma_event_str.3
index 6126983..abd016d 100644
--- a/man/rdma_event_str.3
+++ b/man/rdma_event_str.3
@@ -11,5 +11,7 @@ rdma_event_str \- Returns a string representation of an rdma cm event.
 Asynchronous event.
 .SH "DESCRIPTION"
 Returns a string representation of an asynchronous event.
+.SH "RETURN VALUE"
+Returns a pointer to a static character string corresponding to the event.
 .SH "SEE ALSO"
 rdma_get_cm_event(3)
diff --git a/man/rdma_free_devices.3 b/man/rdma_free_devices.3
index 1ed4cb3..37b82ef 100644
--- a/man/rdma_free_devices.3
+++ b/man/rdma_free_devices.3
@@ -11,5 +11,7 @@ rdma_free_devices \- Frees the list of devices returned by rdma_get_devices.
 List of devices returned from rdma_get_devices.
 .SH "DESCRIPTION"
 Frees the device array returned by rdma_get_devices.
+.SH "RETURN VALUE"
+None
 .SH "SEE ALSO"
 rdma_get_devices(3)
diff --git a/man/rdma_get_cm_event.3 b/man/rdma_get_cm_event.3
index 79bf606..b0c4970 100644
--- a/man/rdma_get_cm_event.3
+++ b/man/rdma_get_cm_event.3
@@ -15,6 +15,9 @@ Allocated information about the next communication event.
 .SH "DESCRIPTION"
 Retrieves a communication event.  If no events are pending, by default,
 the call will block until an event is received.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 The default synchronous behavior of this routine can be changed by
 modifying the file descriptor associated with the given channel.  All
@@ -38,7 +41,10 @@ Specifies the type of communication event which occurred.  See EVENT TYPES
 below.
 .IP "status" 12
 Returns any asynchronous error information associated with an event.  The
-status is zero unless the corresponding operation failed.
+status is zero if the operation was successful, otherwise the status value
+is non-zero and is either set to an errno or a transport specific value.
+For details on transport specific status values, see the event type information
+below.
 .IP "param" 12
 Provides additional details based on the type of event.  Users should
 select the conn or ud subfields based on the rdma_port_space of the
@@ -123,10 +129,15 @@ Indicates that an error has occurred trying to establish or a connection.
 May be generated on the active or passive side of a connection.
 .IP RDMA_CM_EVENT_UNREACHABLE
 Generated on the active side to notify the user that the remote server is
-not reachable or unable to respond to a connection request.
+not reachable or unable to respond to a connection request.  If this event
+is generated in response to a UD QP resolution request over InfiniBand,
+the event status field will contain an errno, if negative, or the status
+result carried in the IB CM SIDR REP message.
 .IP RDMA_CM_EVENT_REJECTED
 Indicates that a connection request or response was rejected by the remote
-end point.
+end point.  The event status field will contain the transport specific
+reject reason if available.  Under InfiniBand, this is the reject reason
+carried in the IB CM REJ message.
 .IP RDMA_CM_EVENT_ESTABLISHED
 Indicates that a connection has been established with the remote end point.
 .IP RDMA_CM_EVENT_DISCONNECTED
diff --git a/man/rdma_get_devices.3 b/man/rdma_get_devices.3
index 05dcee2..7f42722 100644
--- a/man/rdma_get_devices.3
+++ b/man/rdma_get_devices.3
@@ -13,6 +13,9 @@ If non-NULL, set to the number of devices returned.
 Return a NULL-terminated array of opened RDMA devices.  Callers can use
 this routine to allocate resources on specific RDMA devices that will be
 shared across multiple rdma_cm_id's.
+.SH "RETURN VALUE"
+Returns an array of available RDMA devices, or NULL if the request
+fails.  On failure, errno will be set to indicate the failure reason.
 .SH "NOTES"
 The returned array must be released by calling rdma_free_devices.  Devices
 remain opened while the librdmacm is loaded.
diff --git a/man/rdma_get_dst_port.3 b/man/rdma_get_dst_port.3
index 92932e9..1567749 100644
--- a/man/rdma_get_dst_port.3
+++ b/man/rdma_get_dst_port.3
@@ -12,6 +12,9 @@ RDMA identifier.
 .SH "DESCRIPTION"
 Returns the remote port number for an rdma_cm_id that has been bound to
 a remote address.
+.SH "RETURN VALUE"
+Returns the 16-bit port identifier associated with the peer endpoint.  If
+the rdma_cm_id is not connected, the returned value is 0.
 .SH "SEE ALSO"
 rdma_connect(3), rdma_accept(3), rdma_get_cm_event(3), rdma_get_src_port(3),
 rdma_get_local_addr(3), rdma_get_peer_addr(3)
diff --git a/man/rdma_get_local_addr.3 b/man/rdma_get_local_addr.3
index 8085627..25d5312 100644
--- a/man/rdma_get_local_addr.3
+++ b/man/rdma_get_local_addr.3
@@ -12,6 +12,10 @@ RDMA identifier.
 .SH "DESCRIPTION"
 Returns the local IP address for an rdma_cm_id that has been bound to
 a local device.
+.SH "RETURN VALUE"
+Returns a pointer to the local sockaddr address of the rdma_cm_id.  If
+the rdma_cm_id is not bound to an address, the contents of the sockaddr
+structure will be set to all zeroes.
 .SH "SEE ALSO"
 rdma_bind_addr(3), rdma_resolve_addr(3), rdma_get_src_port(3),
 rdma_get_dst_port(3), rdma_get_peer_addr(3)
diff --git a/man/rdma_get_peer_addr.3 b/man/rdma_get_peer_addr.3
index 880e9c5..54f3139 100644
--- a/man/rdma_get_peer_addr.3
+++ b/man/rdma_get_peer_addr.3
@@ -11,6 +11,10 @@ rdma_get_peer_addr \- Returns the remote IP address of a bound rdma_cm_id.
 RDMA identifier.
 .SH "DESCRIPTION"
 Returns the remote IP address associated with an rdma_cm_id.
+.SH "RETURN VALUE"
+Returns a pointer to the sockaddr address of the connected peer.  If
+the rdma_cm_id is not connected, the contents of the sockaddr
+structure will be set to all zeroes.
 .SH "SEE ALSO"
 rdma_resolve_addr(3), rdma_get_src_port(3), rdma_get_dst_port(3),
 rdma_get_local_addr(3)
diff --git a/man/rdma_get_recv_comp.3 b/man/rdma_get_recv_comp.3
new file mode 100644
index 0000000..dece89d
--- /dev/null
+++ b/man/rdma_get_recv_comp.3
@@ -0,0 +1,31 @@
+.TH "RDMA_GET_RECV_COMP" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_get_recv_comp \- retrieves a completed receive request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_get_recv_comp
+.BI "(struct rdma_cm_id *" id ","
+.BI "struct ibv_wc *" wc ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier to check for completions.
+.IP "wc" 12
+A reference to a work completion structure to fill in.
+.SH "DESCRIPTION"
+Retrieves a completed work request for a receive
+operation.  Information about the completed request is returned through
+the wc parameter, with the wr_id set to the context of the request.  For
+details on the work completion structure, see ibv_poll_cq.
+.SH "RETURN VALUE"
+Returns the number of returned completions (0 or 1) on success, or -1 on error.
+If an error occurs, errno will be set to indicate the failure reason.
+.SH "NOTES"
+This calls polls the receive completion queue associated with an rdma_cm_id.
+If a completion is not found, the call blocks until a request completes.
+This call should only be used on rdma_cm_id's that do not share CQs
+with other rdma_cm_id's, and maintain separate CQs for sends and receive
+completions.
+.SH "SEE ALSO"
+rdma_cm(7), ibv_poll_cq(3), rdma_get_send_comp(3),
+rdma_post_send(3), rdma_post_read(3), rdma_post_write(3)
diff --git a/man/rdma_get_request.3 b/man/rdma_get_request.3
new file mode 100644
index 0000000..93ec70d
--- /dev/null
+++ b/man/rdma_get_request.3
@@ -0,0 +1,34 @@
+.TH "RDMA_GET_REQUEST" 3 "2007-10-31" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_get_request \- Retrieves the next pending connection request event.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_cma.h>"
+.P
+.B "int" rdma_get_request
+.BI "(struct rdma_cm_id *" listen ","
+.BI "struct rdma_cm_id **" id ");"
+.SH ARGUMENTS
+.IP "listen" 12
+Listening rdma_cm_id.
+.IP "id" 12
+rdma_cm_id associated with the new connection.
+.SH "DESCRIPTION"
+Retrieves a connection request event.  If no requests are pending,
+the call will block until an event is received.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+This call may only be used on listening rdma_cm_id's operating
+synchronously.  On success, a new rdma_cm_id representing the
+connection request will be returned to the user.  The new rdma_cm_id
+will reference event information associated with the request until
+the user calls rdma_reject, rdma_accept, or rdma_destroy_id on the
+newly created identifier.  For a description of the event data,
+see rdma_get_cm_event.
+.P
+If QP attributes are associated with the listening endpoint, the
+returned rdma_cm_id will also reference an allocated QP.
+.SH "SEE ALSO"
+rdma_get_cm_event(3), rdma_accept(3), rdma_reject(3),
+rdma_connect(3), rdma_listen(3), rdma_destroy_id(3)
diff --git a/man/rdma_get_send_comp.3 b/man/rdma_get_send_comp.3
new file mode 100644
index 0000000..f0c92b4
--- /dev/null
+++ b/man/rdma_get_send_comp.3
@@ -0,0 +1,31 @@
+.TH "RDMA_GET_SEND_COMP" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_get_send_comp \- retrieves a completed send, read, or write request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_get_send_comp
+.BI "(struct rdma_cm_id *" id ","
+.BI "struct ibv_wc *" wc ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier to check for completions.
+.IP "wc" 12
+A reference to a work completion structure to fill in.
+.SH "DESCRIPTION"
+Retrieves a completed work request for a send, RDMA read, or RDMA write
+operation.  Information about the completed request is returned through
+the wc parameter, with the wr_id set to the context of the request.  For
+details on the work completion structure, see ibv_poll_cq.
+.SH "RETURN VALUE"
+Returns the number of returned completions (0 or 1) on success, or -1 on error.
+If an error occurs, errno will be set to indicate the failure reason.
+.SH "NOTES"
+This calls polls the send completion queue associated with an rdma_cm_id.
+If a completion is not found, the call blocks until a request completes.
+This call should only be used on rdma_cm_id's that do not share CQs
+with other rdma_cm_id's, and maintain separate CQs for sends and receive
+completions.
+.SH "SEE ALSO"
+rdma_cm(7), ibv_poll_cq(3), rdma_get_recv_comp(3),
+rdma_post_send(3), rdma_post_read(3), rdma_post_write(3)
diff --git a/man/rdma_get_src_port.3 b/man/rdma_get_src_port.3
index 0a2f445..477ec73 100644
--- a/man/rdma_get_src_port.3
+++ b/man/rdma_get_src_port.3
@@ -12,6 +12,9 @@ RDMA identifier.
 .SH "DESCRIPTION"
 Returns the local port number for an rdma_cm_id that has been bound to
 a local address.
+.SH "RETURN VALUE"
+Returns the 16-bit port identifier associated with the local endpoint.  If
+the rdma_cm_id is not bound to a port, the returned value is 0.
 .SH "SEE ALSO"
 rdma_bind_addr(3), rdma_resolve_addr(3), rdma_get_dst_port(3),
 rdma_get_local_addr(3), rdma_get_peer_addr(3)
diff --git a/man/rdma_getaddrinfo.3 b/man/rdma_getaddrinfo.3
new file mode 100755
index 0000000..e69d8ce
--- /dev/null
+++ b/man/rdma_getaddrinfo.3
@@ -0,0 +1,91 @@
+.TH "RDMA_GETADDRINFO" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_getaddrinfo \- Provides transport independent address translation.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_cma.h>"
+.P
+.B "int" rdma_getaddrinfo
+.BI "(char *" node ","
+.BI "char *" service ","
+.BI "struct rdma_addrinfo *" hints ","
+.BI "struct rdma_addrinfo **" res ");"
+.SH ARGUMENTS
+.IP "node" 12
+Optional, name, dotted-decimal IPv4, or IPv6 hex address to resolve.
+.IP "service" 12
+Service name or port number of address.
+.IP "hints" 12
+Reference to an rdma_addrinfo structure containing hints about the type
+of service the caller supports.
+.IP "res" 12
+A pointer to a linked list of rdma_addrinfo structures containing response
+information.
+.SH "DESCRIPTION"
+Resolves the destination node and service address and returns
+information needed to establish communication.  Provides the
+RDMA functional equivalent to getaddrinfo.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+Either node or service must be provided.  If hints are provided, the
+operation will be controlled by hints.ai_flags.  If RAI_PASSIVE is
+specified, the call will resolve address information for use on the
+passive side of a connection.
+.SH "rdma_addrinfo"
+.IP "ai_flags" 12
+Hint flags that control the operation.  Supported flags are:
+.IP "RAI_PASSIVE" 12
+Indicates that the results will be used on the passive/listening
+side of a connection.
+.IP "RAI_NUMERICHOST" 12
+If specified, then the node parameter, if provided, must be a numerical
+network address.  This flag suppresses any lengthy address resolution. 
+.IP "RAI_NOROUTE" 12
+If set, this flag suppresses any lengthy route resolution.
+.IP "ai_family" 12
+Address family for the source and destination address.  Supported families
+are: AF_INET, AF_INET6, and AF_IB.
+.IP "ai_qp_type" 12
+Indicates the type of RDMA QP used for communication.  Supported types are:
+IBV_UD (unreliable datagram) and IBV_RC (reliable connected).
+.IP "ai_port_space" 12
+RDMA port space in use.  Supported values are: RDMA_PS_UDP and RDMA_PS_TCP.
+.IP "ai_src_len" 12
+The length of the source address referenced by ai_src_addr.  This will be 0
+if an appropriate source address could not be discovered for a given
+destination.
+.IP "ai_dst_len" 12
+The length of the destination address referenced by ai_dst_addr.  This
+will be 0 if the RAI_PASSIVE flag was specified as part of the hints.
+.IP "ai_src_addr" 12
+If provided, the address for the local RDMA device.
+.IP "ai_dst_addr" 12
+If provided, the address for the destination RDMA device.
+.IP "ai_src_canonname" 12
+The canonical for the source.
+.IP "ai_dst_canonname" 12
+The canonical for the destination.
+.IP "ai_route_len" 12
+Size of the routing information buffer referenced by ai_route.  This will
+be 0 if the underlying transport does not require routing data, or none 
+could be resolved.
+.IP "ai_route" 12
+Routing information for RDMA transports that require routing data as part
+of connection establishment.  The format of the routing data depends on
+the underlying transport.  If Infiniband transports are
+used, ai_route will reference an array of struct ibv_path_data.
+.IP "ai_connect_len" 12
+Size of connection information referenced by ai_connect.  This will be
+0 if the underlying transport does not require additional connection
+information.
+.IP "ai_connect" 12
+Data exchanged as part of the connection establishment process.  If provided,
+ai_connect data must be transferred as private data, with any user supplied
+private data following it.
+.IP "ai_next" 12
+Pointer to the next rdma_addrinfo structure in the list.  Will be NULL
+if no more structures exist.
+.SH "SEE ALSO"
+rdma_create_id(3), rdma_resolve_route(3), rdma_connect(3), rdma_create_qp(3),
+rdma_bind_addr(3), rdma_create_ep(3)
diff --git a/man/rdma_join_multicast.3 b/man/rdma_join_multicast.3
index 2df57a0..92c2d8d 100644
--- a/man/rdma_join_multicast.3
+++ b/man/rdma_join_multicast.3
@@ -17,6 +17,9 @@ Multicast address identifying the group to join.
 User-defined context associated with the join request.
 .SH "DESCRIPTION"
 Joins a multicast group and attaches an associated QP to the group.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Before joining a multicast group, the rdma_cm_id must be bound to
 an RDMA device by calling rdma_bind_addr or rdma_resolve_addr.  Use of
diff --git a/man/rdma_leave_multicast.3 b/man/rdma_leave_multicast.3
index e4262e8..802ba57 100644
--- a/man/rdma_leave_multicast.3
+++ b/man/rdma_leave_multicast.3
@@ -14,6 +14,9 @@ Communication identifier associated with the request.
 Multicast address identifying the group to leave.
 .SH "DESCRIPTION"
 Leaves a multicast group and detaches an associated QP from the group.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Calling this function before a group has been fully joined results in
 canceling the join operation.  Users should be aware that messages
diff --git a/man/rdma_listen.3 b/man/rdma_listen.3
index 4266184..b76d692 100644
--- a/man/rdma_listen.3
+++ b/man/rdma_listen.3
@@ -16,6 +16,9 @@ backlog of incoming connection requests.
 Initiates a listen for incoming connection requests or datagram service
 lookup.  The listen will be restricted to the locally bound source
 address.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Users must have bound the rdma_cm_id to a local address by calling
 rdma_bind_addr before calling this routine.  If the rdma_cm_id is
diff --git a/man/rdma_migrate_id.3 b/man/rdma_migrate_id.3
index ffbad45..8683c93 100644
--- a/man/rdma_migrate_id.3
+++ b/man/rdma_migrate_id.3
@@ -12,9 +12,12 @@ rdma_migrate_id \- Move a communication identifer to a different event channel.
 An existing communication identifier to migrate.
 .IP "channel" 12
 The communication channel that events associated with the
-allocated rdma_cm_id will be reported on.
+allocated rdma_cm_id will be reported on.  May be NULL.
 .SH "DESCRIPTION"
 Migrates a communication identifier to a different event channel.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 This routine migrates a communication identifier to the specified event
 channel and moves any pending events associated with the rdma_cm_id
@@ -22,6 +25,10 @@ to the new channel.  Users should not poll for events on the
 rdma_cm_id's current event channel or invoke other routines on the
 rdma_cm_id while migrating between channels.  This call will block while
 there are any unacknowledged events on the current event channel.
+.P
+If the channel parameter is NULL, the specified rdma_cm_id will be
+placed into synchronous operation mode.  All calls on the id
+will block until the operation completes.
 .SH "SEE ALSO"
 rdma_cm(7), rdma_create_event_channel(3), rdma_create_id(3),
 rdma_get_cm_event(3)
diff --git a/man/rdma_notify.3 b/man/rdma_notify.3
index 7114ac4..a29ee07 100644
--- a/man/rdma_notify.3
+++ b/man/rdma_notify.3
@@ -15,6 +15,9 @@ Asynchronous event.
 .SH "DESCRIPTION"
 Used to notify the librdmacm of asynchronous events that have occurred
 on a QP associated with the rdma_cm_id.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Asynchronous events that occur on a QP are reported through the user's
 device event handler.  This routine is used to notify the librdmacm of
@@ -24,6 +27,8 @@ necessary, however if connection establishment is done out of band
 QP that is not yet considered connected.  This routine forces the
 connection into an established state in this case in order to handle
 the rare situation where the connection never forms on its own.
+Calling this routine ensures the delivery of the RDMA_CM_EVENT_ESTABLISHED
+event to the application.
 Events that should be reported to the CM are: IB_EVENT_COMM_EST.
 .SH "SEE ALSO"
 rdma_connect(3), rdma_accept(3), rdma_listen(3)
diff --git a/man/rdma_post_read.3 b/man/rdma_post_read.3
new file mode 100644
index 0000000..d7afc5b
--- /dev/null
+++ b/man/rdma_post_read.3
@@ -0,0 +1,55 @@
+.TH "RDMA_POST_READ" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_read \- post an RDMA read work request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_read
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "void *" addr ","
+.BI "size_t " length ","
+.BI "struct ibv_mr *" mr ","
+.BI "int " flags ","
+.BI "uint64_t " remote_addr ","
+.BI "uint32_t " rkey ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the request 
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "addr" 12
+The address of the local destination of the read request.
+.IP "length" 12
+The length of the read operation.
+.IP "mr" 12
+Registered memory region associated with the local buffer.
+.IP "flags" 12
+Optional flags used to control the read operation.
+.IP "remote_addr" 12
+The address of the remote registered memory to read from.
+.IP "rkey" 12
+The registered memory key associated with the remote address.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the remote memory region will be
+read into the local data buffer.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+For a list of supported flags, see ibv_post_send. 
+Both the remote and local data buffers must have been registered
+before the read is issued, and the buffers must remain registered
+until the read completes.
+.P
+Read operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the read request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_readv(3), rdma_reg_read(3), rdma_reg_msgs(3)
diff --git a/man/rdma_post_readv.3 b/man/rdma_post_readv.3
new file mode 100644
index 0000000..cccf2c3
--- /dev/null
+++ b/man/rdma_post_readv.3
@@ -0,0 +1,52 @@
+.TH "RDMA_POST_READV" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_readv \- post an RDMA read work request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_readv
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "struct ibv_sge *" sgl ","
+.BI "int " nsge ","
+.BI "int " flags ","
+.BI "uint64_t " remote_addr ","
+.BI "uint32_t " rkey ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the request 
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "sgl" 12
+A scatter-gather list of the destination buffers of the read.
+.IP "nsge" 12
+The number of scatter-gather array entries.
+.IP "flags" 12
+Optional flags used to control the read operation.
+.IP "remote_addr" 12
+The address of the remote registered memory to read from.
+.IP "rkey" 12
+The registered memory key associated with the remote address.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the remote memory region will be
+read into the local data buffers.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+For a list of supported flags, see ibv_post_send. 
+Both the remote and local data buffers must have been registered
+before the read is issued, and the buffers must remain registered
+until the read completes.
+.P
+Read operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the read request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_read(3), rdma_reg_read(3), rdma_reg_msgs(3)
diff --git a/man/rdma_post_recv.3 b/man/rdma_post_recv.3
new file mode 100644
index 0000000..6633cef
--- /dev/null
+++ b/man/rdma_post_recv.3
@@ -0,0 +1,50 @@
+.TH "RDMA_POST_RECV" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_recv \- post a work request to receive an incoming message.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_recv
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "void *" addr ","
+.BI "size_t " length ","
+.BI "struct ibv_mr *" mr ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "addr" 12
+The address of the memory buffer to post.
+.IP "length" 12
+The length of the memory buffer.
+.IP "mr" 12
+A registered memory region associated with the posted buffer.
+.SH "DESCRIPTION"
+Posts a work request to the receive queue of the queue pair associated
+with the rdma_cm_id.  The posted buffer will be queued to receive an incoming
+message sent by the remote peer.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+The user is responsible for ensuring that a receive buffer is posted
+and large enough to contain all sent data before the peer posts the
+corresponding send message.  The message buffer must have been registered
+before being posted, with the mr parameter referencing the registration.
+The buffer must remain registered until the receive completes.
+.P
+Messages may be posted to an rdma_cm_id only after a queue pair has
+been associated with it.  A queue pair is bound to an rdma_cm_id after
+calling rdma_create_ep or rdma_create_qp, if the rdma_cm_id is allocated
+using rdma_create_id.
+.P
+The user-defined context associated with the receive request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3), rdma_create_qp(3),
+rdma_reg_read(3), ibv_reg_mr(3), ibv_dereg_mr(3),
+rdma_post_recvv(3), rdma_post_send(3)
diff --git a/man/rdma_post_recvv.3 b/man/rdma_post_recvv.3
new file mode 100644
index 0000000..f5e099e
--- /dev/null
+++ b/man/rdma_post_recvv.3
@@ -0,0 +1,47 @@
+.TH "RDMA_POST_RECVV" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_recvv \- post a work request to receive incoming messages.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_recvv
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "struct ibv_sge *" sgl ","
+.BI "int " nsge ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer(s)
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "sgl" 12
+A scatter-gather list of memory buffers posted as a single request.
+.IP "nsge" 12
+The number of scatter-gather entries in the sgl array.
+.SH "DESCRIPTION"
+Posts a single work request to the receive queue of the queue pair associated
+with the rdma_cm_id.  The posted buffers will be queued to receive an
+incoming message sent by the remote peer.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+The user is responsible for ensuring that the receive is posted,
+and the total buffer space is large enough to contain all sent data
+before the peer posts the corresponding send message.  The message buffers
+must have been registered before being posted, and the buffers must
+remain registered until the receive completes.
+.P
+Messages may be posted to an rdma_cm_id only after a queue pair has
+been associated with it.  A queue pair is bound to an rdma_cm_id after
+calling rdma_create_ep or rdma_create_qp, if the rdma_cm_id is allocated
+using rdma_create_id.
+.P
+The user-defined context associated with the receive request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3), rdma_create_qp(3),
+rdma_reg_read(3), ibv_reg_mr(3), ibv_dereg_mr(3),
+rdma_post_recv(3), rdma_post_send(3)
diff --git a/man/rdma_post_send.3 b/man/rdma_post_send.3
new file mode 100644
index 0000000..82bcf37
--- /dev/null
+++ b/man/rdma_post_send.3
@@ -0,0 +1,51 @@
+.TH "RDMA_POST_SEND" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_send \- post a work request to send a message.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_send
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "void *" addr ","
+.BI "size_t " length ","
+.BI "struct ibv_mr *" mr ","
+.BI "int " flags ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "addr" 12
+The address of the memory buffer to post.
+.IP "length" 12
+The length of the memory buffer.
+.IP "mr" 12
+Optional registered memory region associated with the posted buffer.
+.IP "flags" 12
+Optional flags used to control the send operation.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the posted buffer will be sent
+to the remote peer of a connection.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+The user is responsible for ensuring that the remote peer has queued a
+receive request before issuing the send operations.  For a list of
+supported flags, see ibv_post_send.  Unless the send request is using
+inline data, the message buffer must have been registered
+before being posted, with the mr parameter referencing the registration.
+The buffer must remain registered until the send completes.
+.P
+Send operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the send request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_sendv(3), rdma_post_recv(3)
diff --git a/man/rdma_post_sendv.3 b/man/rdma_post_sendv.3
new file mode 100644
index 0000000..1953ce3
--- /dev/null
+++ b/man/rdma_post_sendv.3
@@ -0,0 +1,48 @@
+.TH "RDMA_POST_SENDV" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_sendv \- post a work request to send a message.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_sendv
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "struct ibv_sge *" slg ","
+.BI "int " nsge ","
+.BI "int " flags ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "slg" 12
+A scatter-gather list of memory buffers posted as a single request.
+.IP "nsge" 12
+The number of scatter-gather entries in the slg array.
+.IP "flags" 12
+Optional flags used to control the send operation.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the posted buffers will be sent
+to the remote peer of a connection.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+The user is responsible for ensuring that the remote peer has queued a
+receive request before issuing the send operations.  For a list of
+supported flags, see ibv_post_send.  Unless the send request is using
+inline data, the message buffers must have been registered
+before being posted, and the buffers must remain registered
+until the send completes.
+.P
+Send operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the send request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_send(3), rdma_post_recv(3)
diff --git a/man/rdma_post_ud_send.3 b/man/rdma_post_ud_send.3
new file mode 100644
index 0000000..f8e2ada
--- /dev/null
+++ b/man/rdma_post_ud_send.3
@@ -0,0 +1,54 @@
+.TH "RDMA_POST_UD_SEND" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_ud_send \- post a work request to send a datagram.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_ud_send
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "void *" addr ","
+.BI "size_t " length ","
+.BI "struct ibv_mr *" mr ","
+.BI "int " flags ","
+.BI "struct ibv_ah *" ah ","
+.BI "uint32_t " remote_qpn ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "addr" 12
+The address of the memory buffer to post.
+.IP "length" 12
+The length of the memory buffer.
+.IP "mr" 12
+Optional registered memory region associated with the posted buffer.
+.IP "flags" 12
+Optional flags used to control the send operation.
+.IP "ah" 12
+An address handle describing the address of the remote node.
+.IP "remote_qpn" 12
+The number of the destination queue pair.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the posted buffer will be sent
+to the specified destination queue pair.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+The user is responsible for ensuring that the destination queue pair
+has queued a receive request before issuing the send operations.  For a list of
+supported flags, see ibv_post_send.  Unless the send request is using
+inline data, the message buffer must have been registered
+before being posted, with the mr parameter referencing the registration.
+The buffer must remain registered until the send completes.
+.P
+The user-defined context associated with the send request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3), rdma_reg_msgs(3)
+ibv_post_send(3), rdma_post_recv(3)
diff --git a/man/rdma_post_write.3 b/man/rdma_post_write.3
new file mode 100644
index 0000000..896996c
--- /dev/null
+++ b/man/rdma_post_write.3
@@ -0,0 +1,55 @@
+.TH "RDMA_POST_WRITE" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_write \- post an RDMA write work request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_write
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "void *" addr ","
+.BI "size_t " length ","
+.BI "struct ibv_mr *" mr ","
+.BI "int " flags ","
+.BI "uint64_t " remote_addr ","
+.BI "uint32_t " rkey ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the request 
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "addr" 12
+The local address of the source of the write request.
+.IP "length" 12
+The length of the write operation.
+.IP "mr" 12
+Optional memory region associated with the local buffer.
+.IP "flags" 12
+Optional flags used to control the write operation.
+.IP "remote_addr" 12
+The address of the remote registered memory to write into.
+.IP "rkey" 12
+The registered memory key associated with the remote address.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the local data buffer will be
+writen into the remote memory region.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+For a list of supported flags, see ibv_post_send.  Unless inline
+data is specified, the local data buffer must have been registered
+before the write is issued, and the buffer must remain registered
+until the write completes.  The remote buffer must always be registered.
+.P
+Write operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the write request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_writev(3), rdma_reg_write(3), rdma_reg_msgs(3)
diff --git a/man/rdma_post_writev.3 b/man/rdma_post_writev.3
new file mode 100644
index 0000000..f5b23fd
--- /dev/null
+++ b/man/rdma_post_writev.3
@@ -0,0 +1,52 @@
+.TH "RDMA_POST_WRITEV" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_post_writev \- post an RDMA write work request.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "int" rdma_post_writev
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" context ","
+.BI "struct ibv_sge *" sgl ","
+.BI "int " nsge ","
+.BI "int " flags ","
+.BI "uint64_t " remote_addr ","
+.BI "uint32_t " rkey ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the request 
+will be posted.
+.IP "context" 12
+User-defined context associated with the request.
+.IP "sgl" 12
+A scatter-gather list of the source buffers of the write.
+.IP "nsge" 12
+The number of scatter-gather array entries.
+.IP "flags" 12
+Optional flags used to control the write operation.
+.IP "remote_addr" 12
+The address of the remote registered memory to write into.
+.IP "rkey" 12
+The registered memory key associated with the remote address.
+.SH "DESCRIPTION"
+Posts a work request to the send queue of the queue pair associated
+with the rdma_cm_id.  The contents of the local data buffers will be
+writen into the remote memory region.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
+.SH "NOTES"
+For a list of supported flags, see ibv_post_send.  Unless inline
+data is specified, the local data buffers must have been registered
+before the write is issued, and the buffers must remain registered
+until the write completes.  The remote buffers must always be registered.
+.P
+Write operations may not be posted to an rdma_cm_id or the corresponding
+queue pair until it has been connected.
+.P
+The user-defined context associated with the write request will be
+returned to the user through the work completion wr_id, work request
+identifier, field.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_connect(3), rdma_accept(3),
+ibv_post_send(3), rdma_post_write(3), rdma_reg_write(3), rdma_reg_msgs(3)
diff --git a/man/rdma_reg_msgs.3 b/man/rdma_reg_msgs.3
new file mode 100644
index 0000000..c2c9359
--- /dev/null
+++ b/man/rdma_reg_msgs.3
@@ -0,0 +1,42 @@
+.TH "RDMA_REG_MSGS" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_reg_msgs \- register data buffer(s) for sending or receiving messages.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "struct ibv_mr *" rdma_reg_msgs
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" addr ","
+.BI "size_t " length ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer(s)
+will be used.
+.IP "addr" 12
+The address of the memory buffer(s) to register.
+.IP "length" 12
+The total length of the memory to register.
+.SH "DESCRIPTION"
+Registers an array of memory buffers used for sending and receiving
+messages or for RDMA operations.  Memory buffers registered using
+rdma_reg_msgs may be posted to an rdma_cm_id using
+rdma_post_send or rdma_post_recv, or specified as the target of an RDMA
+read operation or the source of an RDMA write reqeust.
+.SH "RETURN VALUE"
+Returns a reference to the registered memory region on success, or NULL on
+error.  If an error occurs, errno will be set to indicate the failure reason.
+.SH "NOTES"
+rdma_reg_msgs is used to register an array of data buffers
+that will be used send and/or receive messages on a queue pair associated with
+an rdma_cm_id.  The memory buffer is registered with the proteection
+domain associated with the idenfier.  The start of the data buffer array
+is specified through the addr parameter, and the total size of the array
+is given by length.
+.P
+All data buffers should be registered before being posted as a work request.
+Users must deregister all registered memory by calling rdma_dereg_mr.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3),
+rdma_reg_read(3), rdma_reg_write(3),
+ibv_reg_mr(3), ibv_dereg_mr(3), rdma_post_send(3), rdma_post_recv(3),
+rdma_post_read(3), rdma_post_readv(3), rdma_post_write(3), rdma_post_writev(3)
diff --git a/man/rdma_reg_read.3 b/man/rdma_reg_read.3
new file mode 100644
index 0000000..84417a5
--- /dev/null
+++ b/man/rdma_reg_read.3
@@ -0,0 +1,41 @@
+.TH "RDMA_REG_READ" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_reg_read \- register data buffer(s) for remote RDMA read access.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "struct ibv_mr *" rdma_reg_read
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" addr ","
+.BI "size_t " length ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer(s)
+will be used.
+.IP "addr" 12
+The address of the memory buffer(s) to register.
+.IP "length" 12
+The total length of the memory to register.
+.SH "DESCRIPTION"
+Registers a memory buffer that will be accessed by a remote RDMA read
+operation.  Memory buffers registered using rdma_reg_read may be
+targeted in an RDMA read request, allowing the buffer to be
+specified on the remote side of an RDMA connection as the remote_addr
+of rdma_post_read, or similar call.
+.SH "RETURN VALUE"
+Returns a reference to the registered memory region on success, or NULL on
+error.  If an error occurs, errno will be set to indicate the failure reason.
+.SH "NOTES"
+rdma_reg_read is used to register a data buffer that will be the
+target of an RDMA read operation on a queue pair associated with
+an rdma_cm_id.  The memory buffer is registered with the proteection
+domain associated with the idenfier.  The start of the data buffer
+is specified through the addr parameter, and the total size of the buffer
+is given by length.
+.P
+All data buffers should be registered before being posted as a work request.
+Users must deregister all registered memory by calling rdma_dereg_mr.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3),
+rdma_reg_msgs(3), rdma_reg_write(3),
+ibv_reg_mr(3), ibv_dereg_mr(3), rdma_post_read(3)
diff --git a/man/rdma_reg_write.3 b/man/rdma_reg_write.3
new file mode 100644
index 0000000..cc7beea
--- /dev/null
+++ b/man/rdma_reg_write.3
@@ -0,0 +1,41 @@
+.TH "RDMA_REG_WRITE" 3 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
+.SH NAME
+rdma_reg_write \- register data buffer(s) for remote RDMA write access.
+.SH SYNOPSIS
+.B "#include <rdma/rdma_verbs.h>"
+.P
+.B "struct ibv_mr *" rdma_reg_write
+.BI "(struct rdma_cm_id *" id ","
+.BI "void *" addr ","
+.BI "size_t " length ");"
+.SH ARGUMENTS
+.IP "id" 12
+A reference to a communication identifier where the message buffer(s)
+will be used.
+.IP "addr" 12
+The address of the memory buffer(s) to register.
+.IP "length" 12
+The total length of the memory to register.
+.SH "DESCRIPTION"
+Registers a memory buffer that will be accessed by a remote RDMA write
+operation.  Memory buffers registered using rdma_reg_write may be
+targeted in an RDMA write request, allowing the buffer to be
+specified on the remote side of an RDMA connection as the remote_addr
+of rdma_post_write, or similar call.
+.SH "RETURN VALUE"
+Returns a reference to the registered memory region on success, or NULL on
+error.  If an error occurs, errno will be set to indicate the failure reason.
+.SH "NOTES"
+rdma_reg_write is used to register a data buffer that will be the
+target of an RDMA write operation on a queue pair associated with
+an rdma_cm_id.  The memory buffer is registered with the proteection
+domain associated with the idenfier.  The start of the data buffer
+is specified through the addr parameter, and the total size of the buffer 
+is given by length.
+.P
+All data buffers should be registered before being posted as a work request.
+Users must deregister all registered memory by calling rdma_dereg_mr.
+.SH "SEE ALSO"
+rdma_cm(7), rdma_create_id(3), rdma_create_ep(3),
+rdma_reg_msgs(3), rdma_reg_read(3),
+ibv_reg_mr(3), ibv_dereg_mr(3), rdma_post_write(3)
diff --git a/man/rdma_reject.3 b/man/rdma_reject.3
index dc32160..268f0b3 100644
--- a/man/rdma_reject.3
+++ b/man/rdma_reject.3
@@ -20,6 +20,9 @@ be larger than that requested.
 .SH "DESCRIPTION"
 Called from the listening side to reject a connection or datagram
 service lookup request.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 After receiving a connection request event, a user may call rdma_reject
 to reject the request.  If the underlying RDMA transport supports
diff --git a/man/rdma_resolve_addr.3 b/man/rdma_resolve_addr.3
index e612606..3243c79 100644
--- a/man/rdma_resolve_addr.3
+++ b/man/rdma_resolve_addr.3
@@ -22,6 +22,9 @@ Time to wait for resolution to complete.
 Resolve destination and optional source addresses from IP addresses
 to an RDMA address.  If successful, the specified rdma_cm_id will
 be bound to a local device.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 This call is used to map a given destination IP address to a usable RDMA
 address.  The IP to RDMA address mapping is done using the local routing
diff --git a/man/rdma_resolve_route.3 b/man/rdma_resolve_route.3
index ac1b3bc..c52f1b3 100644
--- a/man/rdma_resolve_route.3
+++ b/man/rdma_resolve_route.3
@@ -16,6 +16,9 @@ Time to wait for resolution to complete.
 Resolves an RDMA route to the destination address in order to establish
 a connection.  The destination address must have already been resolved
 by calling rdma_resolve_addr.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 This is called on the client side of a connection after calling
 rdma_resolve_addr, but before calling rdma_connect.
diff --git a/man/rdma_server.1 b/man/rdma_server.1
new file mode 100644
index 0000000..19f4860
--- /dev/null
+++ b/man/rdma_server.1
@@ -0,0 +1,26 @@
+.TH "RDMA_SERVER" 1 "2010-07-19" "librdmacm" "librdmacm" librdmacm
+.SH NAME
+rdma_server \- simple RDMA CM connection and ping-pong test.
+.SH SYNOPSIS
+.sp
+.nf
+\fIrdma_server\fR [-p port]
+.fi
+.SH "DESCRIPTION"
+Uses synchronous librdmam calls to establish an RDMA connections between
+two nodes.  This example is intended to provide a very simple coding
+example of how to use RDMA.
+.SH "OPTIONS"
+.TP
+\-p port
+Changes the port number that the server listens on.  By default the server
+listens on port 7471.
+.SH "NOTES"
+Basic usage is to start rdma_server, then connect to the server using the
+rdma_client program.
+.P
+Because this test maps RDMA resources to userspace, users must ensure
+that they have available system resources and permissions.  See the
+libibverbs README file for additional details.
+.SH "SEE ALSO"
+rdma_cm(7), udaddy(1), mckey(1), rping(1), rdma_client(1)
diff --git a/man/rdma_set_option.3 b/man/rdma_set_option.3
index ffa516c..8e344ab 100644
--- a/man/rdma_set_option.3
+++ b/man/rdma_set_option.3
@@ -24,6 +24,9 @@ The size of the %optval buffer.
 .SH "DESCRIPTION"
 Sets communication options for an rdma_cm_id.  This call is used to override
 the default system settings.
+.SH "RETURN VALUE"
+Returns 0 on success, or -1 on error.  If an error occurs, errno will be
+set to indicate the failure reason.
 .SH "NOTES"
 Option details may be found in the relevent header files.
 .SH "SEE ALSO"
diff --git a/src/acm.c b/src/acm.c
new file mode 100755
index 0000000..1fa6c62
--- /dev/null
+++ b/src/acm.c
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.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 AND
+ * 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.
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <unistd.h>
+
+#include "cma.h"
+#include <rdma/rdma_cma.h>
+#include <infiniband/ib.h>
+#include <infiniband/sa.h>
+
+#ifdef USE_IB_ACM
+#include <infiniband/acm.h>
+
+static pthread_mutex_t acm_lock = PTHREAD_MUTEX_INITIALIZER;
+static int sock;
+static short server_port = 6125;
+
+struct ib_connect_hdr {
+	uint8_t  cma_version;
+	uint8_t  ip_version; /* IP version: 7:4 */
+	uint16_t port;
+	uint32_t src_addr[4];
+	uint32_t dst_addr[4];
+#define cma_src_ip4 src_addr[3]
+#define cma_src_ip6 src_addr[0]
+#define cma_dst_ip4 dst_addr[3]
+#define cma_dst_ip6 dst_addr[0]
+};
+
+static void ucma_set_server_port(void)
+{
+	FILE *f;
+
+	if ((f = fopen("/var/run/ibacm.port", "r"))) {
+		fscanf(f, "%hu", (unsigned short *) &server_port);
+		fclose(f);
+	}
+}
+
+void ucma_ib_init(void)
+{
+	struct sockaddr_in addr;
+	int ret;
+
+	ucma_set_server_port();
+	sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+	if (sock < 0)
+		return;
+
+	memset(&addr, 0, sizeof addr);
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+	addr.sin_port = htons(server_port);
+	ret = connect(sock, (struct sockaddr *) &addr, sizeof(addr));
+	if (ret)
+		goto err;
+
+	return;
+
+err:
+	close(sock);
+	sock = 0;
+}
+
+void ucma_ib_cleanup(void)
+{
+	if (sock > 0) {
+		shutdown(sock, SHUT_RDWR);
+		close(sock);
+	}
+}
+
+static void ucma_set_sid(enum rdma_port_space ps, struct sockaddr *addr,
+			 struct sockaddr_ib *sib)
+{
+	uint16_t port;
+
+	if (addr->sa_family == AF_INET)
+		port = ((struct sockaddr_in *) addr)->sin_port;
+	else
+		port = ((struct sockaddr_in6 *) addr)->sin6_port;
+
+	sib->sib_sid = htonll(((uint64_t) ps << 16) + ntohs(port));
+	if (port)
+		sib->sib_sid_mask = ~0ULL;
+	else
+		sib->sib_sid_mask = htonll(RDMA_IB_IP_PS_MASK);
+}
+
+static int ucma_ib_convert_addr(struct rdma_addrinfo *rai,
+				struct ibv_path_record *path)
+{
+	struct sockaddr_ib *src, *dst;
+
+	if (!path)
+		return ERR(ENODATA);
+
+	src = calloc(1, sizeof *src);
+	if (!src)
+		return ERR(ENOMEM);
+
+	dst = calloc(1, sizeof *dst);
+	if (!dst) {
+		free(src);
+		return ERR(ENOMEM);
+	}
+
+	src->sib_family = AF_IB;
+	src->sib_pkey = path->pkey;
+	src->sib_flowinfo = htonl(ntohl(path->flowlabel_hoplimit) >> 8);
+	memcpy(&src->sib_addr, &path->sgid, 16);
+	ucma_set_sid(rai->ai_port_space, rai->ai_src_addr, src);
+
+	dst->sib_family = AF_IB;
+	dst->sib_pkey = path->pkey;
+	dst->sib_flowinfo = htonl(ntohl(path->flowlabel_hoplimit) >> 8);
+	memcpy(&dst->sib_addr, &path->dgid, 16);
+	ucma_set_sid(rai->ai_port_space, rai->ai_dst_addr, dst);
+
+	free(rai->ai_src_addr);
+	rai->ai_src_addr = (struct sockaddr *) src;
+	rai->ai_src_len = sizeof(*src);
+
+	free(rai->ai_dst_addr);
+	rai->ai_dst_addr = (struct sockaddr *) dst;
+	rai->ai_dst_len = sizeof(*dst);
+
+	rai->ai_family = AF_IB;
+	rai->ai_port_space = RDMA_PS_IB;
+	return 0;
+}
+				 
+static void ucma_ib_format_connect(struct rdma_addrinfo *rai)
+{
+	struct ib_connect_hdr *hdr;
+
+	hdr = calloc(1, sizeof *hdr);
+	if (!hdr)
+		return;
+
+	if (rai->ai_family == AF_INET) {
+		hdr->ip_version = 4 << 4;
+		memcpy(&hdr->cma_src_ip4,
+		       &((struct sockaddr_in *) rai->ai_src_addr)->sin_addr, 4);
+		memcpy(&hdr->cma_dst_ip4,
+		       &((struct sockaddr_in *) rai->ai_dst_addr)->sin_addr, 4);
+	} else {
+		hdr->ip_version = 6 << 4;
+		memcpy(&hdr->cma_src_ip6,
+		       &((struct sockaddr_in6 *) rai->ai_src_addr)->sin6_addr, 16);
+		memcpy(&hdr->cma_dst_ip6,
+		       &((struct sockaddr_in6 *) rai->ai_dst_addr)->sin6_addr, 16);
+	}
+
+	rai->ai_connect = hdr;
+	rai->ai_connect_len = sizeof(*hdr);
+}
+
+static void ucma_ib_save_resp(struct rdma_addrinfo *rai, struct acm_resolve_msg *msg)
+{
+	struct ibv_path_data *path_data = NULL;
+	struct ibv_path_record *pri_path = NULL;
+	int i, cnt, path_cnt = 0;
+
+	cnt = (msg->hdr.length - ACM_MSG_HDR_LENGTH) / ACM_MSG_EP_LENGTH;
+	for (i = 0; i < cnt; i++) {
+		switch (msg->data[i].type) {
+		case ACM_EP_INFO_PATH:
+			msg->data[i].type = 0;
+			if (!path_data)
+				path_data = (struct ibv_path_data *) &msg->data[i];
+			path_cnt++;
+			if (msg->data[i].flags |
+			    (IBV_PATH_FLAG_PRIMARY | IBV_PATH_FLAG_OUTBOUND))
+				pri_path = &path_data[i].path;
+			break;
+		case ACM_EP_INFO_ADDRESS_IP:
+			if (!(msg->data[i].flags & ACM_EP_FLAG_SOURCE) || rai->ai_src_len)
+				break;
+
+			rai->ai_src_addr = calloc(1, sizeof(struct sockaddr_in));
+			if (!rai->ai_src_addr)
+				break;
+
+			rai->ai_src_len = sizeof(struct sockaddr_in);
+			memcpy(&((struct sockaddr_in *) rai->ai_src_addr)->sin_addr,
+			       &msg->data[i].info.addr, 4);
+			break;
+		case ACM_EP_INFO_ADDRESS_IP6:
+			if (!(msg->data[i].flags & ACM_EP_FLAG_SOURCE) || rai->ai_src_len)
+				break;
+
+			rai->ai_src_addr = calloc(1, sizeof(struct sockaddr_in6));
+			if (!rai->ai_src_addr)
+				break;
+
+			rai->ai_src_len = sizeof(struct sockaddr_in6);
+			memcpy(&((struct sockaddr_in6 *) rai->ai_src_addr)->sin6_addr,
+			       &msg->data[i].info.addr, 16);
+			break;
+		default:
+			break;
+		}
+	}
+
+	rai->ai_route = calloc(path_cnt, sizeof(*path_data));
+	if (rai->ai_route) {
+		memcpy(rai->ai_route, path_data, path_cnt * sizeof(*path_data));
+		rai->ai_route_len = path_cnt * sizeof(*path_data);
+	}
+
+	if (af_ib_support && !(rai->ai_flags & RAI_ROUTEONLY)) {
+		ucma_ib_format_connect(rai);
+		if (ucma_ib_convert_addr(rai, pri_path) &&
+		    rai->ai_connect) {
+			free(rai->ai_connect);
+			rai->ai_connect_len = 0;
+		}
+	}
+}
+
+static void ucma_copy_rai_addr(struct acm_ep_addr_data *data, struct sockaddr *addr)
+{
+	if (addr->sa_family == AF_INET) {
+		data->type = ACM_EP_INFO_ADDRESS_IP;
+		memcpy(data->info.addr, &((struct sockaddr_in *) addr)->sin_addr, 4);
+	} else {
+		data->type = ACM_EP_INFO_ADDRESS_IP6;
+		memcpy(data->info.addr, &((struct sockaddr_in6 *) addr)->sin6_addr, 16);
+	}
+}
+
+void ucma_ib_resolve(struct rdma_addrinfo *rai, struct rdma_addrinfo *hints)
+{
+	struct acm_msg msg;
+	struct acm_resolve_msg *resolve_msg = (struct acm_resolve_msg *) &msg;
+	struct acm_ep_addr_data *data;
+	int ret;
+
+	if (sock <= 0)
+		return;
+
+	memset(&msg, 0, sizeof msg);
+	msg.hdr.version = ACM_VERSION;
+	msg.hdr.opcode = ACM_OP_RESOLVE;
+	msg.hdr.length = ACM_MSG_HDR_LENGTH;
+
+	data = &resolve_msg->data[0];
+	if (rai->ai_src_len) {
+		data->flags = ACM_EP_FLAG_SOURCE;
+		ucma_copy_rai_addr(data, rai->ai_src_addr);
+		data++;
+		msg.hdr.length += ACM_MSG_EP_LENGTH;
+	}
+
+	if (rai->ai_dst_len) {
+		data->flags = ACM_EP_FLAG_DEST;
+		if (rai->ai_flags & (RAI_NUMERICHOST | RAI_NOROUTE))
+			data->flags |= ACM_FLAGS_NODELAY;
+		ucma_copy_rai_addr(data, rai->ai_dst_addr);
+		data++;
+		msg.hdr.length += ACM_MSG_EP_LENGTH;
+	}
+
+	if (hints && hints->ai_route_len) {
+		data->type = ACM_EP_INFO_PATH;
+		memcpy(&data->info.path, hints->ai_route, hints->ai_route_len);
+		data++;
+		msg.hdr.length += ACM_MSG_EP_LENGTH;
+	}
+
+	pthread_mutex_lock(&acm_lock);
+	ret = send(sock, (char *) &msg, msg.hdr.length, 0);
+	if (ret != msg.hdr.length) {
+		pthread_mutex_unlock(&acm_lock);
+		return;
+	}
+
+	ret = recv(sock, (char *) &msg, sizeof msg, 0);
+	pthread_mutex_unlock(&acm_lock);
+	if (ret < ACM_MSG_HDR_LENGTH || ret != msg.hdr.length || msg.hdr.status)
+		return;
+
+	ucma_ib_save_resp(rai, resolve_msg);
+}
+
+#endif /* USE_IB_ACM */
diff --git a/src/addrinfo.c b/src/addrinfo.c
new file mode 100755
index 0000000..021f7c4
--- /dev/null
+++ b/src/addrinfo.c
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.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 AND
+ * 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.
+ *
+ * $Id: cm.c 3453 2005-09-15 21:43:21Z sean.hefty $
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <unistd.h>
+
+#include "cma.h"
+#include <rdma/rdma_cma.h>
+#include <infiniband/ib.h>
+
+static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
+{
+	memset(ai, 0, sizeof *ai);
+	ai->ai_flags  = (rai->ai_flags & RAI_PASSIVE) ? AI_PASSIVE : 0;
+	ai->ai_flags |= (rai->ai_flags & RAI_NUMERICHOST) ? AI_NUMERICHOST : 0;
+	ai->ai_family = rai->ai_family;
+
+	switch (rai->ai_qp_type) {
+	case IBV_QPT_RC:
+		ai->ai_socktype = SOCK_STREAM;
+		break;
+	case IBV_QPT_UD:
+		ai->ai_socktype = SOCK_DGRAM;
+		break;
+	}
+
+	switch (rai->ai_port_space) {
+	case RDMA_PS_TCP:
+		ai->ai_protocol = IPPROTO_TCP;
+		break;
+	case RDMA_PS_IPOIB:
+	case RDMA_PS_UDP:
+		ai->ai_protocol = IPPROTO_UDP;
+		break;
+	}
+
+	if (rai->ai_flags & RAI_PASSIVE) {
+		ai->ai_addrlen = rai->ai_src_len;
+		ai->ai_addr = rai->ai_src_addr;
+	} else {
+		ai->ai_addrlen = rai->ai_dst_len;
+		ai->ai_addr = rai->ai_dst_addr;
+	}
+	ai->ai_canonname = rai->ai_dst_canonname;
+	ai->ai_next = NULL;
+}
+
+static int ucma_convert_to_rai(struct rdma_addrinfo *rai, struct addrinfo *ai)
+{
+	struct sockaddr *addr;
+	char *canonname;
+
+	rai->ai_family = ai->ai_family;
+
+	switch (ai->ai_socktype) {
+	case SOCK_STREAM:
+		rai->ai_qp_type = IBV_QPT_RC;
+		break;
+	case SOCK_DGRAM:
+		rai->ai_qp_type = IBV_QPT_UD;
+		break;
+	}
+
+	switch (ai->ai_protocol) {
+	case IPPROTO_TCP:
+		rai->ai_port_space = RDMA_PS_TCP;
+		break;
+	case IPPROTO_UDP:
+		rai->ai_port_space = RDMA_PS_UDP;
+		break;
+	}
+
+	addr = malloc(ai->ai_addrlen);
+	if (!addr)
+		return ERR(ENOMEM);
+
+	canonname = ai->ai_canonname ? malloc(strlen(ai->ai_canonname) + 1) : NULL;
+	if (canonname)
+		strcpy(canonname, ai->ai_canonname);
+
+	memcpy(addr, ai->ai_addr, ai->ai_addrlen);
+	if (ai->ai_flags & RAI_PASSIVE) {
+		rai->ai_src_addr = addr;
+		rai->ai_src_len = ai->ai_addrlen;
+		rai->ai_src_canonname = canonname;
+	} else {
+		rai->ai_dst_addr = addr;
+		rai->ai_dst_len = ai->ai_addrlen;
+		rai->ai_dst_canonname = canonname;
+	}
+
+	return 0;
+}
+
+static int ucma_convert_gai(char *node, char *service,
+			    struct rdma_addrinfo *hints,
+			    struct rdma_addrinfo *rai)
+{
+	struct addrinfo ai_hints;
+	struct addrinfo *ai, *aih;
+	int ret;
+
+	if (hints) {
+		ucma_convert_to_ai(&ai_hints, hints);
+		rai->ai_flags = hints->ai_flags;
+		aih = &ai_hints;
+	} else {
+		aih = NULL;
+	}
+
+	ret = getaddrinfo(node, service, aih, &ai);
+	if (ret)
+		return ret;
+
+	ret = ucma_convert_to_rai(rai, ai);
+	freeaddrinfo(ai);
+	return ret;
+}
+
+static int ucma_copy_ai_addr(struct sockaddr **dst, socklen_t *dst_len,
+			     struct sockaddr *src, socklen_t src_len)
+{
+	*dst = calloc(1, src_len);
+	if (!(*dst))
+		return ERR(ENOMEM);
+
+	memcpy(*dst, src, src_len);
+	*dst_len = src_len;
+	return 0;
+}
+
+int rdma_getaddrinfo(char *node, char *service,
+		     struct rdma_addrinfo *hints,
+		     struct rdma_addrinfo **res)
+{
+	struct rdma_addrinfo *rai;
+	int ret;
+
+	if (!service && !node && !hints)
+		return ERR(EINVAL);
+
+	ret = ucma_init();
+	if (ret)
+		return ret;
+
+	rai = calloc(1, sizeof(*rai));
+	if (!rai)
+		return ERR(ENOMEM);
+
+	if (node || service) {
+		ret = ucma_convert_gai(node, service, hints, rai);
+	} else {
+		rai->ai_flags = hints->ai_flags;
+		rai->ai_family = hints->ai_family;
+		rai->ai_qp_type = hints->ai_qp_type;
+		rai->ai_port_space = hints->ai_port_space;
+		if (hints->ai_dst_len) {
+			ret = ucma_copy_ai_addr(&rai->ai_dst_addr, &rai->ai_dst_len,
+						hints->ai_dst_addr, hints->ai_dst_len);
+		}
+	}
+	if (ret)
+		goto err;
+
+	if (!rai->ai_src_len && hints && hints->ai_src_len) {
+		ret = ucma_copy_ai_addr(&rai->ai_src_addr, &rai->ai_src_len,
+					hints->ai_src_addr, hints->ai_src_len);
+		if (ret)
+			goto err;
+	}
+
+	if (!(rai->ai_flags & RAI_PASSIVE))
+		ucma_ib_resolve(rai, hints);
+
+	*res = rai;
+	return 0;
+
+err:
+	rdma_freeaddrinfo(rai);
+	return ret;
+}
+
+void rdma_freeaddrinfo(struct rdma_addrinfo *res)
+{
+	struct rdma_addrinfo *rai;
+
+	while (res) {
+		rai = res;
+		res = res->ai_next;
+
+		if (rai->ai_connect)
+			free(rai->ai_connect);
+
+		if (rai->ai_route)
+			free(rai->ai_route);
+
+		if (rai->ai_src_canonname)
+			free(rai->ai_src_canonname);
+
+		if (rai->ai_dst_canonname)
+			free(rai->ai_dst_canonname);
+
+		if (rai->ai_src_addr)
+			free(rai->ai_src_addr);
+
+		if (rai->ai_dst_addr)
+			free(rai->ai_dst_addr);
+
+		free(rai);
+	}
+}
diff --git a/src/cma.c b/src/cma.c
old mode 100644
new mode 100755
index efad6ae..7ac5335
--- a/src/cma.c
+++ b/src/cma.c
@@ -49,38 +49,15 @@
 #include <endian.h>
 #include <byteswap.h>
 #include <stddef.h>
+#include <netdb.h>
 
+#include "cma.h"
 #include <infiniband/driver.h>
 #include <infiniband/marshall.h>
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_cma_abi.h>
-
-#ifdef INCLUDE_VALGRIND
-#   include <valgrind/memcheck.h>
-#   ifndef VALGRIND_MAKE_MEM_DEFINED
-#       warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined"
-#   endif
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-#   define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
-
-#define PFX "librdmacm: "
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-static inline uint64_t htonll(uint64_t x) { return bswap_64(x); }
-static inline uint64_t ntohll(uint64_t x) { return bswap_64(x); }
-#else
-static inline uint64_t htonll(uint64_t x) { return x; }
-static inline uint64_t ntohll(uint64_t x) { return x; }
-#endif
-
-static inline int ERR(int err)
-{
-	errno = err;
-	return -1;
-}
+#include <rdma/rdma_verbs.h>
+#include <infiniband/ib.h>
 
 #define CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, type, size) \
 do {                                        \
@@ -120,6 +97,7 @@ do {                                        \
 
 struct cma_device {
 	struct ibv_context *verbs;
+	struct ibv_pd	   *pd;
 	uint64_t	    guid;
 	int		    port_cnt;
 	uint8_t		    max_initiator_depth;
@@ -127,14 +105,21 @@ struct cma_device {
 };
 
 struct cma_id_private {
-	struct rdma_cm_id id;
-	struct cma_device *cma_dev;
-	int		  events_completed;
-	int		  connect_error;
-	pthread_cond_t	  cond;
-	pthread_mutex_t	  mut;
-	uint32_t	  handle;
-	struct cma_multicast *mc_list;
+	struct rdma_cm_id	id;
+	struct cma_device	*cma_dev;
+	void			*connect;
+	size_t			connect_len;
+	int			events_completed;
+	int			connect_error;
+	int			sync;
+	pthread_cond_t		cond;
+	pthread_mutex_t		mut;
+	uint32_t		handle;
+	struct cma_multicast	*mc_list;
+	struct ibv_pd		*pd;
+	struct ibv_qp_init_attr	*qp_init_attr;
+	uint8_t			initiator_depth;
+	uint8_t			responder_resources;
 };
 
 struct cma_multicast {
@@ -160,16 +145,21 @@ static struct cma_device *cma_dev_array;
 static int cma_dev_cnt;
 static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
 static int abi_ver = RDMA_USER_CM_MAX_ABI_VERSION;
+int af_ib_support;
 
 #define container_of(ptr, type, field) \
 	((type *) ((void *)ptr - offsetof(type, field)))
 
 static void ucma_cleanup(void)
 {
+	ucma_ib_cleanup();
+
 	if (cma_dev_cnt) {
-		while (cma_dev_cnt)
-			ibv_close_device(cma_dev_array[--cma_dev_cnt].verbs);
-	
+		while (cma_dev_cnt--) {
+			ibv_dealloc_pd(cma_dev_array[cma_dev_cnt].pd);
+			ibv_close_device(cma_dev_array[cma_dev_cnt].verbs);
+		}
+
 		free(cma_dev_array);
 		cma_dev_cnt = 0;
 	}
@@ -206,12 +196,45 @@ static int check_abi_version(void)
 	return 0;
 }
 
-static int ucma_init(void)
+/*
+ * This function is called holding the mutex lock
+ * cma_dev_cnt must be set before calling this function to
+ * ensure that the lock is not acquired recursively.
+ */
+static void ucma_set_af_ib_support(void)
+{
+	struct rdma_cm_id *id;
+	struct sockaddr_ib sib;
+	int ret;
+
+	/* Just return - do not enable AF_IB support for now */
+	return;
+
+	ret = rdma_create_id(NULL, &id, NULL, RDMA_PS_IB);
+	if (ret)
+		return;
+
+	memset(&sib, 0, sizeof sib);
+	sib.sib_family = AF_IB;
+	sib.sib_sid = htonll(RDMA_IB_IP_PS_TCP);
+	sib.sib_sid_mask = htonll(RDMA_IB_IP_PS_MASK);
+	af_ib_support = 1;
+	ret = rdma_bind_addr(id, (struct sockaddr *) &sib);
+	af_ib_support = !ret;
+
+	rdma_destroy_id(id);
+}
+
+int ucma_init(void)
 {
 	struct ibv_device **dev_list = NULL;
 	struct cma_device *cma_dev;
 	struct ibv_device_attr attr;
-	int i, ret, dev_cnt;
+	int i, ret, dev_cnt, ib;
+
+	/* Quick check without lock to see if we're already initialized */
+	if (cma_dev_cnt)
+		return 0;
 
 	pthread_mutex_lock(&mut);
 	if (cma_dev_cnt) {
@@ -236,7 +259,7 @@ static int ucma_init(void)
 		goto err2;
 	}
 
-	for (i = 0; dev_list[i];) {
+	for (i = 0, ib = 0; dev_list[i];) {
 		cma_dev = &cma_dev_array[i];
 
 		cma_dev->guid = ibv_get_device_guid(dev_list[i]);
@@ -247,26 +270,40 @@ static int ucma_init(void)
 			goto err3;
 		}
 
+		cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);
+		if (!cma_dev->pd) {
+			ibv_close_device(cma_dev->verbs);
+			ret = ERR(ENOMEM);
+			goto err3;
+		}
+
 		i++;
 		ret = ibv_query_device(cma_dev->verbs, &attr);
 		if (ret) {
 			printf("CMA: unable to query RDMA device\n");
+			ret = ERR(ret);
 			goto err3;
 		}
 
 		cma_dev->port_cnt = attr.phys_port_cnt;
 		cma_dev->max_initiator_depth = (uint8_t) attr.max_qp_init_rd_atom;
 		cma_dev->max_responder_resources = (uint8_t) attr.max_qp_rd_atom;
+		ib += (cma_dev->verbs->device->transport_type == IBV_TRANSPORT_IB);
 	}
 
+	if (ib)
+		ucma_ib_init();
 	cma_dev_cnt = dev_cnt;
+	ucma_set_af_ib_support();
 	pthread_mutex_unlock(&mut);
 	ibv_free_device_list(dev_list);
 	return 0;
 
 err3:
-	while (i--)
+	while (i--) {
+		ibv_dealloc_pd(cma_dev_array[i].pd);
 		ibv_close_device(cma_dev_array[i].verbs);
+	}
 	free(cma_dev_array);
 err2:
 	ibv_free_device_list(dev_list);
@@ -280,7 +317,7 @@ struct ibv_context **rdma_get_devices(int *num_devices)
 	struct ibv_context **devs = NULL;
 	int i;
 
-	if (!cma_dev_cnt && ucma_init())
+	if (ucma_init())
 		goto out;
 
 	devs = malloc(sizeof *devs * (cma_dev_cnt + 1));
@@ -310,7 +347,7 @@ struct rdma_event_channel *rdma_create_event_channel(void)
 {
 	struct rdma_event_channel *channel;
 
-	if (!cma_dev_cnt && ucma_init())
+	if (ucma_init())
 		return NULL;
 
 	channel = malloc(sizeof *channel);
@@ -357,6 +394,11 @@ static void ucma_free_id(struct cma_id_private *id_priv)
 	pthread_mutex_destroy(&id_priv->mut);
 	if (id_priv->id.route.path_rec)
 		free(id_priv->id.route.path_rec);
+
+	if (id_priv->sync)
+		rdma_destroy_event_channel(id_priv->id.channel);
+	if (id_priv->connect)
+		free(id_priv->connect);
 	free(id_priv);
 }
 
@@ -366,14 +408,22 @@ static struct cma_id_private *ucma_alloc_id(struct rdma_event_channel *channel,
 {
 	struct cma_id_private *id_priv;
 
-	id_priv = malloc(sizeof *id_priv);
+	id_priv = calloc(1, sizeof *id_priv);
 	if (!id_priv)
 		return NULL;
 
-	memset(id_priv, 0, sizeof *id_priv);
 	id_priv->id.context = context;
 	id_priv->id.ps = ps;
-	id_priv->id.channel = channel;
+
+	if (!channel) {
+		id_priv->id.channel = rdma_create_event_channel();
+		if (!id_priv->id.channel)
+			goto err;
+		id_priv->sync = 1;
+	} else {
+		id_priv->id.channel = channel;
+	}
+
 	pthread_mutex_init(&id_priv->mut, NULL);
 	if (pthread_cond_init(&id_priv->cond, NULL))
 		goto err;
@@ -384,9 +434,9 @@ err:	ucma_free_id(id_priv);
 	return NULL;
 }
 
-int rdma_create_id(struct rdma_event_channel *channel,
-		   struct rdma_cm_id **id, void *context,
-		   enum rdma_port_space ps)
+static int rdma_create_id2(struct rdma_event_channel *channel,
+			   struct rdma_cm_id **id, void *context,
+			   enum rdma_port_space ps, enum ibv_qp_type qp_type)
 {
 	struct ucma_abi_create_id_resp *resp;
 	struct ucma_abi_create_id *cmd;
@@ -394,7 +444,7 @@ int rdma_create_id(struct rdma_event_channel *channel,
 	void *msg;
 	int ret, size;
 
-	ret = cma_dev_cnt ? 0 : ucma_init();
+	ret = ucma_init();
 	if (ret)
 		return ret;
 
@@ -405,8 +455,9 @@ int rdma_create_id(struct rdma_event_channel *channel,
 	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_CREATE_ID, size);
 	cmd->uid = (uintptr_t) id_priv;
 	cmd->ps = ps;
+	cmd->qp_type = qp_type;
 
-	ret = write(channel->fd, msg, size);
+	ret = write(id_priv->id.channel->fd, msg, size);
 	if (ret != size)
 		goto err;
 
@@ -420,6 +471,17 @@ err:	ucma_free_id(id_priv);
 	return ret;
 }
 
+int rdma_create_id(struct rdma_event_channel *channel,
+		   struct rdma_cm_id **id, void *context,
+		   enum rdma_port_space ps)
+{
+	enum ibv_qp_type qp_type;
+
+	qp_type = (ps == RDMA_PS_IPOIB || ps == RDMA_PS_UDP) ?
+		  IBV_QPT_UD : IBV_QPT_RC;
+	return rdma_create_id2(channel, id, context, ps, qp_type);
+}
+
 static int ucma_destroy_kern_id(int fd, uint32_t handle)
 {
 	struct ucma_abi_destroy_id_resp *resp;
@@ -449,6 +511,9 @@ int rdma_destroy_id(struct rdma_cm_id *id)
 	if (ret < 0)
 		return ret;
 
+	if (id_priv->id.event)
+		rdma_ack_cm_event(id_priv->id.event);
+
 	pthread_mutex_lock(&id_priv->mut);
 	while (id_priv->events_completed < ret)
 		pthread_cond_wait(&id_priv->cond, &id_priv->mut);
@@ -468,19 +533,167 @@ static int ucma_addrlen(struct sockaddr *addr)
 		return sizeof(struct sockaddr_in);
 	case PF_INET6:
 		return sizeof(struct sockaddr_in6);
+	case PF_IB:
+		return sizeof(struct sockaddr_ib);
 	default:
 		return 0;
 	}
 }
 
+static int ucma_query_addr(struct rdma_cm_id *id)
+{
+	struct ucma_abi_query_addr_resp *resp;
+	struct ucma_abi_query *cmd;
+	struct cma_id_private *id_priv;
+	void *msg;
+	int ret, size;
+	
+	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_QUERY, size);
+	id_priv = container_of(id, struct cma_id_private, id);
+	cmd->id = id_priv->handle;
+	cmd->option = UCMA_QUERY_ADDR;
+
+	ret = write(id->channel->fd, msg, size);
+	if (ret != size)
+		return (ret >= 0) ? ERR(ENODATA) : -1;
+
+	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
+
+	memcpy(&id->route.addr.src_addr, &resp->src_addr, resp->src_size);
+	memcpy(&id->route.addr.dst_addr, &resp->dst_addr, resp->dst_size);
+
+	if (!id_priv->cma_dev && resp->node_guid) {
+		ret = ucma_get_device(id_priv, resp->node_guid);
+		if (ret)
+			return ret;
+		id->port_num = resp->port_num;
+		id->route.addr.addr.ibaddr.pkey = resp->pkey;
+	}
+
+	return 0;
+}
+
+static int ucma_query_gid(struct rdma_cm_id *id)
+{
+	struct ucma_abi_query_addr_resp *resp;
+	struct ucma_abi_query *cmd;
+	struct cma_id_private *id_priv;
+	struct sockaddr_ib *sib;
+	void *msg;
+	int ret, size;
+	
+	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_QUERY, size);
+	id_priv = container_of(id, struct cma_id_private, id);
+	cmd->id = id_priv->handle;
+	cmd->option = UCMA_QUERY_GID;
+
+	ret = write(id->channel->fd, msg, size);
+	if (ret != size)
+		return (ret >= 0) ? ERR(ENODATA) : -1;
+
+	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
+
+	sib = (struct sockaddr_ib *) &resp->src_addr;
+	memcpy(id->route.addr.addr.ibaddr.sgid.raw, sib->sib_addr.sib_raw,
+	       sizeof id->route.addr.addr.ibaddr.sgid);
+
+	sib = (struct sockaddr_ib *) &resp->dst_addr;
+	memcpy(id->route.addr.addr.ibaddr.dgid.raw, sib->sib_addr.sib_raw,
+	       sizeof id->route.addr.addr.ibaddr.dgid);
+
+	return 0;
+}
+
+static void ucma_convert_path(struct ibv_path_data *path_data,
+			      struct ibv_sa_path_rec *sa_path)
+{
+	uint32_t fl_hop;
+
+	sa_path->dgid = path_data->path.dgid;
+	sa_path->sgid = path_data->path.sgid;
+	sa_path->dlid = path_data->path.dlid;
+	sa_path->slid = path_data->path.slid;
+	sa_path->raw_traffic = 0;
+
+	fl_hop = ntohl(path_data->path.flowlabel_hoplimit);
+	sa_path->flow_label = htonl(fl_hop >> 8);
+	sa_path->hop_limit = (uint8_t) fl_hop;
+
+	sa_path->traffic_class = path_data->path.tclass;
+	sa_path->reversible = path_data->path.reversible_numpath >> 7;
+	sa_path->numb_path = 1;
+	sa_path->pkey = path_data->path.pkey;
+	sa_path->sl = ntohs(path_data->path.qosclass_sl) & 0xF;
+	sa_path->mtu_selector = 1;
+	sa_path->mtu = path_data->path.mtu & 0x1F;
+	sa_path->rate_selector = 1;
+	sa_path->rate = path_data->path.rate & 0x1F;
+	sa_path->packet_life_time_selector = 1;
+	sa_path->packet_life_time = path_data->path.packetlifetime & 0x1F;
+
+	sa_path->preference = (uint8_t) path_data->flags;
+}
+
+static int ucma_query_path(struct rdma_cm_id *id)
+{
+	struct ucma_abi_query_path_resp *resp;
+	struct ucma_abi_query *cmd;
+	struct ucma_abi_cmd_hdr *hdr;
+	struct cma_id_private *id_priv;
+	void *msg;
+	int ret, size, i;
+
+	size = sizeof(*hdr) + sizeof(*cmd);
+	msg = alloca(size);
+	if (!msg)
+		return ERR(ENOMEM);
+
+	hdr = msg;
+	cmd = msg + sizeof(*hdr);
+
+	hdr->cmd = UCMA_CMD_QUERY;
+	hdr->in  = sizeof(*cmd);
+	hdr->out = sizeof(*resp) + sizeof(struct ibv_path_data) * 6;
+
+	memset(cmd, 0, sizeof(*cmd));
+
+	resp = alloca(hdr->out);
+	if (!resp)
+		return ERR(ENOMEM);
+
+	id_priv = container_of(id, struct cma_id_private, id);
+	cmd->response = (uintptr_t) resp;
+	cmd->id = id_priv->handle;
+	cmd->option = UCMA_QUERY_PATH;
+
+	ret = write(id->channel->fd, msg, size);
+	if (ret != size)
+		return (ret >= 0) ? ERR(ENODATA) : -1;
+
+	VALGRIND_MAKE_MEM_DEFINED(resp, hdr->out);
+
+	if (resp->num_paths) {
+		id->route.path_rec = malloc(sizeof(*id->route.path_rec) *
+					    resp->num_paths);
+		if (!id->route.path_rec)
+			return ERR(ENOMEM);
+
+		id->route.num_paths = resp->num_paths;
+		for (i = 0; i < resp->num_paths; i++)
+			ucma_convert_path(&resp->path_data[i], &id->route.path_rec[i]);
+	}
+
+	return 0;
+}
+
 static int ucma_query_route(struct rdma_cm_id *id)
 {
 	struct ucma_abi_query_route_resp *resp;
-	struct ucma_abi_query_route *cmd;
+	struct ucma_abi_query *cmd;
 	struct cma_id_private *id_priv;
 	void *msg;
 	int ret, size, i;
-	
+
 	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_QUERY_ROUTE, size);
 	id_priv = container_of(id, struct cma_id_private, id);
 	cmd->id = id_priv->handle;
@@ -523,9 +736,31 @@ static int ucma_query_route(struct rdma_cm_id *id)
 	return 0;
 }
 
+static int rdma_bind_addr2(struct rdma_cm_id *id, struct sockaddr *addr,
+			   socklen_t addrlen)
+{
+	struct ucma_abi_bind *cmd;
+	struct cma_id_private *id_priv;
+	void *msg;
+	int ret, size;
+	
+	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_BIND, size);
+	id_priv = container_of(id, struct cma_id_private, id);
+	cmd->id = id_priv->handle;
+	cmd->addr_size = addrlen;
+	cmd->reserved = 0;
+	memcpy(&cmd->addr, addr, addrlen);
+
+	ret = write(id->channel->fd, msg, size);
+	if (ret != size)
+		return (ret >= 0) ? ERR(ENODATA) : -1;
+
+	return ucma_query_addr(id);
+}
+
 int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
 {
-	struct ucma_abi_bind_addr *cmd;
+	struct ucma_abi_bind_ip *cmd;
 	struct cma_id_private *id_priv;
 	void *msg;
 	int ret, size, addrlen;
@@ -534,7 +769,10 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
 	if (!addrlen)
 		return ERR(EINVAL);
 
-	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_BIND_ADDR, size);
+	if (af_ib_support)
+		return rdma_bind_addr2(id, addr, addrlen);
+
+	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_BIND_IP, size);
 	id_priv = container_of(id, struct cma_id_private, id);
 	cmd->id = id_priv->handle;
 	memcpy(&cmd->addr, addr, addrlen);
@@ -546,32 +784,108 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
 	return ucma_query_route(id);
 }
 
+static int ucma_complete(struct cma_id_private *id_priv)
+{
+	int ret;
+
+	if (!id_priv->sync)
+		return 0;
+
+	if (id_priv->id.event) {
+		rdma_ack_cm_event(id_priv->id.event);
+		id_priv->id.event = NULL;
+	}
+
+	ret = rdma_get_cm_event(id_priv->id.channel, &id_priv->id.event);
+	if (ret)
+		return ret;
+
+	if (id_priv->id.event->status)
+		ret = ERR(id_priv->id.event->status);
+	return ret;
+}
+
+static int rdma_resolve_addr2(struct rdma_cm_id *id, struct sockaddr *src_addr,
+			      socklen_t src_len, struct sockaddr *dst_addr,
+			      socklen_t dst_len, int timeout_ms)
+{
+	struct ucma_abi_resolve_addr *cmd;
+	struct cma_id_private *id_priv;
+	void *msg;
+	int ret, size;
+	
+	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_RESOLVE_ADDR, size);
+	id_priv = container_of(id, struct cma_id_private, id);
+	cmd->id = id_priv->handle;
+	if ((cmd->src_size = src_len))
+		memcpy(&cmd->src_addr, src_addr, src_len);
+	memcpy(&cmd->dst_addr, dst_addr, dst_len);
+	cmd->dst_size = dst_len;
+	cmd->timeout_ms = timeout_ms;
+	cmd->reserved = 0;
+
+	ret = write(id->channel->fd, msg, size);
+	if (ret != size)
+		return (ret >= 0) ? ERR(ENODATA) : -1;
+
+	memcpy(&id->route.addr.dst_addr, dst_addr, dst_len);
+	return ucma_complete(id_priv);
+}
+
 int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr,
 		      struct sockaddr *dst_addr, int timeout_ms)
 {
-	struct ucma_abi_resolve_addr *cmd;
+	struct ucma_abi_resolve_ip *cmd;
 	struct cma_id_private *id_priv;
 	void *msg;
-	int ret, size, daddrlen;
+	int ret, size, dst_len, src_len;
 	
-	daddrlen = ucma_addrlen(dst_addr);
-	if (!daddrlen)
+	dst_len = ucma_addrlen(dst_addr);
+	if (!dst_len)
 		return ERR(EINVAL);
 
-	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_RESOLVE_ADDR, size);
+	src_len = ucma_addrlen(src_addr);
+	if (af_ib_support)
+		return rdma_resolve_addr2(id, src_addr, src_len, dst_addr,
+					  dst_len, timeout_ms);
+
+	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_RESOLVE_IP, size);
 	id_priv = container_of(id, struct cma_id_private, id);
 	cmd->id = id_priv->handle;
 	if (src_addr)
-		memcpy(&cmd->src_addr, src_addr, ucma_addrlen(src_addr));
-	memcpy(&cmd->dst_addr, dst_addr, daddrlen);
+		memcpy(&cmd->src_addr, src_addr, src_len);
+	memcpy(&cmd->dst_addr, dst_addr, dst_len);
 	cmd->timeout_ms = timeout_ms;
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 
-	memcpy(&id->route.addr.dst_addr, dst_addr, daddrlen);
-	return 0;
+	memcpy(&id->route.addr.dst_addr, dst_addr, dst_len);
+	return ucma_complete(id_priv);
+}
+
+static int ucma_set_ib_route(struct rdma_cm_id *id)
+{
+	struct rdma_addrinfo hint, *rai;
+	int ret;
+
+	memset(&hint, 0, sizeof hint);
+	hint.ai_flags = RAI_ROUTEONLY;
+	hint.ai_family = id->route.addr.src_addr.sa_family;
+	hint.ai_src_len = ucma_addrlen((struct sockaddr *) &id->route.addr.src_addr);
+	hint.ai_src_addr = &id->route.addr.src_addr;
+	hint.ai_dst_len = ucma_addrlen((struct sockaddr *) &id->route.addr.dst_addr);
+	hint.ai_dst_addr = &id->route.addr.dst_addr;
+
+	ret = rdma_getaddrinfo(NULL, NULL, &hint, &rai);
+	if (ret)
+		return ret;
+
+	ret = rdma_set_option(id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
+			      rai->ai_route, rai->ai_route_len);
+	rdma_freeaddrinfo(rai);
+	return ret;
 }
 
 int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
@@ -580,9 +894,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 	struct cma_id_private *id_priv;
 	void *msg;
 	int ret, size;
-	
-	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_RESOLVE_ROUTE, size);
+
 	id_priv = container_of(id, struct cma_id_private, id);
+	if (id->verbs->device->transport_type == IBV_TRANSPORT_IB) {
+		ret = ucma_set_ib_route(id);
+		if (!ret)
+			goto out;
+	}
+
+	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_RESOLVE_ROUTE, size);
 	cmd->id = id_priv->handle;
 	cmd->timeout_ms = timeout_ms;
 
@@ -590,7 +910,8 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 	if (ret != size)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 
-	return 0;
+out:
+	return ucma_complete(id_priv);
 }
 
 static int ucma_is_ud_ps(enum rdma_port_space ps)
@@ -623,8 +944,7 @@ static int rdma_init_qp_attr(struct rdma_cm_id *id, struct ibv_qp_attr *qp_attr,
 	return 0;
 }
 
-static int ucma_modify_qp_rtr(struct rdma_cm_id *id,
-			      struct rdma_conn_param *conn_param)
+static int ucma_modify_qp_rtr(struct rdma_cm_id *id, uint8_t resp_res)
 {
 	struct ibv_qp_attr qp_attr;
 	int qp_attr_mask, ret;
@@ -640,19 +960,19 @@ static int ucma_modify_qp_rtr(struct rdma_cm_id *id,
 
 	ret = ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
 	if (ret)
-		return ret;
+		return ERR(ret);
 
 	qp_attr.qp_state = IBV_QPS_RTR;
 	ret = rdma_init_qp_attr(id, &qp_attr, &qp_attr_mask);
 	if (ret)
 		return ret;
 
-	if (conn_param)
-		qp_attr.max_dest_rd_atomic = conn_param->responder_resources;
-	return ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
+	if (resp_res != RDMA_MAX_RESP_RES)
+		qp_attr.max_dest_rd_atomic = resp_res;
+	return rdma_seterrno(ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask));
 }
 
-static int ucma_modify_qp_rts(struct rdma_cm_id *id)
+static int ucma_modify_qp_rts(struct rdma_cm_id *id, uint8_t init_depth)
 {
 	struct ibv_qp_attr qp_attr;
 	int qp_attr_mask, ret;
@@ -662,7 +982,9 @@ static int ucma_modify_qp_rts(struct rdma_cm_id *id)
 	if (ret)
 		return ret;
 
-	return ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
+	if (init_depth != RDMA_MAX_INIT_DEPTH)
+		qp_attr.max_rd_atomic = init_depth;
+	return rdma_seterrno(ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask));
 }
 
 static int ucma_modify_qp_sqd(struct rdma_cm_id *id)
@@ -673,7 +995,7 @@ static int ucma_modify_qp_sqd(struct rdma_cm_id *id)
 		return 0;
 
 	qp_attr.qp_state = IBV_QPS_SQD;
-	return ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE);
+	return rdma_seterrno(ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE));
 }
 
 static int ucma_modify_qp_err(struct rdma_cm_id *id)
@@ -684,7 +1006,7 @@ static int ucma_modify_qp_err(struct rdma_cm_id *id)
 		return 0;
 
 	qp_attr.qp_state = IBV_QPS_ERR;
-	return ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE);
+	return rdma_seterrno(ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE));
 }
 
 static int ucma_find_pkey(struct cma_device *cma_dev, uint8_t port_num,
@@ -718,8 +1040,9 @@ static int ucma_init_conn_qp3(struct cma_id_private *id_priv, struct ibv_qp *qp)
 	qp_attr.qp_state = IBV_QPS_INIT;
 	qp_attr.qp_access_flags = 0;
 
-	return ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_ACCESS_FLAGS |
-					   IBV_QP_PKEY_INDEX | IBV_QP_PORT);
+	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_ACCESS_FLAGS |
+					  IBV_QP_PKEY_INDEX | IBV_QP_PORT);
+	return rdma_seterrno(ret);
 }
 
 static int ucma_init_conn_qp(struct cma_id_private *id_priv, struct ibv_qp *qp)
@@ -735,7 +1058,7 @@ static int ucma_init_conn_qp(struct cma_id_private *id_priv, struct ibv_qp *qp)
 	if (ret)
 		return ret;
 
-	return ibv_modify_qp(qp, &qp_attr, qp_attr_mask);
+	return rdma_seterrno(ibv_modify_qp(qp, &qp_attr, qp_attr_mask));
 }
 
 static int ucma_init_ud_qp3(struct cma_id_private *id_priv, struct ibv_qp *qp)
@@ -756,16 +1079,17 @@ static int ucma_init_ud_qp3(struct cma_id_private *id_priv, struct ibv_qp *qp)
 	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_QKEY |
 					  IBV_QP_PKEY_INDEX | IBV_QP_PORT);
 	if (ret)
-		return ret;
+		return ERR(ret);
 
 	qp_attr.qp_state = IBV_QPS_RTR;
 	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE);
 	if (ret)
-		return ret;
+		return ERR(ret);
 
 	qp_attr.qp_state = IBV_QPS_RTS;
 	qp_attr.sq_psn = 0;
-	return ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
+	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
+	return rdma_seterrno(ret);
 }
 
 static int ucma_init_ud_qp(struct cma_id_private *id_priv, struct ibv_qp *qp)
@@ -783,16 +1107,66 @@ static int ucma_init_ud_qp(struct cma_id_private *id_priv, struct ibv_qp *qp)
 
 	ret = ibv_modify_qp(qp, &qp_attr, qp_attr_mask);
 	if (ret)
-		return ret;
+		return ERR(ret);
 
 	qp_attr.qp_state = IBV_QPS_RTR;
 	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE);
 	if (ret)
-		return ret;
+		return ERR(ret);
 
 	qp_attr.qp_state = IBV_QPS_RTS;
 	qp_attr.sq_psn = 0;
-	return ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
+	ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
+	return rdma_seterrno(ret);
+}
+
+static void ucma_destroy_cqs(struct rdma_cm_id *id)
+{
+	if (id->recv_cq)
+		ibv_destroy_cq(id->recv_cq);
+
+	if (id->recv_cq_channel)
+		ibv_destroy_comp_channel(id->recv_cq_channel);
+
+	if (id->send_cq)
+		ibv_destroy_cq(id->send_cq);
+
+	if (id->send_cq_channel)
+		ibv_destroy_comp_channel(id->send_cq_channel);
+}
+
+static int ucma_create_cqs(struct rdma_cm_id *id, struct ibv_qp_init_attr *attr)
+{
+	if (!attr->recv_cq) {
+		id->recv_cq_channel = ibv_create_comp_channel(id->verbs);
+		if (!id->recv_cq_channel)
+			goto err;
+
+		id->recv_cq = ibv_create_cq(id->verbs, attr->cap.max_recv_wr,
+					    id, id->recv_cq_channel, 0);
+		if (!id->recv_cq)
+			goto err;
+
+		attr->recv_cq = id->recv_cq;
+	}
+
+	if (!attr->send_cq) {
+		id->send_cq_channel = ibv_create_comp_channel(id->verbs);
+		if (!id->send_cq_channel)
+			goto err;
+
+		id->send_cq = ibv_create_cq(id->verbs, attr->cap.max_send_wr,
+					    id, id->send_cq_channel, 0);
+		if (!id->send_cq)
+			goto err;
+
+		attr->send_cq = id->send_cq;
+	}
+
+	return 0;
+err:
+	ucma_destroy_cqs(id);
+	return ERR(ENOMEM);
 }
 
 int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd,
@@ -803,64 +1177,98 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd,
 	int ret;
 
 	id_priv = container_of(id, struct cma_id_private, id);
-	if (id->verbs != pd->context)
+	if (!pd)
+		pd = id_priv->cma_dev->pd;
+	else if (id->verbs != pd->context)
 		return ERR(EINVAL);
 
+	ret = ucma_create_cqs(id, qp_init_attr);
+	if (ret)
+		return ret;
+
 	qp = ibv_create_qp(pd, qp_init_attr);
-	if (!qp)
-		return ERR(ENOMEM);
+	if (!qp) {
+		ret = ERR(ENOMEM);
+		goto err1;
+	}
 
 	if (ucma_is_ud_ps(id->ps))
 		ret = ucma_init_ud_qp(id_priv, qp);
 	else
 		ret = ucma_init_conn_qp(id_priv, qp);
 	if (ret)
-		goto err;
+		goto err2;
 
 	id->qp = qp;
 	return 0;
-err:
+err2:
 	ibv_destroy_qp(qp);
+err1:
+	ucma_destroy_cqs(id);
 	return ret;
 }
 
 void rdma_destroy_qp(struct rdma_cm_id *id)
 {
 	ibv_destroy_qp(id->qp);
+	ucma_destroy_cqs(id);
+	id->qp = NULL;
 }
 
 static int ucma_valid_param(struct cma_id_private *id_priv,
-			    struct rdma_conn_param *conn_param)
+			    struct rdma_conn_param *param)
 {
 	if (id_priv->id.ps != RDMA_PS_TCP)
 		return 0;
 
-	if ((conn_param->responder_resources >
-	     id_priv->cma_dev->max_responder_resources) ||
-	    (conn_param->initiator_depth >
-	     id_priv->cma_dev->max_initiator_depth))
-		return ERR(EINVAL);
+	if (!id_priv->id.qp && !param)
+		goto err;
+
+	if (!param)
+		return 0;
+
+	if ((param->responder_resources != RDMA_MAX_RESP_RES) &&
+	    (param->responder_resources > id_priv->cma_dev->max_responder_resources))
+		goto err;
+
+	if ((param->initiator_depth != RDMA_MAX_INIT_DEPTH) &&
+	    (param->initiator_depth > id_priv->cma_dev->max_initiator_depth))
+		goto err;
 
 	return 0;
+err:
+	return ERR(EINVAL);
 }
 
-static void ucma_copy_conn_param_to_kern(struct ucma_abi_conn_param *dst,
+static void ucma_copy_conn_param_to_kern(struct cma_id_private *id_priv,
+					 struct ucma_abi_conn_param *dst,
 					 struct rdma_conn_param *src,
 					 uint32_t qp_num, uint8_t srq)
 {
 	dst->qp_num = qp_num;
 	dst->srq = srq;
-	dst->responder_resources = src->responder_resources;
-	dst->initiator_depth = src->initiator_depth;
-	dst->flow_control = src->flow_control;
-	dst->retry_count = src->retry_count;
-	dst->rnr_retry_count = src->rnr_retry_count;
+	dst->responder_resources = id_priv->responder_resources;
+	dst->initiator_depth = id_priv->initiator_depth;
 	dst->valid = 1;
 
-	if (src->private_data && src->private_data_len) {
-		memcpy(dst->private_data, src->private_data,
-		       src->private_data_len);
-		dst->private_data_len = src->private_data_len;
+	if (id_priv->connect_len) {
+		memcpy(dst->private_data, id_priv->connect, id_priv->connect_len);
+		dst->private_data_len = id_priv->connect_len;
+	}
+
+	if (src) {
+		dst->flow_control = src->flow_control;
+		dst->retry_count = src->retry_count;
+		dst->rnr_retry_count = src->rnr_retry_count;
+
+		if (src->private_data && src->private_data_len) {
+			memcpy(dst->private_data + dst->private_data_len,
+			       src->private_data, src->private_data_len);
+			dst->private_data_len += src->private_data_len;
+		}
+	} else {
+		dst->retry_count = 7;
+		dst->rnr_retry_count = 7;
 	}
 }
 
@@ -876,22 +1284,36 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 	if (ret)
 		return ret;
 
+	if (conn_param && conn_param->initiator_depth != RDMA_MAX_INIT_DEPTH)
+		id_priv->initiator_depth = conn_param->initiator_depth;
+	else
+		id_priv->initiator_depth = id_priv->cma_dev->max_initiator_depth;
+	if (conn_param && conn_param->responder_resources != RDMA_MAX_RESP_RES)
+		id_priv->responder_resources = conn_param->responder_resources;
+	else
+		id_priv->responder_resources = id_priv->cma_dev->max_responder_resources;
+
 	CMA_CREATE_MSG_CMD(msg, cmd, UCMA_CMD_CONNECT, size);
 	cmd->id = id_priv->handle;
 	if (id->qp)
-		ucma_copy_conn_param_to_kern(&cmd->conn_param, conn_param,
-					     id->qp->qp_num,
+		ucma_copy_conn_param_to_kern(id_priv, &cmd->conn_param,
+					     conn_param, id->qp->qp_num,
 					     (id->qp->srq != NULL));
 	else
-		ucma_copy_conn_param_to_kern(&cmd->conn_param, conn_param,
-					     conn_param->qp_num,
+		ucma_copy_conn_param_to_kern(id_priv, &cmd->conn_param,
+					     conn_param, conn_param->qp_num,
 					     conn_param->srq);
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 
-	return 0;
+	if (id_priv->connect) {
+		free(id_priv->connect);
+		id_priv->connect_len = 0;
+	}
+
+	return ucma_complete(id_priv);
 }
 
 int rdma_listen(struct rdma_cm_id *id, int backlog)
@@ -910,7 +1332,57 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 	if (ret != size)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 
-	return ucma_query_route(id);
+	if (af_ib_support)
+		return ucma_query_addr(id);
+	else
+		return ucma_query_route(id);
+}
+
+int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id)
+{
+	struct cma_id_private *id_priv;
+	struct rdma_cm_event *event;
+	int ret;
+
+	id_priv = container_of(listen, struct cma_id_private, id);
+	if (!id_priv->sync)
+		return ERR(EINVAL);
+
+	if (listen->event) {
+		rdma_ack_cm_event(listen->event);
+		listen->event = NULL;
+	}
+
+	ret = rdma_get_cm_event(listen->channel, &event);
+	if (ret)
+		return ret;
+
+	if (event->status) {
+		ret = ERR(event->status);
+		goto err;
+	}
+	
+	if (event->event != RDMA_CM_EVENT_CONNECT_REQUEST) {
+		ret = ERR(EINVAL);
+		goto err;
+	}
+
+	if (id_priv->qp_init_attr) {
+		struct ibv_qp_init_attr attr;
+
+		attr = *id_priv->qp_init_attr;
+		ret = rdma_create_qp(event->id, id_priv->pd, &attr);
+		if (ret)
+			goto err;
+	}
+
+	*id = event->id;
+	(*id)->event = event;
+	return 0;
+
+err:
+	listen->event = event;
+	return ret;
 }
 
 int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
@@ -925,8 +1397,25 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 	if (ret)
 		return ret;
 
+	if (!conn_param || conn_param->initiator_depth == RDMA_MAX_INIT_DEPTH) {
+		id_priv->initiator_depth = min(id_priv->initiator_depth,
+					       id_priv->cma_dev->max_initiator_depth);
+	} else {
+		id_priv->initiator_depth = conn_param->initiator_depth;
+	}
+	if (!conn_param || conn_param->responder_resources == RDMA_MAX_RESP_RES) {
+		id_priv->responder_resources = min(id_priv->responder_resources,
+						   id_priv->cma_dev->max_responder_resources);
+	} else {
+		id_priv->responder_resources = conn_param->responder_resources;
+	}
+
 	if (!ucma_is_ud_ps(id->ps)) {
-		ret = ucma_modify_qp_rtr(id, conn_param);
+		ret = ucma_modify_qp_rtr(id, id_priv->responder_resources);
+		if (ret)
+			return ret;
+
+		ret = ucma_modify_qp_rts(id, id_priv->initiator_depth);
 		if (ret)
 			return ret;
 	}
@@ -935,12 +1424,12 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 	cmd->id = id_priv->handle;
 	cmd->uid = (uintptr_t) id_priv;
 	if (id->qp)
-		ucma_copy_conn_param_to_kern(&cmd->conn_param, conn_param,
-					     id->qp->qp_num,
+		ucma_copy_conn_param_to_kern(id_priv, &cmd->conn_param,
+					     conn_param, id->qp->qp_num,
 					     (id->qp->srq != NULL));
 	else
-		ucma_copy_conn_param_to_kern(&cmd->conn_param, conn_param,
-					     conn_param->qp_num,
+		ucma_copy_conn_param_to_kern(id_priv, &cmd->conn_param,
+					     conn_param, conn_param->qp_num,
 					     conn_param->srq);
 
 	ret = write(id->channel->fd, msg, size);
@@ -949,7 +1438,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 	}
 
-	return 0;
+	return ucma_complete(id_priv);
 }
 
 int rdma_reject(struct rdma_cm_id *id, const void *private_data,
@@ -1024,29 +1513,23 @@ int rdma_disconnect(struct rdma_cm_id *id)
 	if (ret != size)
 		return (ret >= 0) ? ERR(ENODATA) : -1;
 
-	return 0;
+	return ucma_complete(id_priv);
 }
 
-int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
-			void *context)
+static int rdma_join_multicast2(struct rdma_cm_id *id, struct sockaddr *addr,
+				socklen_t addrlen, void *context)
 {
-	struct ucma_abi_join_mcast *cmd;
 	struct ucma_abi_create_id_resp *resp;
 	struct cma_id_private *id_priv;
 	struct cma_multicast *mc, **pos;
 	void *msg;
-	int ret, size, addrlen;
+	int ret, size;
 	
 	id_priv = container_of(id, struct cma_id_private, id);
-	addrlen = ucma_addrlen(addr);
-	if (!addrlen)
-		return ERR(EINVAL);
-
-	mc = malloc(sizeof *mc);
+	mc = calloc(1, sizeof *mc);
 	if (!mc)
 		return ERR(ENOMEM);
 
-	memset(mc, 0, sizeof *mc);
 	mc->context = context;
 	mc->id_priv = id_priv;
 	memcpy(&mc->addr, addr, addrlen);
@@ -1060,10 +1543,23 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	id_priv->mc_list = mc;
 	pthread_mutex_unlock(&id_priv->mut);
 
-	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_JOIN_MCAST, size);
-	cmd->id = id_priv->handle;
-	memcpy(&cmd->addr, addr, addrlen);
-	cmd->uid = (uintptr_t) mc;
+	if (af_ib_support) {
+		struct ucma_abi_join_mcast *cmd;
+
+		CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_JOIN_MCAST, size);
+		cmd->id = id_priv->handle;
+		memcpy(&cmd->addr, addr, addrlen);
+		cmd->addr_size = addrlen;
+		cmd->uid = (uintptr_t) mc;
+		cmd->reserved = 0;
+	} else {
+		struct ucma_abi_join_ip_mcast *cmd;
+
+		CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_JOIN_IP_MCAST, size);
+		cmd->id = id_priv->handle;
+		memcpy(&cmd->addr, addr, addrlen);
+		cmd->uid = (uintptr_t) mc;
+	}
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size) {
@@ -1074,7 +1570,8 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
 	mc->handle = resp->id;
-	return 0;
+	return ucma_complete(id_priv);
+
 err2:
 	pthread_mutex_lock(&id_priv->mut);
 	for (pos = &id_priv->mc_list; *pos != mc; pos = &(*pos)->next)
@@ -1086,6 +1583,18 @@ err1:
 	return ret;
 }
 
+int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
+			void *context)
+{
+	int addrlen;
+	
+	addrlen = ucma_addrlen(addr);
+	if (!addrlen)
+		return ERR(EINVAL);
+
+	return rdma_join_multicast2(id, addr, addrlen, context);
+}
+
 int rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 {
 	struct ucma_abi_destroy_id *cmd;
@@ -1172,6 +1681,57 @@ int rdma_ack_cm_event(struct rdma_cm_event *event)
 	return 0;
 }
 
+static void ucma_process_addr_resolved(struct cma_event *evt)
+{
+	if (af_ib_support) {
+		evt->event.status = ucma_query_addr(&evt->id_priv->id);
+		if (!evt->event.status &&
+		    evt->id_priv->id.verbs->device->transport_type == IBV_TRANSPORT_IB)
+			evt->event.status = ucma_query_gid(&evt->id_priv->id);
+	} else {
+		evt->event.status = ucma_query_route(&evt->id_priv->id);
+	}
+
+	if (evt->event.status)
+		evt->event.event = RDMA_CM_EVENT_ADDR_ERROR;
+}
+
+static void ucma_process_route_resolved(struct cma_event *evt)
+{
+	if (evt->id_priv->id.verbs->device->transport_type != IBV_TRANSPORT_IB)
+		return;
+
+	if (af_ib_support)
+		evt->event.status = ucma_query_path(&evt->id_priv->id);
+	else
+		evt->event.status = ucma_query_route(&evt->id_priv->id);
+
+	if (evt->event.status)
+		evt->event.event = RDMA_CM_EVENT_ROUTE_ERROR;
+}
+
+static int ucma_query_req_info(struct rdma_cm_id *id)
+{
+	int ret;
+
+	if (!af_ib_support)
+		return ucma_query_route(id);
+
+	ret = ucma_query_addr(id);
+	if (ret)
+		return ret;
+
+	ret = ucma_query_gid(id);
+	if (ret)
+		return ret;
+
+	ret = ucma_query_path(id);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
 static int ucma_process_conn_req(struct cma_event *evt,
 				 uint32_t handle)
 {
@@ -1183,21 +1743,30 @@ static int ucma_process_conn_req(struct cma_event *evt,
 	if (!id_priv) {
 		ucma_destroy_kern_id(evt->id_priv->id.channel->fd, handle);
 		ret = ERR(ENOMEM);
-		goto err;
+		goto err1;
 	}
 
 	evt->event.listen_id = &evt->id_priv->id;
 	evt->event.id = &id_priv->id;
 	id_priv->handle = handle;
+	id_priv->initiator_depth = evt->event.param.conn.initiator_depth;
+	id_priv->responder_resources = evt->event.param.conn.responder_resources;
 
-	ret = ucma_query_route(&id_priv->id);
-	if (ret) {
-		rdma_destroy_id(&id_priv->id);
-		goto err;
+	if (evt->id_priv->sync) {
+		ret = rdma_migrate_id(&id_priv->id, NULL);
+		if (ret)
+			goto err2;
 	}
 
+	ret = ucma_query_req_info(&id_priv->id);
+	if (ret)
+		goto err2;
+
 	return 0;
-err:
+
+err2:
+	rdma_destroy_id(&id_priv->id);
+err1:
 	ucma_complete_event(evt->id_priv);
 	return ret;
 }
@@ -1208,11 +1777,11 @@ static int ucma_process_conn_resp(struct cma_id_private *id_priv)
 	void *msg;
 	int ret, size;
 
-	ret = ucma_modify_qp_rtr(&id_priv->id, NULL);
+	ret = ucma_modify_qp_rtr(&id_priv->id, RDMA_MAX_RESP_RES);
 	if (ret)
 		goto err;
 
-	ret = ucma_modify_qp_rts(&id_priv->id);
+	ret = ucma_modify_qp_rts(&id_priv->id, RDMA_MAX_INIT_DEPTH);
 	if (ret)
 		goto err;
 
@@ -1231,17 +1800,6 @@ err:
 	return ret;
 }
 
-static int ucma_process_establish(struct rdma_cm_id *id)
-{
-	int ret;
-
-	ret = ucma_modify_qp_rts(id);
-	if (ret)
-		ucma_modify_qp_err(id);
-
-	return ret;
-}
-
 static int ucma_process_join(struct cma_event *evt)
 {
 	evt->mc->mgid = evt->event.param.ud.ah_attr.grh.dgid;
@@ -1250,8 +1808,8 @@ static int ucma_process_join(struct cma_event *evt)
 	if (!evt->id_priv->id.qp)
 		return 0;
 
-	return ibv_attach_mcast(evt->id_priv->id.qp, &evt->mc->mgid,
-				evt->mc->mlid);
+	return rdma_seterrno(ibv_attach_mcast(evt->id_priv->id.qp,
+					      &evt->mc->mgid, evt->mc->mlid));
 }
 
 static void ucma_copy_conn_event(struct cma_event *event,
@@ -1301,7 +1859,7 @@ int rdma_get_cm_event(struct rdma_event_channel *channel,
 	void *msg;
 	int ret, size;
 
-	ret = cma_dev_cnt ? 0 : ucma_init();
+	ret = ucma_init();
 	if (ret)
 		return ret;
 
@@ -1330,14 +1888,10 @@ retry:
 
 	switch (resp->event) {
 	case RDMA_CM_EVENT_ADDR_RESOLVED:
-		evt->event.status = ucma_query_route(&evt->id_priv->id);
-		if (evt->event.status)
-			evt->event.event = RDMA_CM_EVENT_ADDR_ERROR;
+		ucma_process_addr_resolved(evt);
 		break;
 	case RDMA_CM_EVENT_ROUTE_RESOLVED:
-		evt->event.status = ucma_query_route(&evt->id_priv->id);
-		if (evt->event.status)
-			evt->event.event = RDMA_CM_EVENT_ROUTE_ERROR;
+		ucma_process_route_resolved(evt);
 		break;
 	case RDMA_CM_EVENT_CONNECT_REQUEST:
 		evt->id_priv = (void *) (uintptr_t) resp->uid;
@@ -1367,11 +1921,6 @@ retry:
 		}
 
 		ucma_copy_conn_event(evt, &resp->param.conn);
-		evt->event.status = ucma_process_establish(&evt->id_priv->id);
-		if (evt->event.status) {
-			evt->event.event = RDMA_CM_EVENT_CONNECT_ERROR;
-			evt->id_priv->connect_error = 1;
-		}
 		break;
 	case RDMA_CM_EVENT_REJECTED:
 		if (evt->id_priv->connect_error) {
@@ -1488,9 +2037,18 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel)
 	struct ucma_abi_migrate_id *cmd;
 	struct cma_id_private *id_priv;
 	void *msg;
-	int ret, size;
+	int ret, size, sync;
 
 	id_priv = container_of(id, struct cma_id_private, id);
+	if (id_priv->sync && !channel)
+		return ERR(EINVAL);
+
+	if ((sync = (channel == NULL))) {
+		channel = rdma_create_event_channel();
+		if (!channel)
+			return -1;
+	}
+
 	CMA_CREATE_MSG_CMD_RESP(msg, cmd, resp, UCMA_CMD_MIGRATE_ID, size);
 	cmd->id = id_priv->handle;
 	cmd->fd = id->channel->fd;
@@ -1501,6 +2059,14 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel)
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
+	if (id_priv->sync) {
+		if (id->event) {
+			rdma_ack_cm_event(id->event);
+			id->event = NULL;
+		}
+		rdma_destroy_event_channel(id->channel);
+	}
+
 	/*
 	 * Eventually if we want to support migrating channels while events are
 	 * being processed on the current channel, we need to block here while
@@ -1509,6 +2075,7 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel)
 	 * channel after this call returns.
 	 */
 	pthread_mutex_lock(&id_priv->mut);
+	id_priv->sync = sync;
 	id->channel = channel;
 	while (id_priv->events_completed < resp->events_reported)
 		pthread_cond_wait(&id_priv->cond, &id_priv->mut);
@@ -1516,3 +2083,109 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel)
 
 	return 0;
 }
+
+static int ucma_passive_ep(struct rdma_cm_id *id, struct rdma_addrinfo *res,
+			   struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)
+{
+	struct cma_id_private *id_priv;
+	int ret;
+
+	if (af_ib_support)
+		ret = rdma_bind_addr2(id, res->ai_src_addr, res->ai_src_len);
+	else
+		ret = rdma_bind_addr(id, res->ai_src_addr);
+	if (ret)
+		return ret;
+
+	id_priv = container_of(id, struct cma_id_private, id);
+	id_priv->pd = pd;
+
+	if (qp_init_attr) {
+		id_priv->qp_init_attr = malloc(sizeof *qp_init_attr);
+		if (!id_priv->qp_init_attr)
+			return ERR(ENOMEM);
+
+		*id_priv->qp_init_attr = *qp_init_attr;
+		id_priv->qp_init_attr->qp_type = res->ai_qp_type;
+	}
+
+	return 0;
+}
+
+int rdma_create_ep(struct rdma_cm_id **id, struct rdma_addrinfo *res,
+		   struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)
+{
+	struct rdma_cm_id *cm_id;
+	struct cma_id_private *id_priv;
+	int ret;
+
+	ret = rdma_create_id2(NULL, &cm_id, NULL, res->ai_port_space, res->ai_qp_type);
+	if (ret)
+		return ret;
+
+	if (res->ai_flags & RAI_PASSIVE) {
+		ret = ucma_passive_ep(cm_id, res, pd, qp_init_attr);
+		if (ret)
+			goto err;
+		goto out;
+	}
+
+	if (af_ib_support)
+		ret = rdma_resolve_addr2(cm_id, res->ai_src_addr, res->ai_src_len,
+					 res->ai_dst_addr, res->ai_dst_len, 2000);
+	else
+		ret = rdma_resolve_addr(cm_id, res->ai_src_addr, res->ai_dst_addr, 2000);
+	if (ret)
+		goto err;
+
+	if (res->ai_route_len) {
+		ret = rdma_set_option(cm_id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
+				      res->ai_route, res->ai_route_len);
+		if (!ret)
+			ret = ucma_complete(container_of(cm_id, struct cma_id_private, id));
+	} else {
+		ret = rdma_resolve_route(cm_id, 2000);
+	}
+	if (ret)
+		goto err;
+
+	if (qp_init_attr) {
+		qp_init_attr->qp_type = res->ai_qp_type;
+		ret = rdma_create_qp(cm_id, pd, qp_init_attr);
+		if (ret)
+			goto err;
+	}
+
+	if (res->ai_connect_len) {
+		id_priv = container_of(cm_id, struct cma_id_private, id);
+		id_priv->connect = malloc(res->ai_connect_len);
+		if (!id_priv->connect) {
+			ret = ERR(ENOMEM);
+			goto err;
+		}
+		memcpy(id_priv->connect, res->ai_connect, res->ai_connect_len);
+		id_priv->connect_len = res->ai_connect_len;
+	}
+
+out:
+	*id = cm_id;
+	return 0;
+
+err:
+	rdma_destroy_ep(cm_id);
+	return ret;
+}
+
+void rdma_destroy_ep(struct rdma_cm_id *id)
+{
+	struct cma_id_private *id_priv;
+
+	if (id->qp)
+		rdma_destroy_qp(id);
+
+	id_priv = container_of(id, struct cma_id_private, id);
+	if (id_priv->qp_init_attr)
+		free(id_priv->qp_init_attr);
+
+	rdma_destroy_id(id);
+}
diff --git a/src/cma.h b/src/cma.h
new file mode 100644
index 0000000..c6639b0
--- /dev/null
+++ b/src/cma.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2005-2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.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 AND
+ * 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.
+ *
+ */
+
+#if !defined(CMA_H)
+#define CMA_H
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#include <rdma/rdma_cma.h>
+
+#ifdef INCLUDE_VALGRIND
+#   include <valgrind/memcheck.h>
+#   ifndef VALGRIND_MAKE_MEM_DEFINED
+#       warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined"
+#   endif
+#endif
+
+#ifndef VALGRIND_MAKE_MEM_DEFINED
+#   define VALGRIND_MAKE_MEM_DEFINED(addr,len)
+#endif
+
+#define PFX "librdmacm: "
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+static inline uint64_t htonll(uint64_t x) { return bswap_64(x); }
+static inline uint64_t ntohll(uint64_t x) { return bswap_64(x); }
+#else
+static inline uint64_t htonll(uint64_t x) { return x; }
+static inline uint64_t ntohll(uint64_t x) { return x; }
+#endif
+
+#define min(a, b) (a < b ? a : b)
+
+static inline int ERR(int err)
+{
+	errno = err;
+	return -1;
+}
+
+int ucma_init();
+extern int af_ib_support;
+
+#define RAI_ROUTEONLY		0x01000000
+
+#ifdef USE_IB_ACM
+void ucma_ib_init();
+void ucma_ib_cleanup();
+void ucma_ib_resolve(struct rdma_addrinfo *rai, struct rdma_addrinfo *hints);
+#else
+#define ucma_ib_init()
+#define ucma_ib_cleanup()
+#define ucma_ib_resolve(x, y)
+#endif
+
+/* Define path record definition if using older version of libibverbs */
+#ifdef DEFINE_PATH_RECORD
+#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
+
+#endif /* CMA_H */
diff --git a/src/librdmacm.map b/src/librdmacm.map
index cb94efe..19b193a 100644
--- a/src/librdmacm.map
+++ b/src/librdmacm.map
@@ -28,5 +28,10 @@ RDMACM_1.0 {
 		rdma_get_local_addr;
 		rdma_get_peer_addr;
 		rdma_migrate_id;
+		rdma_getaddrinfo;
+		rdma_freeaddrinfo;
+		rdma_get_request;
+		rdma_create_ep;
+		rdma_destroy_ep;
 	local: *;
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/librdmacm.git



More information about the Pkg-ofed-commits mailing list