aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/atomics.h
diff options
context:
space:
mode:
authorSirshak Das <sirshak.das@arm.com>2018-11-07 18:46:42 -0600
committerOle Trøan <otroan@employees.org>2018-11-28 20:50:21 +0000
commit19515acddc343d1680d4a5d27f39456999498591 (patch)
tree96d7e4be9ca0379b252482f5081f3abeea7d32cb /src/vppinfra/atomics.h
parent5785e89ba15128f9659bf0b6f78559c63a70e285 (diff)
Use acquire/release ordering when accessing svm_fifo shared variable cursize
Improves TCP iperf3 performance by ~3% on AArch64. Change-Id: I1e51bd8403ba45ec6af4c2f96b95e884c1ae0d67 Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Diffstat (limited to 'src/vppinfra/atomics.h')
-rw-r--r--src/vppinfra/atomics.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vppinfra/atomics.h b/src/vppinfra/atomics.h
index 420ae837fc0..8084bdc77d4 100644
--- a/src/vppinfra/atomics.h
+++ b/src/vppinfra/atomics.h
@@ -40,7 +40,11 @@
#define clib_atomic_test_and_set(a) __sync_lock_test_and_set(a, 1)
#define clib_atomic_release(a) __sync_lock_release(a)
+#define clib_atomic_load_acq_n(a) __atomic_load_n((a), __ATOMIC_ACQUIRE)
#define clib_atomic_store_rel_n(a, b) __atomic_store_n ((a), (b), __ATOMIC_RELEASE)
#define clib_atomic_swap_acq_n(a, b) __atomic_exchange_n ((a), (b), __ATOMIC_ACQUIRE)
+#define clib_atomic_fetch_add_rel(a, b) __atomic_fetch_add((a), (b), __ATOMIC_RELEASE)
+#define clib_atomic_fetch_sub_rel(a, b) __atomic_fetch_sub((a), (b), __ATOMIC_RELEASE)
+
#endif /* included_clib_atomics_h */