From: Sean Hefty Date: Thu, 10 May 2012 17:42:22 +0000 (-0700) Subject: refresh X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a11b6891997482be4a4b620aa6834416e4b8095b;p=~shefty%2Flibrdmacm.git refresh --- diff --git a/meta b/meta index dfad6d31..cf37ab71 100644 --- a/meta +++ b/meta @@ -1,9 +1,8 @@ Version: 1 -Previous: ee30fe5ba87986586d9ca37dc81903f748408e98 -Head: bb33098ac80751921e3ee56270b6ae11a7bccdd8 +Previous: a937c02e3e54b740c4e9ecb039ec14fed0475662 +Head: ec6a8efe211b0dc98548443c2e0d67e2c355351f Applied: - rs-locking: e69294e4ca7fb71f62ca32fc9f0ab385813cfe58 - refresh-temp: bb33098ac80751921e3ee56270b6ae11a7bccdd8 + rs-locking: ec6a8efe211b0dc98548443c2e0d67e2c355351f Unapplied: comp_locks: b89aab130b4619806557e11e6b9c10964f00743f preload: 5dfe7abc07064485c5100e04e5412279244c2bc3 diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index cf5cf6f6..00000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,56 +0,0 @@ -Bottom: b2e4cd7d670a626fa22b05cff6a1dccc973e9f0d -Top: 3fcdf48082614bb29c44242534cfeecb47e07114 -Author: Sean Hefty -Date: 2012-05-10 10:42:21 -0700 - -Refresh of rs-locking - ---- - -diff --git a/configure.in b/configure.in -index 238ee59..fa90fcb 100644 ---- a/configure.in -+++ b/configure.in -@@ -48,6 +48,16 @@ AC_CHECK_MEMBER(struct ibv_path_record.service_id, [], - AC_DEFINE(DEFINE_PATH_RECORD, 1, [adding path record definition]), - [#include ]) - -+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_MSG_RESULT(yes) ], -+ [ -+ AC_MSG_RESULT(no) -+ AC_DEFINE(DEFINE_ATOMICS, 1, [Set to 1 to implement atomics]) -+ ]) -+ - dnl Checks for header files. - AC_HEADER_STDC - if test "$disable_libcheck" != "yes"; then -diff --git a/src/cma.h b/src/cma.h -index f28020e..7703fe8 100644 ---- a/src/cma.h -+++ b/src/cma.h -@@ -72,6 +72,13 @@ static inline uint64_t ntohll(uint64_t x) { return x; } - /* - * Fast synchronization for low contention locking. - */ -+#if DEFINE_ATOMICS -+#define fastlock_t pthread_mutex_t -+#define fastlock_init(lock) pthread_mutex_init(lock, NULL) -+#define fastlock_destroy(lock) pthread_mutex_destroy(lock) -+#define fastlock_acquire(lock) pthread_mutex_lock(lock) -+#define fastlock_release(lock) pthread_mutex_unlock(lock) -+#else - typedef struct { - sem_t sem; - volatile int cnt; -@@ -95,6 +102,7 @@ static inline void fastlock_release(fastlock_t *lock) - if (__sync_sub_and_fetch(&lock->cnt, 1) > 0) - sem_post(&lock->sem); - } -+#endif /* DEFINE_ATOMICS */ - - int ucma_complete(struct rdma_cm_id *id); - static inline int ERR(int err) diff --git a/patches/rs-locking b/patches/rs-locking index b037eeae..aa3a2ba5 100644 --- a/patches/rs-locking +++ b/patches/rs-locking @@ -1,5 +1,5 @@ Bottom: de666c51520c9988ea3a07e332fa0402fdef6010 -Top: b2e4cd7d670a626fa22b05cff6a1dccc973e9f0d +Top: 3fcdf48082614bb29c44242534cfeecb47e07114 Author: Sean Hefty Date: 2012-05-07 17:16:47 -0700 @@ -29,8 +29,29 @@ Signed-off-by: Sean Hefty --- +diff --git a/configure.in b/configure.in +index 238ee59..fa90fcb 100644 +--- a/configure.in ++++ b/configure.in +@@ -48,6 +48,16 @@ AC_CHECK_MEMBER(struct ibv_path_record.service_id, [], + AC_DEFINE(DEFINE_PATH_RECORD, 1, [adding path record definition]), + [#include ]) + ++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_MSG_RESULT(yes) ], ++ [ ++ AC_MSG_RESULT(no) ++ AC_DEFINE(DEFINE_ATOMICS, 1, [Set to 1 to implement atomics]) ++ ]) ++ + dnl Checks for header files. + AC_HEADER_STDC + if test "$disable_libcheck" != "yes"; then diff --git a/src/cma.h b/src/cma.h -index 91528c0..f28020e 100644 +index 91528c0..7703fe8 100644 --- a/src/cma.h +++ b/src/cma.h @@ -42,6 +42,7 @@ @@ -41,13 +62,20 @@ index 91528c0..f28020e 100644 #include -@@ -68,6 +69,33 @@ static inline uint64_t ntohll(uint64_t x) { return x; } +@@ -68,6 +69,41 @@ static inline uint64_t ntohll(uint64_t x) { return x; } #define min(a, b) (a < b ? a : b) +/* + * Fast synchronization for low contention locking. + */ ++#if DEFINE_ATOMICS ++#define fastlock_t pthread_mutex_t ++#define fastlock_init(lock) pthread_mutex_init(lock, NULL) ++#define fastlock_destroy(lock) pthread_mutex_destroy(lock) ++#define fastlock_acquire(lock) pthread_mutex_lock(lock) ++#define fastlock_release(lock) pthread_mutex_unlock(lock) ++#else +typedef struct { + sem_t sem; + volatile int cnt; @@ -71,6 +99,7 @@ index 91528c0..f28020e 100644 + if (__sync_sub_and_fetch(&lock->cnt, 1) > 0) + sem_post(&lock->sem); +} ++#endif /* DEFINE_ATOMICS */ + int ucma_complete(struct rdma_cm_id *id); static inline int ERR(int err)