]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
import
authorSean Hefty <sean.hefty@intel.com>
Tue, 16 Jul 2013 23:02:08 +0000 (16:02 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 16 Jul 2013 23:02:08 +0000 (16:02 -0700)
meta
patches/librdmacm-1-8-add-foreign-opti [new file with mode: 0644]
patches/librdmacm-2-8-makefile-am-fix- [new file with mode: 0644]
patches/librdmacm-3-8-autogen-sh-use-a [new file with mode: 0644]
patches/librdmacm-4-8-configure-apply- [new file with mode: 0644]
patches/librdmacm-5-8-configure-use-au [new file with mode: 0644]
patches/librdmacm-6-8-add-gitignore-ru [new file with mode: 0644]
patches/librdmacm-8-8-open-files-with- [new file with mode: 0644]

diff --git a/meta b/meta
index 2b5a8ed8d005ae28cae2f42967c698d405cfa898..273fda2971edfca82796c3bce25e9a519b9706d1 100644 (file)
--- a/meta
+++ b/meta
@@ -1,9 +1,16 @@
 Version: 1
-Previous: e833d86d4753328a9c6466b2037c0ff8424f34b6
-Head: 282058197859038e66b5bc42cccc12f6fb9bbd93
+Previous: 282b561defddcd4471bc0d93b6151e0b4ceee276
+Head: 1cde6c1b67cd2750ee47f01325271b4188c3d166
 Applied:
   ex-ib: d71ebf70cf74111cfd5f0982d9abe6ec68fb38e3
   use_acm: 282058197859038e66b5bc42cccc12f6fb9bbd93
+  librdmacm-1-8-add-foreign-opti: e046719a0d6c2b8a6c445ce3879f98b2a0265368
+  librdmacm-2-8-makefile-am-fix-: d5bb5d3050f2a8426ff85c8d4cff030a565274a7
+  librdmacm-3-8-autogen-sh-use-a: e9317c3a56eb88118e5d476b2aea4932584aae3a
+  librdmacm-4-8-configure-apply-: 3a99f90d4ffe1417981323838a33bf7d029582d2
+  librdmacm-5-8-configure-use-au: cb29a5fd3075b780716912ae995af9a678726d81
+  librdmacm-6-8-add-gitignore-ru: 93e279dea453d910a24bc132ae0cbf0ce3310c77
+  librdmacm-8-8-open-files-with-: 1cde6c1b67cd2750ee47f01325271b4188c3d166
 Unapplied:
   acm_msg: 2754edc839f94608e3116068fa7b13936e074d37
   ibpath: 372986c005605c497bebd250b2d8e2bfe9608315
diff --git a/patches/librdmacm-1-8-add-foreign-opti b/patches/librdmacm-1-8-add-foreign-opti
new file mode 100644 (file)
index 0000000..e6d602a
--- /dev/null
@@ -0,0 +1,32 @@
+Bottom: 08cdb9a8cfd429d8b0018d91813c88ace4431342
+Top:    5a36253721b69b3c3a21fd73d491dfb208d3ce20
+Author: Bart Van Assche <bvanassche@acm.org>
+Date:   2013-07-16 23:59:45 +0200
+
+[librdmacm,1/8] Add "foreign" option to AM_INIT_AUTOMAKE
+
+Switch to the modern form of the AM_INIT_AUTOMAKE macro and tell
+automake that the librdmacm package does not follow the GNU
+standards. This change makes it possible to use 'autoreconf' for the
+librdmacm package.
+
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/configure.ac b/configure.ac
+index 3ce7a6e..e2f3f69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([src/cma.c])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+ AC_CONFIG_HEADERS(config.h)
+-AM_INIT_AUTOMAKE(librdmacm, 1.0.17)
++AM_INIT_AUTOMAKE([foreign])
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ AM_PROG_LIBTOOL
diff --git a/patches/librdmacm-2-8-makefile-am-fix- b/patches/librdmacm-2-8-makefile-am-fix-
new file mode 100644 (file)
index 0000000..947a48f
--- /dev/null
@@ -0,0 +1,36 @@
+Bottom: 5a36253721b69b3c3a21fd73d491dfb208d3ce20
+Top:    163b2f7cf50d25c19bb7a3191c3455a16694208f
+Author: Bart Van Assche <bvanassche@acm.org>
+Date:   2013-07-16 23:59:46 +0200
+
+[librdmacm,2/8] Makefile.am: Fix an automake warning
+
+Fix the following automake warning message:
+
+    Makefile.am:1: `INCLUDES' is the old name for `AM_CPPFLAGS' (or `*_CPPFLAGS')
+
+A quote from the automake manual:
+
+    INCLUDES
+        This does the same job as AM_CPPFLAGS (or any per-target _CPPFLAGS variable
+        if it is used). It is an older name for the same functionality. This
+        variable is deprecated; we suggest using AM_CPPFLAGS and per-target
+        _CPPFLAGS instead.
+
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/Makefile.am b/Makefile.am
+index 3198165..e1be9f3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-INCLUDES = -I$(srcdir)/include
++AM_CPPFLAGS = -I$(srcdir)/include
+ rslibdir = $(libdir)/rsocket
+ lib_LTLIBRARIES = src/librdmacm.la
diff --git a/patches/librdmacm-3-8-autogen-sh-use-a b/patches/librdmacm-3-8-autogen-sh-use-a
new file mode 100644 (file)
index 0000000..d1217b5
--- /dev/null
@@ -0,0 +1,34 @@
+Bottom: 163b2f7cf50d25c19bb7a3191c3455a16694208f
+Top:    49392529800f64a7bbfa39709046349777c78c1f
+Author: Jeff Squyres <jsquyres@cisco.com>
+Date:   2013-07-16 23:59:47 +0200
+
+[librdmacm,3/8] autogen.sh: Use autoreconf in autogen.sh
+
+The old sequence of Autotools commands listed in autogen.sh is no
+longer correct.  Instead, just use the single "autoreconf" command,
+which will invoke all the Right Autotools commands in the correct
+order.
+
+Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/autogen.sh b/autogen.sh
+index f433312..6c9233e 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -1,9 +1,4 @@
+ #! /bin/sh
+ set -x
+-test -d ./config || mkdir ./config
+-aclocal -I config
+-libtoolize --force --copy
+-autoheader
+-automake --foreign --add-missing --copy
+-autoconf
++autoreconf -ifv -I config
diff --git a/patches/librdmacm-4-8-configure-apply- b/patches/librdmacm-4-8-configure-apply-
new file mode 100644 (file)
index 0000000..666c8ff
--- /dev/null
@@ -0,0 +1,56 @@
+Bottom: 49392529800f64a7bbfa39709046349777c78c1f
+Top:    fdd30dbbdc59d8b005e99a296f15d45163ffc810
+Author: Yann Droneaud <ydroneaud@opteya.com>
+Date:   2013-07-16 23:59:48 +0200
+
+[librdmacm,4/8] configure: Apply updates proposed by autoupdate
+
+'autoupdate' is a tool to help developer to update configure.ac.
+
+This patch applies a few fixes as suggested by autoupdate.
+
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/configure.ac b/configure.ac
+index e2f3f69..a85ce49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,18 +1,18 @@
+ dnl Process this file with autoconf to produce a configure script.
+-AC_PREREQ(2.57)
+-AC_INIT(librdmacm, 1.0.17, linux-rdma@vger.kernel.org)
++AC_PREREQ([2.63])
++AC_INIT([librdmacm],[1.0.17],[linux-rdma@vger.kernel.org])
+ AC_CONFIG_SRCDIR([src/cma.c])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+-AC_CONFIG_HEADERS(config.h)
++AC_CONFIG_HEADERS([config.h])
+ AM_INIT_AUTOMAKE([foreign])
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+-AM_PROG_LIBTOOL
++LT_INIT
+ AC_ARG_WITH([valgrind],
+-    AC_HELP_STRING([--with-valgrind],
++    AS_HELP_STRING([--with-valgrind],
+                  [Enable valgrind annotations - default NO]))
+ if test "$with_valgrind" != "" && test "$with_valgrind" != "no"; then
+@@ -50,8 +50,8 @@ AC_CHECK_MEMBER(struct ibv_path_record.service_id, [],
+ dnl Check for gcc atomic intrinsics
+ AC_MSG_CHECKING(compiler support for atomics)
+-AC_TRY_LINK([int i = 0;],
+-    [ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ],
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[int i = 0;]],
++                              [[ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ]])],
+     [ AC_MSG_RESULT(yes) ],
+     [
+         AC_MSG_RESULT(no)
diff --git a/patches/librdmacm-5-8-configure-use-au b/patches/librdmacm-5-8-configure-use-au
new file mode 100644 (file)
index 0000000..7ef5c9a
--- /dev/null
@@ -0,0 +1,35 @@
+Bottom: fdd30dbbdc59d8b005e99a296f15d45163ffc810
+Top:    75ed99f148ae5b99a29c244e6ffa4669a1043228
+Author: Yann Droneaud <ydroneaud@opteya.com>
+Date:   2013-07-16 23:59:49 +0200
+
+[librdmacm,5/8] configure: Use automake's option "subdir-objects"
+
+Following advice in "Autotool Mythbuster" [1], option subdir-objects
+can be used to have Makefiles create object files in the same
+directory than theirs source files.
+
+It reduces clobbering in the build directory.
+
+[1] "Autotool Mythbuster", by Diego Elio "Flameeyes" Petten`o
+http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html
+
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/configure.ac b/configure.ac
+index a85ce49..9fd9e9e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([src/cma.c])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign])
++AM_INIT_AUTOMAKE([foreign subdir-objects])
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ LT_INIT
diff --git a/patches/librdmacm-6-8-add-gitignore-ru b/patches/librdmacm-6-8-add-gitignore-ru
new file mode 100644 (file)
index 0000000..8a93a4e
--- /dev/null
@@ -0,0 +1,129 @@
+Bottom: 75ed99f148ae5b99a29c244e6ffa4669a1043228
+Top:    c9ebc6b5562a7d1133b72a28b9370623dd93ac65
+Author: Yann Droneaud <ydroneaud@opteya.com>
+Date:   2013-07-16 23:59:50 +0200
+
+[librdmacm,6/8] Add .gitignore rules
+
+Add the list of files/patterns to be exclueded from git status output.
+Additionally it will prevent such files/patterns to be added and committed.
+
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..cea1f71
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,64 @@
++# - see gitignore(5)
++#
++# http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
++# http://git-scm.com/docs/gitignore.html
++#
++# - ignore files in this current directory with a leading /
++# so that files with the same name is a subdirectory
++# would not be ignored by mistake.
++#
++# per directory .gitignore would be used to ignore specific
++# files/patterns
++#
++# - more examples can be found at
++#
++# https://github.com/github/gitignore
++# http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files
++#
++
++# global ignore rules:
++#
++# backup files
++#
++*~
++
++# local (eg. current directory) rules:
++#
++# /<pattern>
++
++#
++# files created by autoreconf (autoconf, automake, libtool)
++#
++
++/INSTALL
++/config.guess
++/config.sub
++/missing
++/depcomp
++/install-sh
++/configure
++/aclocal.m4
++/autom4te.cache/
++/config.h.in
++/Makefile.in
++/compile
++/config
++
++#
++# files created by autoscan
++#
++
++/autoscan.log
++/configure.scan
++
++#
++# files created by ./configure
++#
++
++/config.h
++/config.status
++/config.log
++/Makefile
++/stamp-h1
++/libtool
++/librdmacm.spec
+diff --git a/examples/.gitignore b/examples/.gitignore
+new file mode 100644
+index 0000000..ed17494
+--- /dev/null
++++ b/examples/.gitignore
+@@ -0,0 +1,22 @@
++# files produced by ./configure
++/.deps
++
++# files produced by make (libtool)
++/*.o
++/*.lo
++/*.la
++/.libs
++/.dirstamp
++
++/mckey
++/rcopy
++/rdma_client
++/rdma_server
++/rdma_xclient
++/rdma_xserver
++/riostream
++/rping
++/rstream
++/ucmatose
++/udaddy
++/udpong
+diff --git a/src/.gitignore b/src/.gitignore
+new file mode 100644
+index 0000000..139417a
+--- /dev/null
++++ b/src/.gitignore
+@@ -0,0 +1,9 @@
++# files produced by ./configure
++/.deps
++
++# files produced by make (libtool)
++/*.o
++/*.lo
++/*.la
++/.libs
++/.dirstamp
diff --git a/patches/librdmacm-8-8-open-files-with- b/patches/librdmacm-8-8-open-files-with-
new file mode 100644 (file)
index 0000000..e586fea
--- /dev/null
@@ -0,0 +1,107 @@
+Bottom: c9ebc6b5562a7d1133b72a28b9370623dd93ac65
+Top:    339f42f99074732d6646a2c98d4674ae2e4b0df3
+Author: Yann Droneaud <ydroneaud@opteya.com>
+Date:   2013-07-16 23:59:52 +0200
+
+[librdmacm,8/8] Open files with "close on exec" flag
+
+File opened by librdmacm are not supposed to be inherited across
+exec*(), most of the files are of no use for another program, and
+others cannot be used without the associated memory mapping.
+
+This patch changes fopen() open() and socket() to always set
+close on exec flag.
+
+This patch also add checks to configure to guess if fopen() supports
+"e" flag. If O_CLOEXEC and SOCK_CLOEXEC are supported, fopen() should
+support "e". If not supported, its discarded according to POSIX. Many
+operating systems have support for fopen("e").
+
+You might find more information about close on exec in the following articles:
+
+- "Excuse me son, but your code is leaking !!!" by Dan Walsh
+  http://danwalsh.livejournal.com/53603.html
+
+- "Secure File Descriptor Handling" by Ulrich Drepper
+  http://udrepper.livejournal.com/20407.html
+
+Note: this patch won't set close on exec flag on file descriptors
+created by the kernel for completion channel and such.
+This is addressed by another kernel patch.
+
+Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/configure.ac b/configure.ac
+index 9fd9e9e..6163f56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -75,6 +75,30 @@ AC_CHECK_HEADER(infiniband/acm.h,
+               AC_DEFINE(DEFINE_ACM_MSG, 1, [adding ACM message definition]),
+                       [#include <infiniband/acm.h>]), [])
++dnl Checks close on exec support
++AC_CHECK_HEADERS([fcntl.h sys/socket.h])
++
++AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
++[[
++#ifdef HAVE_FCNTL_H
++# include <fcntl.h>
++#endif
++]])
++AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
++[[
++#ifdef HAVE_SYS_SOCKET_H
++# include <sys/socket.h>
++#endif
++]])
++
++AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
++   [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
++        if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
++            ac_cv_feature_stream_cloexec_flag="e"
++        fi
++    fi])
++AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
++
+ AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
+     if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
+         ac_cv_version_script=yes
+diff --git a/src/acm.c b/src/acm.c
+index c423bb7..dfc4959 100755
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -79,7 +79,7 @@ static int ucma_set_server_port(void)
+ {
+       FILE *f;
+-      if ((f = fopen("/var/run/ibacm.port", "r"))) {
++      if ((f = fopen("/var/run/ibacm.port", "r" STREAM_CLOEXEC))) {
+               fscanf(f, "%hu", (unsigned short *) &server_port);
+               fclose(f);
+       }
+@@ -99,7 +99,7 @@ void ucma_ib_init(void)
+       if (!ucma_set_server_port())
+               goto out;
+-      sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
++      sock = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
+       if (sock < 0)
+               goto out;
+diff --git a/src/cma.c b/src/cma.c
+index 2fb9913..baebecd 100755
+--- a/src/cma.c
++++ b/src/cma.c
+@@ -328,7 +328,7 @@ struct rdma_event_channel *rdma_create_event_channel(void)
+       if (!channel)
+               return NULL;
+-      channel->fd = open("/dev/infiniband/rdma_cm", O_RDWR);
++      channel->fd = open("/dev/infiniband/rdma_cm", O_RDWR | O_CLOEXEC);
+       if (channel->fd < 0) {
+               fprintf(stderr, PFX "Fatal: unable to open /dev/infiniband/rdma_cm\n");
+               goto err;