#This patch was developed both in-house and from outside. We plan to submit it
#upstream, but do not yet have a target date for doing so
#
# HG changeset patch
# Parent 714ac8a9d237c16e4c1d4c0d6b836fd6f2442b4f
libibverbs solaris specific changes
diff -r 714ac8a9d237 Makefile.am
--- a/Makefile.am Wed Oct 14 12:54:37 2015 -0700
+++ b/Makefile.am Mon Feb 01 09:10:21 2016 -0800
@@ -11,7 +11,7 @@
src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
- src/enum_strs.c
+ src/enum_strs.c src/solaris_compatibility.c
src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic \
$(libibverbs_version_script)
src_libibverbs_la_DEPENDENCIES = $(srcdir)/src/libibverbs.map
@@ -40,7 +40,7 @@
libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
- include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
+ include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h include/infiniband/ofa_solaris.h
man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1 \
man/ibv_rc_pingpong.1 man/ibv_uc_pingpong.1 man/ibv_ud_pingpong.1 \
@@ -67,6 +67,7 @@
EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
include/infiniband/opcode.h include/infiniband/verbs.h include/infiniband/marshall.h \
+ include/infiniband/ofa_solaris.h \
include/infiniband/sa-kern-abi.h include/infiniband/sa.h \
src/ibverbs.h examples/pingpong.h \
src/libibverbs.map libibverbs.spec.in $(man_MANS)
diff -r 714ac8a9d237 Makefile.in
--- a/Makefile.in Wed Oct 14 12:54:37 2015 -0700
+++ b/Makefile.in Mon Feb 01 09:10:21 2016 -0800
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -88,17 +98,6 @@
examples/ibv_srq_pingpong$(EXEEXT) \
examples/ibv_xsrq_pingpong$(EXEEXT)
subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in $(srcdir)/libibverbs.spec.in \
- $(top_srcdir)/config/depcomp $(libibverbsinclude_HEADERS) \
- AUTHORS COPYING ChangeLog README config/compile \
- config/config.guess config/config.sub config/depcomp \
- config/install-sh config/missing config/ltmain.sh \
- $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
- $(top_srcdir)/config/config.sub \
- $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
- $(top_srcdir)/config/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
$(top_srcdir)/config/ltoptions.m4 \
@@ -107,6 +106,9 @@
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(libibverbsinclude_HEADERS) \
+ $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -152,7 +154,8 @@
src/src_libibverbs_la-marshall.lo \
src/src_libibverbs_la-memory.lo src/src_libibverbs_la-sysfs.lo \
src/src_libibverbs_la-verbs.lo \
- src/src_libibverbs_la-enum_strs.lo
+ src/src_libibverbs_la-enum_strs.lo \
+ src/src_libibverbs_la-solaris_compatibility.lo
src_libibverbs_la_OBJECTS = $(am_src_libibverbs_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -288,6 +291,15 @@
CTAGS = ctags
CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/libibverbs.spec.in $(top_srcdir)/config/compile \
+ $(top_srcdir)/config/config.guess \
+ $(top_srcdir)/config/config.sub $(top_srcdir)/config/depcomp \
+ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
+ $(top_srcdir)/config/missing AUTHORS COPYING ChangeLog README \
+ config/compile config/config.guess config/config.sub \
+ config/depcomp config/install-sh config/ltmain.sh \
+ config/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -428,7 +440,7 @@
libibverbs_version_script = @LIBIBVERBS_VERSION_SCRIPT@
src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
- src/enum_strs.c
+ src/enum_strs.c src/solaris_compatibility.c
src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic \
$(libibverbs_version_script)
@@ -453,7 +465,7 @@
libibverbsincludedir = $(includedir)/infiniband
libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
- include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
+ include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h include/infiniband/ofa_solaris.h
man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1 \
man/ibv_rc_pingpong.1 man/ibv_uc_pingpong.1 man/ibv_ud_pingpong.1 \
@@ -480,6 +492,7 @@
EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
include/infiniband/opcode.h include/infiniband/verbs.h include/infiniband/marshall.h \
+ include/infiniband/ofa_solaris.h \
include/infiniband/sa-kern-abi.h include/infiniband/sa.h \
src/ibverbs.h examples/pingpong.h \
src/libibverbs.map libibverbs.spec.in $(man_MANS)
@@ -504,7 +517,6 @@
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -599,6 +611,8 @@
src/$(DEPDIR)/$(am__dirstamp)
src/src_libibverbs_la-enum_strs.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
+src/src_libibverbs_la-solaris_compatibility.lo: src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
src/libibverbs.la: $(src_libibverbs_la_OBJECTS) $(src_libibverbs_la_DEPENDENCIES) $(EXTRA_src_libibverbs_la_DEPENDENCIES) src/$(am__dirstamp)
$(AM_V_CCLD)$(src_libibverbs_la_LINK) -rpath $(libdir) $(src_libibverbs_la_OBJECTS) $(src_libibverbs_la_LIBADD) $(LIBS)
@@ -733,6 +747,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-init.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-marshall.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-memory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-solaris_compatibility.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-sysfs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libibverbs_la-verbs.Plo@am__quote@
@@ -823,6 +838,13 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -c -o src/src_libibverbs_la-enum_strs.lo `test -f 'src/enum_strs.c' || echo '$(srcdir)/'`src/enum_strs.c
+src/src_libibverbs_la-solaris_compatibility.lo: src/solaris_compatibility.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -MT src/src_libibverbs_la-solaris_compatibility.lo -MD -MP -MF src/$(DEPDIR)/src_libibverbs_la-solaris_compatibility.Tpo -c -o src/src_libibverbs_la-solaris_compatibility.lo `test -f 'src/solaris_compatibility.c' || echo '$(srcdir)/'`src/solaris_compatibility.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libibverbs_la-solaris_compatibility.Tpo src/$(DEPDIR)/src_libibverbs_la-solaris_compatibility.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/solaris_compatibility.c' object='src/src_libibverbs_la-solaris_compatibility.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -c -o src/src_libibverbs_la-solaris_compatibility.lo `test -f 'src/solaris_compatibility.c' || echo '$(srcdir)/'`src/solaris_compatibility.c
+
mostlyclean-libtool:
-rm -f *.lo
@@ -1059,15 +1081,15 @@
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -1103,17 +1125,17 @@
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1312,6 +1334,8 @@
uninstall-libibverbsincludeHEADERS uninstall-man \
uninstall-man1 uninstall-man3
+.PRECIOUS: Makefile
+
dist-hook: libibverbs.spec
cp libibverbs.spec $(distdir)
diff -r 714ac8a9d237 aclocal.m4
--- a/aclocal.m4 Wed Oct 14 12:54:37 2015 -0700
+++ b/aclocal.m4 Mon Feb 01 09:10:21 2016 -0800
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -103,15 +103,14 @@
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -142,7 +141,7 @@
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -333,7 +332,7 @@
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -409,7 +408,7 @@
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -499,8 +498,8 @@
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -574,6 +573,9 @@
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
@@ -603,7 +605,7 @@
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -614,7 +616,7 @@
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -624,7 +626,7 @@
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -645,7 +647,7 @@
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -695,7 +697,7 @@
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -734,7 +736,7 @@
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -763,7 +765,7 @@
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -810,7 +812,7 @@
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -829,7 +831,7 @@
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -910,7 +912,7 @@
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -970,7 +972,7 @@
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -998,7 +1000,7 @@
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1017,7 +1019,7 @@
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff -r 714ac8a9d237 configure
--- a/configure Wed Oct 14 12:54:37 2015 -0700
+++ b/configure Mon Feb 01 09:10:21 2016 -0800
@@ -2285,7 +2285,7 @@
ac_config_headers="$ac_config_headers config.h"
-am__api_version='1.14'
+am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
diff -r 714ac8a9d237 examples/device_list.c
--- a/examples/device_list.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/device_list.c Mon Feb 01 09:10:21 2016 -0800
@@ -36,16 +36,32 @@
#include <stdio.h>
+#if !(defined(__SVR4) && defined(__sun))
#include <endian.h>
#include <byteswap.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
#include <infiniband/verbs.h>
#include <infiniband/arch.h>
+/*
+ * Structure to hold the data printed by ibv_devices.
+ */
+typedef struct dev_print_s {
+ char name[24];
+ unsigned long long guid;
+ uint8_t is_pf;
+} dev_print_t;
+
int main(int argc, char *argv[])
{
struct ibv_device **dev_list;
int num_devices, i;
+ unsigned long long guid_external;
+ dev_print_t *dp;
+ int print_col = 0;
dev_list = ibv_get_device_list(&num_devices);
if (!dev_list) {
@@ -53,15 +69,45 @@
return 1;
}
- printf(" %-16s\t node GUID\n", "device");
- printf(" %-16s\t----------------\n", "------");
+ dp = (dev_print_t *)malloc(sizeof(dev_print_t) * num_devices);
- for (i = 0; i < num_devices; ++i) {
- printf(" %-16s\t%016llx\n",
- ibv_get_device_name(dev_list[i]),
- (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i])));
+ for (i = (num_devices - 1); i >= 0; --i) {
+ strcpy(dp[i].name, ibv_get_device_name(dev_list[i]));
+
+ dp[i].guid = (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i]));
+ guid_external = (unsigned long long) ntohll(ibv_get_device_guid_external(dev_list[i]));
+ if (dp[i].guid != guid_external) {
+ print_col = 1;
+ dp[i].is_pf = 0;
+ } else
+ dp[i].is_pf = 1;
}
+ if (print_col) {
+ printf(" %-16s\t node GUID\t type\n", "device");
+ printf(" %-16s\t----------------\t----\n", "------");
+ /* First print PFs */
+ for (i = (num_devices - 1); i >= 0; --i) {
+ if (dp[i].is_pf)
+ printf(" %-16s\t%016llx\t %s\n",
+ dp[i].name, dp[i].guid, "PF");
+ }
+ /* print VFs */
+ for (i = (num_devices - 1); i >= 0; --i) {
+ if (!dp[i].is_pf)
+ printf(" %-16s\t%016llx\t %s\n",
+ dp[i].name, dp[i].guid, "VF");
+ }
+ } else {
+ printf(" %-16s\t node GUID\n", "device");
+ printf(" %-16s\t----------------\n", "------");
+ for (i = (num_devices - 1); i >= 0; --i) {
+ printf(" %-16s\t%016llx\n",
+ dp[i].name, dp[i].guid);
+ }
+ }
+ free(dp);
+
ibv_free_device_list(dev_list);
return 0;
diff -r 714ac8a9d237 examples/devinfo.c
--- a/examples/devinfo.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/devinfo.c Mon Feb 01 09:10:21 2016 -0800
@@ -41,8 +41,10 @@
#include <string.h>
#include <getopt.h>
#include <netinet/in.h>
+#if !(defined(__SVR4) && defined(__sun))
#include <endian.h>
#include <byteswap.h>
+#endif
#include <infiniband/verbs.h>
#include <infiniband/driver.h>
diff -r 714ac8a9d237 examples/rc_pingpong.c
--- a/examples/rc_pingpong.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/rc_pingpong.c Mon Feb 01 09:10:21 2016 -0800
@@ -156,8 +156,13 @@
n = getaddrinfo(servername, service, &hints, &res);
- if (n < 0) {
- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
+ if (n != 0) {
+ if (n == EAI_NONAME)
+ fprintf(stderr,
+ "Name or service not known for %s:%d\n", servername, port);
+ else
+ fprintf(stderr,
+ "%s for %s:%d\n", gai_strerror(n), servername, port);
free(service);
return NULL;
}
@@ -233,7 +238,7 @@
n = getaddrinfo(NULL, service, &hints, &res);
- if (n < 0) {
+ if (n != 0) {
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
free(service);
return NULL;
diff -r 714ac8a9d237 examples/srq_pingpong.c
--- a/examples/srq_pingpong.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/srq_pingpong.c Mon Feb 01 09:10:21 2016 -0800
@@ -166,8 +166,13 @@
n = getaddrinfo(servername, service, &hints, &res);
- if (n < 0) {
- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
+ if (n != 0) {
+ if (n == EAI_NONAME)
+ fprintf(stderr,
+ "Name or service not known for %s:%d\n", servername, port);
+ else
+ fprintf(stderr,
+ "%s for %s:%d\n", gai_strerror(n), servername, port);
free(service);
return NULL;
}
@@ -255,7 +260,7 @@
n = getaddrinfo(NULL, service, &hints, &res);
- if (n < 0) {
+ if (n != 0) {
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
free(service);
return NULL;
diff -r 714ac8a9d237 examples/uc_pingpong.c
--- a/examples/uc_pingpong.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/uc_pingpong.c Mon Feb 01 09:10:21 2016 -0800
@@ -144,7 +144,7 @@
n = getaddrinfo(servername, service, &hints, &res);
- if (n < 0) {
+ if (n != 0) {
fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
free(service);
return NULL;
@@ -221,7 +221,7 @@
n = getaddrinfo(NULL, service, &hints, &res);
- if (n < 0) {
+ if (n != 0) {
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
free(service);
return NULL;
diff -r 714ac8a9d237 examples/ud_pingpong.c
--- a/examples/ud_pingpong.c Wed Oct 14 12:54:37 2015 -0700
+++ b/examples/ud_pingpong.c Mon Feb 01 09:10:21 2016 -0800
@@ -144,8 +144,13 @@
n = getaddrinfo(servername, service, &hints, &res);
- if (n < 0) {
- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
+ if (n != 0) {
+ if (n == EAI_NONAME)
+ fprintf(stderr,
+ "Name or service not known for %s:%d\n", servername, port);
+ else
+ fprintf(stderr,
+ "%s for %s:%d\n", gai_strerror(n), servername, port);
free(service);
return NULL;
}
@@ -220,7 +225,7 @@
n = getaddrinfo(NULL, service, &hints, &res);
- if (n < 0) {
+ if (n != 0) {
fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
free(service);
return NULL;
diff -r 714ac8a9d237 include/infiniband/arch.h
--- a/include/infiniband/arch.h Wed Oct 14 12:54:37 2015 -0700
+++ b/include/infiniband/arch.h Mon Feb 01 09:10:21 2016 -0800
@@ -34,6 +34,7 @@
#define INFINIBAND_ARCH_H
#include <stdint.h>
+#if !(defined(__SVR4) && defined(__sun))
#include <endian.h>
#include <byteswap.h>
@@ -46,6 +47,9 @@
#else
#error __BYTE_ORDER is neither __LITTLE_ENDIAN nor __BIG_ENDIAN
#endif
+#else
+#include <infiniband/ofa_solaris.h>
+#endif
/*
* Architecture-specific defines. Currently, an architecture is
diff -r 714ac8a9d237 include/infiniband/driver.h
--- a/include/infiniband/driver.h Wed Oct 14 12:54:37 2015 -0700
+++ b/include/infiniband/driver.h Mon Feb 01 09:10:21 2016 -0800
@@ -190,6 +190,10 @@
struct ibv_recv_wr **bad_wr);
int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,
struct ibv_ah_attr *attr);
+int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah,
+ struct ibv_ah_attr *attr,
+ struct ibv_create_ah *cmd, size_t cmd_size,
+ struct ibv_create_ah_resp *resp, size_t resp_size);
int ibv_cmd_destroy_ah(struct ibv_ah *ah);
int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
diff -r 714ac8a9d237 include/infiniband/kern-abi.h
--- a/include/infiniband/kern-abi.h Wed Oct 14 12:54:37 2015 -0700
+++ b/include/infiniband/kern-abi.h Mon Feb 01 09:10:21 2016 -0800
@@ -35,7 +35,11 @@
#ifndef KERN_ABI_H
#define KERN_ABI_H
+#if !(defined(__SVR4) && defined(__sun))
#include <linux/types.h>
+#else
+#include <infiniband/ofa_solaris.h>
+#endif
/*
* This file must be kept in sync with the kernel's version of
@@ -199,6 +203,7 @@
struct ibv_query_device_resp {
__u64 fw_ver;
__u64 node_guid;
+ __u64 node_guid_external;
__u64 sys_image_guid;
__u64 max_mr_size;
__u64 page_size_cap;
@@ -279,11 +284,13 @@
__u16 in_words;
__u16 out_words;
__u64 response;
+ __u64 user_handle;
__u64 driver_data[0];
};
struct ibv_alloc_pd_resp {
__u32 pd_handle;
+ __u32 reserved;
};
struct ibv_dealloc_pd {
@@ -291,6 +298,8 @@
__u16 in_words;
__u16 out_words;
__u32 pd_handle;
+ __u32 reserved;
+ __u64 user_handle;
};
struct ibv_open_xrcd {
@@ -324,6 +333,7 @@
__u64 hca_va;
__u32 pd_handle;
__u32 access_flags;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -331,6 +341,7 @@
__u32 mr_handle;
__u32 lkey;
__u32 rkey;
+ __u32 reserved;
};
struct ibv_dereg_mr {
@@ -338,6 +349,8 @@
__u16 in_words;
__u16 out_words;
__u32 mr_handle;
+ __u32 reserved;
+ __u64 user_handle;
};
struct ibv_create_comp_channel {
@@ -349,6 +362,7 @@
struct ibv_create_comp_channel_resp {
__u32 fd;
+ __u32 reserved;
};
struct ibv_create_cq {
@@ -394,6 +408,7 @@
__u64 response;
__u32 cq_handle;
__u32 ne;
+ __u64 user_handle;
};
struct ibv_poll_cq_resp {
@@ -408,6 +423,7 @@
__u16 out_words;
__u32 cq_handle;
__u32 solicited;
+ __u64 user_handle;
};
struct ibv_resize_cq {
@@ -417,6 +433,7 @@
__u64 response;
__u32 cq_handle;
__u32 cqe;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -433,6 +450,7 @@
__u64 response;
__u32 cq_handle;
__u32 reserved;
+ __u64 user_handle;
};
struct ibv_destroy_cq_resp {
@@ -567,6 +585,7 @@
__u64 response;
__u32 qp_handle;
__u32 attr_mask;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -634,6 +653,7 @@
__u8 alt_port_num;
__u8 alt_timeout;
__u8 reserved[2];
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -644,10 +664,12 @@
__u64 response;
__u32 qp_handle;
__u32 reserved;
+ __u64 user_handle;
};
struct ibv_destroy_qp_resp {
__u32 events_reported;
+ __u32 reserved;
};
struct ibv_kern_send_wr {
@@ -767,6 +789,7 @@
struct ibv_post_send_resp {
__u32 bad_wr;
+ __u32 reserved;
};
struct ibv_kern_recv_wr {
@@ -789,6 +812,7 @@
struct ibv_post_recv_resp {
__u32 bad_wr;
+ __u32 reserved;
};
struct ibv_post_srq_recv {
@@ -805,6 +829,7 @@
struct ibv_post_srq_recv_resp {
__u32 bad_wr;
+ __u32 reserved;
};
struct ibv_create_ah {
@@ -820,6 +845,7 @@
struct ibv_create_ah_resp {
__u32 handle;
+ __u32 reserved;
};
struct ibv_destroy_ah {
@@ -827,6 +853,8 @@
__u16 in_words;
__u16 out_words;
__u32 ah_handle;
+ __u32 reserved;
+ __u64 user_handle;
};
struct ibv_attach_mcast {
@@ -837,6 +865,7 @@
__u32 qp_handle;
__u16 mlid;
__u16 reserved;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -866,6 +895,7 @@
__u32 qp_handle;
__u16 mlid;
__u16 reserved;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -914,6 +944,7 @@
__u32 attr_mask;
__u32 max_wr;
__u32 srq_limit;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -924,6 +955,7 @@
__u64 response;
__u32 srq_handle;
__u32 reserved;
+ __u64 user_handle;
__u64 driver_data[0];
};
@@ -941,10 +973,12 @@
__u64 response;
__u32 srq_handle;
__u32 reserved;
+ __u64 user_handle;
};
struct ibv_destroy_srq_resp {
__u32 events_reported;
+ __u32 reserved;
};
/*
diff -r 714ac8a9d237 include/infiniband/sa-kern-abi.h
--- a/include/infiniband/sa-kern-abi.h Wed Oct 14 12:54:37 2015 -0700
+++ b/include/infiniband/sa-kern-abi.h Mon Feb 01 09:10:21 2016 -0800
@@ -33,7 +33,11 @@
#ifndef INFINIBAND_SA_KERN_ABI_H
#define INFINIBAND_SA_KERN_ABI_H
+#if !(defined(__SVR4) && defined(__sun))
#include <linux/types.h>
+#else
+#include <infiniband/ofa_solaris.h>
+#endif
/*
* Obsolete, deprecated names. Will be removed in libibverbs 1.1.
diff -r 714ac8a9d237 include/infiniband/verbs.h
--- a/include/infiniband/verbs.h Wed Oct 14 12:54:37 2015 -0700
+++ b/include/infiniband/verbs.h Mon Feb 01 09:10:21 2016 -0800
@@ -40,6 +40,9 @@
#include <pthread.h>
#include <stddef.h>
#include <errno.h>
+#if defined(__SVR4) && defined(__sun)
+#include <infiniband/ofa_solaris.h>
+#endif
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
@@ -128,6 +131,7 @@
struct ibv_device_attr {
char fw_ver[64];
uint64_t node_guid;
+ uint64_t node_guid_external;
uint64_t sys_image_guid;
uint64_t max_mr_size;
uint64_t page_size_cap;
@@ -498,6 +502,14 @@
uint32_t max_inline_data;
};
+#if defined(__SVR4) && defined(__sun)
+/*
+ * The 31st bit of sq_sig_all is set for QPs allocated
+ * using librdmacm. Consumers use sq_sig_all 0 /1.
+ */
+#define LIB_RDMACM_QP_BIT 0x8000
+#endif
+
struct ibv_qp_init_attr {
void *qp_context;
struct ibv_cq *send_cq;
@@ -859,6 +871,7 @@
char dev_path[IBV_SYSFS_PATH_MAX];
/* Path to infiniband class device in sysfs */
char ibdev_path[IBV_SYSFS_PATH_MAX];
+ uint blueflame_enabled;
};
struct verbs_device {
@@ -934,6 +947,13 @@
struct ibv_device *device;
struct ibv_context_ops ops;
int cmd_fd;
+#if defined(__SVR4) && defined(__sun)
+ /*
+ * Solaris user libraries use this FD for mmap operations. It is an
+ * open to the underlying kernel hardware specific driver.
+ */
+ int mmap_fd;
+#endif
int async_fd;
int num_comp_vectors;
pthread_mutex_t mutex;
@@ -1028,6 +1048,11 @@
uint64_t ibv_get_device_guid(struct ibv_device *device);
/**
+ * ibv_get_device_guid_external - Return device's node external GUID
+ */
+uint64_t ibv_get_device_guid_external(struct ibv_device *device);
+
+/**
* ibv_open_device - Initialize device for use
*/
struct ibv_context *ibv_open_device(struct ibv_device *device);
diff -r 714ac8a9d237 man/ibv_devices.1
--- a/man/ibv_devices.1 Wed Oct 14 12:54:37 2015 -0700
+++ b/man/ibv_devices.1 Mon Feb 01 09:10:21 2016 -0800
@@ -10,6 +10,35 @@
.PP
List RDMA devices available for use from userspace.
+On SR-IOV capable systems, if a domain is configured with
+VFs (Virtual Function), ibv_devices lists for each IB device
+the node GUID and the type (PF or VF). In this case, the PF
+devices are displayed before the VF devices. The following
+shows the results of running ibv_devices on a domain with
+one PF and two VFs:
+
+ device node GUID type
+ ------ ---------------- ----
+ mlx4_2 00212800013f3126 PF
+ mlx4_0 00212d00013f3126 VF
+ mlx4_1 00212900013f3126 VF
+
+If all of the IB devices are PFs, only node GUIDs are
+listed. The following shows the results of running
+ibv_devices on a domain with one PF and no VFs:
+
+ device node GUID
+ ------ ----------------
+ mlx4_0 00212800013f3126
+
+On systems which are not SR-IOV capable only node GUIDs are
+listed.
+
+ device node GUID
+ ------ ----------------
+ mlx4_0 0021280001a0e4d8
+ mlx4_1 0021280001a0e754
+
.SH SEE ALSO
.BR ibv_devinfo (1)
diff -r 714ac8a9d237 src/cmd.c
--- a/src/cmd.c Wed Oct 14 12:54:37 2015 -0700
+++ b/src/cmd.c Mon Feb 01 09:10:21 2016 -0800
@@ -42,24 +42,81 @@
#include <errno.h>
#include <alloca.h>
#include <string.h>
+#if defined(__SVR4) && defined(__sun)
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/mkdev.h>
+#endif
#include "ibverbs.h"
+#if defined(__SVR4) && defined(__sun)
+extern int ibv_open_mmap_driver(char *dev_name);
+
+/*
+ * Event file creation for GET_CONTEXT & CREATE_COMP_CHANNEL :
+ * Solaris Uverbs driver supports creation of event file
+ * from the open(2) system call only. Event file will not
+ * be created by the write(2) syscall, for the above commands
+ * as in Linux OFED.
+ *
+ * Sequence of operations for GET_CONTEXT & CREATE_COMP_CHANNEL :
+ * event_fd = open(UVERBS_EVENT_FILE, O_RDWR);
+ * fstat(event_fd, &fstat_buf);
+ * NOTE : Minor number of event file passed to driver
+ * cmd.resp.fd = minor(fstat_buf.st_rdev);
+ * write(verbs_fd);
+ * NOTE : Initialize the fd to one got by opening event file
+ * cmd.resp.fd = event_fd;
+ */
+#endif
int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmd,
size_t cmd_size, struct ibv_get_context_resp *resp,
size_t resp_size)
{
+#if defined(__SVR4) && defined(__sun)
+ int event_fd;
+ struct stat fstat_buf;
+#endif
if (abi_ver < IB_USER_VERBS_MIN_ABI_VERSION)
return ENOSYS;
IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
+#if defined(__SVR4) && defined(__sun)
+ event_fd = open("/dev/infiniband/ofs/uverbs:event", O_RDWR);
+ if (event_fd < 0)
+ return (errno);
+ if (fstat(event_fd, &fstat_buf))
+ return (errno);
+ resp->async_fd = minor(fstat_buf.st_rdev);
+ /*
+ * Open the underlying kernel hardware driver that will
+ * provide the mmap function for this context.
+ */
+ context->mmap_fd = ibv_open_mmap_driver(context->device->dev_name);
+ if (context->mmap_fd < 0) {
+ fprintf(stderr, PFX "ibv_cmd_get_context: Mmap open failed\n");
+ }
+#endif
if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
+#if defined(__SVR4) && defined(__sun)
+ resp->async_fd = event_fd;
+#endif
(void) VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
+#if defined(__SVR4) && defined(__sun)
+ /* We don't support parent-child sharing of IB resources on Solaris */
+ if (fcntl(resp->async_fd, F_SETFD, FD_CLOEXEC) < 0) {
+ fprintf(stderr, "ibv_get_context: FD_CLOEXEC failed: %s\n",
+ strerror(errno));
+ return errno;
+ }
+#endif
+
context->async_fd = resp->async_fd;
context->num_comp_vectors = resp->num_comp_vectors;
@@ -83,6 +140,7 @@
memset(device_attr->fw_ver, 0, sizeof device_attr->fw_ver);
*raw_fw_ver = resp.fw_ver;
device_attr->node_guid = resp.node_guid;
+ device_attr->node_guid_external = resp.node_guid_external;
device_attr->sys_image_guid = resp.sys_image_guid;
device_attr->max_mr_size = resp.max_mr_size;
device_attr->page_size_cap = resp.page_size_cap;
@@ -170,6 +228,8 @@
{
IBV_INIT_CMD_RESP(cmd, cmd_size, ALLOC_PD, resp, resp_size);
+ cmd->user_handle = (uintptr_t) pd;
+
if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
@@ -187,6 +247,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, DEALLOC_PD);
cmd.pd_handle = pd->handle;
+ cmd.user_handle = (uintptr_t) pd;
if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -252,6 +313,7 @@
cmd->length = length;
cmd->hca_va = hca_va;
cmd->pd_handle = pd->handle;
+ cmd->user_handle = (uintptr_t) mr;
cmd->access_flags = access;
if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
@@ -273,6 +335,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, DEREG_MR);
cmd.mr_handle = mr->handle;
+ cmd.user_handle = (uintptr_t) mr;
if (write(mr->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -290,7 +353,19 @@
cmd->user_handle = (uintptr_t) cq;
cmd->cqe = cqe;
cmd->comp_vector = comp_vector;
+#if defined(__SVR4) && defined(__sun)
+ if (channel) {
+ struct stat fstat_buf;
+
+ if (fstat(channel->fd, &fstat_buf))
+ return (errno);
+ else
+ cmd->comp_channel = minor(fstat_buf.st_rdev);
+ } else
+ cmd->comp_channel = 0;
+#else
cmd->comp_channel = channel ? channel->fd : -1;
+#endif
cmd->reserved = 0;
if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
@@ -321,6 +396,7 @@
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, POLL_CQ, resp, rsize);
cmd.cq_handle = ibcq->handle;
cmd.ne = ne;
+ cmd.user_handle = (uintptr_t) ibcq;
if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
ret = -1;
@@ -359,6 +435,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, REQ_NOTIFY_CQ);
cmd.cq_handle = ibcq->handle;
cmd.solicited = !!solicited_only;
+ cmd.user_handle = (uintptr_t) ibcq;
if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -373,6 +450,7 @@
IBV_INIT_CMD_RESP(cmd, cmd_size, RESIZE_CQ, resp, resp_size);
cmd->cq_handle = cq->handle;
cmd->cqe = cqe;
+ cmd->user_handle = (uintptr_t) cq;
if (write(cq->context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
@@ -392,6 +470,7 @@
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_CQ, &resp, sizeof resp);
cmd.cq_handle = cq->handle;
cmd.reserved = 0;
+ cmd.user_handle = (uintptr_t) cq;
if (write(cq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -516,7 +595,6 @@
return 0;
}
-
static int ibv_cmd_modify_srq_v3(struct ibv_srq *srq,
struct ibv_srq_attr *srq_attr,
int srq_attr_mask,
@@ -560,6 +638,7 @@
cmd->attr_mask = srq_attr_mask;
cmd->max_wr = srq_attr->max_wr;
cmd->srq_limit = srq_attr->srq_limit;
+ cmd->user_handle = (uintptr_t) srq;
if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
@@ -574,6 +653,7 @@
IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_SRQ, &resp, sizeof resp);
cmd->srq_handle = srq->handle;
+ cmd->user_handle = (uintptr_t) srq;
cmd->reserved = 0;
if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
@@ -595,6 +675,7 @@
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_SRQ, &resp, sizeof resp);
cmd.srq_handle = srq->handle;
+ cmd.user_handle = (uintptr_t) srq;
cmd.reserved = 0;
if (write(srq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
@@ -646,7 +727,18 @@
cmd->max_send_sge = attr_ex->cap.max_send_sge;
cmd->max_recv_sge = attr_ex->cap.max_recv_sge;
cmd->max_inline_data = attr_ex->cap.max_inline_data;
+#if defined(__SVR4) && defined(__sun)
+ if (attr_ex->sq_sig_all & LIB_RDMACM_QP_BIT) {
+ cmd->sq_sig_all =
+ (uint8_t)(attr_ex->sq_sig_all & ~LIB_RDMACM_QP_BIT);
+ cmd->sq_sig_all |= 0x80;
+ attr_ex->sq_sig_all &= ~LIB_RDMACM_QP_BIT;
+ } else {
+ cmd->sq_sig_all = (uint8_t)attr_ex->sq_sig_all;
+ }
+#else
cmd->sq_sig_all = attr_ex->sq_sig_all;
+#endif
cmd->qp_type = attr_ex->qp_type;
cmd->is_srq = !!attr_ex->srq;
cmd->reserved = 0;
@@ -721,7 +813,20 @@
cmd->max_send_sge = attr->cap.max_send_sge;
cmd->max_recv_sge = attr->cap.max_recv_sge;
cmd->max_inline_data = attr->cap.max_inline_data;
+
+#if defined(__SVR4) && defined(__sun)
+ if (attr->sq_sig_all & LIB_RDMACM_QP_BIT) {
+ cmd->sq_sig_all =
+ (uint8_t)(attr->sq_sig_all & ~LIB_RDMACM_QP_BIT);
+ cmd->sq_sig_all |= 0x80;
+ attr->sq_sig_all &= ~LIB_RDMACM_QP_BIT;
+ } else {
+ cmd->sq_sig_all = (uint8_t)attr->sq_sig_all;
+ }
+#else
cmd->sq_sig_all = attr->sq_sig_all;
+#endif
+
cmd->qp_type = attr->qp_type;
cmd->is_srq = !!attr->srq;
cmd->reserved = 0;
@@ -822,6 +927,7 @@
IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_QP, &resp, sizeof resp);
cmd->qp_handle = qp->handle;
cmd->attr_mask = attr_mask;
+ cmd->user_handle = (uintptr_t) qp;
if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
@@ -901,6 +1007,7 @@
IBV_INIT_CMD(cmd, cmd_size, MODIFY_QP);
cmd->qp_handle = qp->handle;
+ cmd->user_handle = (uintptr_t) qp;
cmd->attr_mask = attr_mask;
cmd->qkey = attr->qkey;
cmd->rq_psn = attr->rq_psn;
@@ -1170,36 +1277,45 @@
return ret;
}
+int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_attr *attr,
+ struct ibv_create_ah *cmd, size_t cmd_size,
+ struct ibv_create_ah_resp *resp, size_t resp_size)
+{
+ IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_AH, resp, resp_size);
+ cmd->user_handle = (uintptr_t) ah;
+ cmd->pd_handle = pd->handle;
+ cmd->reserved = 0;
+ cmd->attr.dlid = attr->dlid;
+ cmd->attr.sl = attr->sl;
+ cmd->attr.src_path_bits = attr->src_path_bits;
+ cmd->attr.static_rate = attr->static_rate;
+ cmd->attr.is_global = attr->is_global;
+ cmd->attr.port_num = attr->port_num;
+ cmd->attr.grh.flow_label = attr->grh.flow_label;
+ cmd->attr.grh.sgid_index = attr->grh.sgid_index;
+ cmd->attr.grh.hop_limit = attr->grh.hop_limit;
+ cmd->attr.grh.traffic_class = attr->grh.traffic_class;
+ cmd->attr.grh.reserved = 0;
+ cmd->attr.reserved = 0;
+ memcpy(cmd->attr.grh.dgid, attr->grh.dgid.raw, 16);
+
+ if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
+ return errno;
+
+ (void) VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
+
+ ah->handle = resp->handle;
+ ah->context = pd->context;
+
+ return 0;
+}
+
int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,
struct ibv_ah_attr *attr)
{
struct ibv_create_ah cmd;
struct ibv_create_ah_resp resp;
-
- IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_AH, &resp, sizeof resp);
- cmd.user_handle = (uintptr_t) ah;
- cmd.pd_handle = pd->handle;
- cmd.attr.dlid = attr->dlid;
- cmd.attr.sl = attr->sl;
- cmd.attr.src_path_bits = attr->src_path_bits;
- cmd.attr.static_rate = attr->static_rate;
- cmd.attr.is_global = attr->is_global;
- cmd.attr.port_num = attr->port_num;
- cmd.attr.grh.flow_label = attr->grh.flow_label;
- cmd.attr.grh.sgid_index = attr->grh.sgid_index;
- cmd.attr.grh.hop_limit = attr->grh.hop_limit;
- cmd.attr.grh.traffic_class = attr->grh.traffic_class;
- memcpy(cmd.attr.grh.dgid, attr->grh.dgid.raw, 16);
-
- if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
- return errno;
-
- (void) VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
-
- ah->handle = resp.handle;
- ah->context = pd->context;
-
- return 0;
+ return ibv_cmd_create_ah_ex(pd, ah, attr, &cmd, sizeof(cmd), &resp, sizeof(resp));
}
int ibv_cmd_destroy_ah(struct ibv_ah *ah)
@@ -1208,6 +1324,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, DESTROY_AH);
cmd.ah_handle = ah->handle;
+ cmd.user_handle = (uintptr_t) ah;
if (write(ah->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -1223,6 +1340,7 @@
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_QP, &resp, sizeof resp);
cmd.qp_handle = qp->handle;
cmd.reserved = 0;
+ cmd.user_handle = (uintptr_t) qp;
if (write(qp->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
@@ -1244,6 +1362,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, ATTACH_MCAST);
memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
cmd.qp_handle = qp->handle;
+ cmd.user_handle = (uintptr_t) qp;
cmd.mlid = lid;
cmd.reserved = 0;
@@ -1260,6 +1379,7 @@
IBV_INIT_CMD(&cmd, sizeof cmd, DETACH_MCAST);
memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
cmd.qp_handle = qp->handle;
+ cmd.user_handle = (uintptr_t) qp;
cmd.mlid = lid;
cmd.reserved = 0;
diff -r 714ac8a9d237 src/device.c
--- a/src/device.c Wed Oct 14 12:54:37 2015 -0700
+++ b/src/device.c Mon Feb 01 09:10:21 2016 -0800
@@ -122,6 +122,28 @@
}
default_symver(__ibv_get_device_guid, ibv_get_device_guid);
+uint64_t __ibv_get_device_guid_external(struct ibv_device *device)
+{
+ char attr[24];
+ uint64_t guid = 0;
+ uint16_t parts[4];
+ int i;
+
+ if (ibv_read_sysfs_file(device->ibdev_path, "node_guid_external",
+ attr, sizeof attr) < 0)
+ return 0;
+
+ if (sscanf(attr, "%hx:%hx:%hx:%hx",
+ parts, parts + 1, parts + 2, parts + 3) != 4)
+ return 0;
+
+ for (i = 0; i < 4; ++i)
+ guid = (guid << 16) | parts[i];
+
+ return htonll(guid);
+}
+default_symver(__ibv_get_device_guid_external, ibv_get_device_guid_external);
+
struct ibv_context *__ibv_open_device(struct ibv_device *device)
{
struct verbs_device *verbs_device = verbs_get_device(device);
@@ -130,8 +152,13 @@
struct ibv_context *context;
struct verbs_context *context_ex;
+#if !(defined(__SVR4) && defined(__sun))
if (asprintf(&devpath, "/dev/infiniband/%s", device->dev_name) < 0)
return NULL;
+#else
+ if (asprintf(&devpath, "/dev/infiniband/ofs/%s", device->dev_name) < 0)
+ return NULL;
+#endif
/*
* We'll only be doing writes, but we need O_RDWR in case the
@@ -143,6 +170,14 @@
if (cmd_fd < 0)
return NULL;
+#if defined(__SVR4) && defined(__sun)
+ /* We don't support parent-child sharing of IB resources on Solaris */
+ if (fcntl(cmd_fd, F_SETFD, FD_CLOEXEC) < 0) {
+ fprintf(stderr, "ibv_open_device: FD_CLOEXEC failed: %s\n",
+ strerror(errno));
+ goto err;
+ }
+#endif
if (!verbs_device) {
context = device->ops.alloc_context(device, cmd_fd);
if (!context)
@@ -195,6 +230,9 @@
int cmd_fd = context->cmd_fd;
int cq_fd = -1;
struct verbs_context *context_ex;
+#if defined(__SVR4) && defined(__sun)
+ int mmap_fd = context->mmap_fd;
+#endif
context_ex = verbs_get_ctx(context);
if (context_ex) {
@@ -205,6 +243,11 @@
context->device->ops.free_context(context);
}
+#if defined(__SVR4) && defined(__sun)
+ if (mmap_fd > 0) {
+ close(mmap_fd);
+ }
+#endif
close(async_fd);
close(cmd_fd);
if (abi_ver <= 2)
diff -r 714ac8a9d237 src/ibverbs.h
--- a/src/ibverbs.h Wed Oct 14 12:54:37 2015 -0700
+++ b/src/ibverbs.h Mon Feb 01 09:10:21 2016 -0800
@@ -52,7 +52,12 @@
# define VALGRIND_MAKE_MEM_DEFINED(addr, len) 0
#endif
-#define HIDDEN __attribute__((visibility ("hidden")))
+#if defined(__SVR4) && defined(__sun)
+#define HIDDEN
+#undef HAVE_SYMVER_SUPPORT
+#else
+#define HIDDEN __attribute__((visibility ("hidden")))
+#endif
#define INIT __attribute__((constructor))
#define FINI __attribute__((destructor))
diff -r 714ac8a9d237 src/init.c
--- a/src/init.c Wed Oct 14 12:54:37 2015 -0700
+++ b/src/init.c Mon Feb 01 09:10:21 2016 -0800
@@ -78,8 +78,13 @@
static struct ibv_driver_name *driver_name_list;
static struct ibv_driver *head_driver, *tail_driver;
+static uint blueflame_enabled = 0;
+
static int find_sysfs_devs(void)
{
+#if defined(__SVR4) && defined(__sun)
+ char device_path[IBV_SYSFS_PATH_MAX];
+#endif
char class_path[IBV_SYSFS_PATH_MAX];
DIR *class_dir;
struct dirent *dent;
@@ -87,19 +92,35 @@
char value[8];
int ret = 0;
+#if defined(__SVR4) && defined(__sun)
+ snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
+#endif
snprintf(class_path, sizeof class_path, "%s/class/infiniband_verbs",
ibv_get_sysfs_path());
+#if defined(__SVR4) && defined(__sun)
+ class_dir = opendir(device_path);
+#else
class_dir = opendir(class_path);
+#endif
if (!class_dir)
return ENOSYS;
while ((dent = readdir(class_dir))) {
+#if defined(__SVR4) && defined(__sun)
+ int adapter_num;
+#else
struct stat buf;
+#endif
if (dent->d_name[0] == '.')
continue;
+#if defined(__SVR4) && defined(__sun)
+ if (sscanf(dent->d_name, "uverbs%d",
+ &adapter_num) != 1)
+ continue;
+#endif
if (!sysfs_dev)
sysfs_dev = malloc(sizeof *sysfs_dev);
if (!sysfs_dev) {
@@ -110,6 +131,7 @@
snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
"%s/%s", class_path, dent->d_name);
+#if !(defined(__SVR4) && defined(__sun))
if (stat(sysfs_dev->sysfs_path, &buf)) {
fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
sysfs_dev->sysfs_path);
@@ -118,6 +140,7 @@
if (!S_ISDIR(buf.st_mode))
continue;
+#endif
snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
"%s", dent->d_name);
@@ -296,6 +319,13 @@
driver_name->next = driver_name_list;
driver_name_list = driver_name;
+ } else if (strcmp(field, "blueflame") == 0) {
+ config += strspn(config, "\t ");
+ field = strsep(&config, "\n\t ");
+ if (strcmp(field, "enable") == 0)
+ blueflame_enabled = 1;
+ if (strcmp(field, "disable") == 0)
+ blueflame_enabled = 0;
} else
fprintf(stderr, PFX "Warning: ignoring bad config directive "
"'%s' in file '%s'.\n", field, path);
@@ -401,6 +431,7 @@
strcpy(dev->dev_path, sysfs_dev->sysfs_path);
strcpy(dev->name, sysfs_dev->ibdev_name);
strcpy(dev->ibdev_path, sysfs_dev->ibdev_path);
+ dev->blueflame_enabled = blueflame_enabled;
return dev;
}
@@ -443,6 +474,7 @@
static void check_memlock_limit(void)
{
+#if !(defined(__SVR4) && defined(__sun))
struct rlimit rlim;
if (!geteuid())
@@ -457,6 +489,7 @@
fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
" This will severely limit memory registrations.\n",
rlim.rlim_cur);
+#endif
}
static void add_device(struct ibv_device *dev,
diff -r 714ac8a9d237 src/libibverbs.map
--- a/src/libibverbs.map Wed Oct 14 12:54:37 2015 -0700
+++ b/src/libibverbs.map Mon Feb 01 09:10:21 2016 -0800
@@ -73,6 +73,7 @@
mult_to_ibv_rate;
ibv_get_sysfs_path;
ibv_read_sysfs_file;
+ sol_get_cpu_info;
local: *;
};
diff -r 714ac8a9d237 src/sysfs.c
--- a/src/sysfs.c Wed Oct 14 12:54:37 2015 -0700
+++ b/src/sysfs.c Mon Feb 01 09:10:21 2016 -0800
@@ -44,6 +44,10 @@
#include "ibverbs.h"
+#if defined(__SVR4) && defined(__sun)
+int sol_read_sysfs_file(char *path, char *buf, size_t size);
+#endif
+
static char *sysfs_path;
const char *ibv_get_sysfs_path(void)
@@ -79,12 +83,18 @@
char *buf, size_t size)
{
char *path;
+#if !(defined(__SVR4) && defined(__sun))
int fd;
+#endif
int len;
if (asprintf(&path, "%s/%s", dir, file) < 0)
return -1;
+#if defined(__SVR4) && defined(__sun)
+ len = sol_read_sysfs_file(path, buf, size);
+ free(path);
+#else
fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
free(path);
@@ -98,6 +108,7 @@
if (len > 0 && buf[len - 1] == '\n')
buf[--len] = '\0';
+#endif
return len;
}
diff -r 714ac8a9d237 src/verbs.c
--- a/src/verbs.c Wed Oct 14 12:54:37 2015 -0700
+++ b/src/verbs.c Mon Feb 01 09:10:21 2016 -0800
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#if defined(__SVR4) && defined(__sun)
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/mkdev.h>
+#endif
#include "ibverbs.h"
@@ -141,6 +146,12 @@
int __ibv_query_gid(struct ibv_context *context, uint8_t port_num,
int index, union ibv_gid *gid)
{
+#if defined(__SVR4) && defined(__sun)
+ extern int sol_ibv_query_gid();
+
+ return sol_ibv_query_gid(context, port_num, index, gid);
+
+#else
char name[24];
char attr[41];
uint16_t val;
@@ -160,12 +171,19 @@
}
return 0;
+#endif
}
default_symver(__ibv_query_gid, ibv_query_gid);
int __ibv_query_pkey(struct ibv_context *context, uint8_t port_num,
int index, uint16_t *pkey)
{
+#if defined(__SVR4) && defined(__sun)
+ extern int sol_ibv_query_pkey();
+
+ return sol_ibv_query_pkey(context, port_num, index, pkey);
+
+#else
char name[24];
char attr[8];
uint16_t val;
@@ -181,6 +199,7 @@
*pkey = htons(val);
return 0;
+#endif
}
default_symver(__ibv_query_pkey, ibv_query_pkey);
@@ -260,6 +279,10 @@
struct ibv_comp_channel *channel;
struct ibv_create_comp_channel cmd;
struct ibv_create_comp_channel_resp resp;
+#if defined(__SVR4) && defined(__sun)
+ int event_fd;
+ struct stat fstat_buf;
+#endif
if (abi_ver <= 2)
return ibv_create_comp_channel_v2(context);
@@ -269,13 +292,32 @@
return NULL;
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_COMP_CHANNEL, &resp, sizeof resp);
+#if defined(__SVR4) && defined(__sun)
+ event_fd = open("/dev/infiniband/ofs/uverbs:event", O_RDWR);
+ if (event_fd < 0) {
+ free(channel);
+ return NULL;
+ }
+
+ if (fstat(event_fd, &fstat_buf)) {
+ free(channel);
+ return NULL;
+ }
+ resp.fd = minor(fstat_buf.st_rdev);
+#endif
if (write(context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
+#if defined(__SVR4) && defined(__sun)
+ close(event_fd);
+#endif
free(channel);
return NULL;
}
(void) VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
+#if defined(__SVR4) && defined(__sun)
+ resp.fd = event_fd;
+#endif
channel->context = context;
channel->fd = resp.fd;
channel->refcnt = 0;