29 static inline void rte_mb(
void);
37 static inline void rte_wmb(
void);
45 static inline void rte_rmb(
void);
157 #define rte_compiler_barrier() do { \
158 asm volatile ("" : : : "memory"); \
187 #ifdef RTE_FORCE_INTRINSICS
191 return __sync_bool_compare_and_swap(dst, exp, src);
210 static inline uint16_t
213 #ifdef RTE_FORCE_INTRINSICS
214 static inline uint16_t
217 #if defined(__clang__)
218 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
220 return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
235 #define RTE_ATOMIC16_INIT(val) { (val) }
257 static inline int16_t
288 __sync_fetch_and_add(&v->
cnt, inc);
302 __sync_fetch_and_sub(&v->
cnt, dec);
314 #ifdef RTE_FORCE_INTRINSICS
331 #ifdef RTE_FORCE_INTRINSICS
352 static inline int16_t
355 return __sync_add_and_fetch(&v->
cnt, inc);
372 static inline int16_t
375 return __sync_sub_and_fetch(&v->
cnt, dec);
391 #ifdef RTE_FORCE_INTRINSICS
394 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
411 #ifdef RTE_FORCE_INTRINSICS
414 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
431 #ifdef RTE_FORCE_INTRINSICS
470 #ifdef RTE_FORCE_INTRINSICS
474 return __sync_bool_compare_and_swap(dst, exp, src);
493 static inline uint32_t
496 #ifdef RTE_FORCE_INTRINSICS
497 static inline uint32_t
500 #if defined(__clang__)
501 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
503 return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
518 #define RTE_ATOMIC32_INIT(val) { (val) }
540 static inline int32_t
571 __sync_fetch_and_add(&v->
cnt, inc);
585 __sync_fetch_and_sub(&v->
cnt, dec);
597 #ifdef RTE_FORCE_INTRINSICS
614 #ifdef RTE_FORCE_INTRINSICS
635 static inline int32_t
638 return __sync_add_and_fetch(&v->
cnt, inc);
655 static inline int32_t
658 return __sync_sub_and_fetch(&v->
cnt, dec);
674 #ifdef RTE_FORCE_INTRINSICS
677 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
694 #ifdef RTE_FORCE_INTRINSICS
697 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
714 #ifdef RTE_FORCE_INTRINSICS
752 #ifdef RTE_FORCE_INTRINSICS
756 return __sync_bool_compare_and_swap(dst, exp, src);
775 static inline uint64_t
778 #ifdef RTE_FORCE_INTRINSICS
779 static inline uint64_t
782 #if defined(__clang__)
783 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
785 return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
800 #define RTE_ATOMIC64_INIT(val) { (val) }
811 #ifdef RTE_FORCE_INTRINSICS
821 while (success == 0) {
838 static inline int64_t
841 #ifdef RTE_FORCE_INTRINSICS
842 static inline int64_t
851 while (success == 0) {
873 #ifdef RTE_FORCE_INTRINSICS
883 while (success == 0) {
903 #ifdef RTE_FORCE_INTRINSICS
907 __sync_fetch_and_add(&v->
cnt, inc);
922 #ifdef RTE_FORCE_INTRINSICS
926 __sync_fetch_and_sub(&v->
cnt, dec);
939 #ifdef RTE_FORCE_INTRINSICS
956 #ifdef RTE_FORCE_INTRINSICS
977 static inline int64_t
980 #ifdef RTE_FORCE_INTRINSICS
981 static inline int64_t
984 return __sync_add_and_fetch(&v->
cnt, inc);
1001 static inline int64_t
1004 #ifdef RTE_FORCE_INTRINSICS
1005 static inline int64_t
1008 return __sync_sub_and_fetch(&v->
cnt, dec);
1025 #ifdef RTE_FORCE_INTRINSICS
1045 #ifdef RTE_FORCE_INTRINSICS
1065 #ifdef RTE_FORCE_INTRINSICS
1080 #ifdef RTE_FORCE_INTRINSICS
1098 __extension__ __int128 int128;
1148 const rte_int128_t *src,
static void rte_atomic32_inc(rte_atomic32_t *v)
static int64_t rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)
static void rte_smp_rmb(void)
static int rte_atomic32_cmpset(volatile uint32_t *dst, uint32_t exp, uint32_t src)
static int16_t rte_atomic16_read(const rte_atomic16_t *v)
static void rte_wmb(void)
static void rte_atomic32_add(rte_atomic32_t *v, int32_t inc)
static int rte_atomic16_dec_and_test(rte_atomic16_t *v)
static int64_t rte_atomic64_read(rte_atomic64_t *v)
static int16_t rte_atomic16_sub_return(rte_atomic16_t *v, int16_t dec)
static void rte_atomic32_sub(rte_atomic32_t *v, int32_t dec)
static void rte_cio_rmb(void)
static void rte_atomic32_dec(rte_atomic32_t *v)
static int rte_atomic32_inc_and_test(rte_atomic32_t *v)
static void rte_io_mb(void)
static void rte_atomic64_inc(rte_atomic64_t *v)
static void rte_atomic32_set(rte_atomic32_t *v, int32_t new_value)
static int32_t rte_atomic32_add_return(rte_atomic32_t *v, int32_t inc)
static void rte_atomic16_add(rte_atomic16_t *v, int16_t inc)
static void rte_atomic32_init(rte_atomic32_t *v)
static void rte_atomic16_clear(rte_atomic16_t *v)
static int rte_atomic16_test_and_set(rte_atomic16_t *v)
static int rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src)
static void rte_atomic16_sub(rte_atomic16_t *v, int16_t dec)
static void rte_atomic16_set(rte_atomic16_t *v, int16_t new_value)
static void rte_io_wmb(void)
static void rte_atomic64_clear(rte_atomic64_t *v)
static int16_t rte_atomic16_add_return(rte_atomic16_t *v, int16_t inc)
static int rte_atomic64_dec_and_test(rte_atomic64_t *v)
static void rte_smp_wmb(void)
static int64_t rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)
static void rte_rmb(void)
static void rte_atomic32_clear(rte_atomic32_t *v)
static void rte_atomic16_inc(rte_atomic16_t *v)
static int rte_atomic16_inc_and_test(rte_atomic16_t *v)
static int rte_atomic16_cmpset(volatile uint16_t *dst, uint16_t exp, uint16_t src)
static int rte_atomic64_inc_and_test(rte_atomic64_t *v)
static int32_t rte_atomic32_sub_return(rte_atomic32_t *v, int32_t dec)
static void rte_atomic64_sub(rte_atomic64_t *v, int64_t dec)
static uint16_t rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
static int rte_atomic32_test_and_set(rte_atomic32_t *v)
static void rte_smp_mb(void)
static void rte_atomic_thread_fence(int memory_order)
__extension__ struct rte_eth_link __rte_aligned(8)
static uint32_t rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
static void rte_atomic16_dec(rte_atomic16_t *v)
static void rte_atomic64_init(rte_atomic64_t *v)
static void rte_atomic64_dec(rte_atomic64_t *v)
static void rte_atomic16_init(rte_atomic16_t *v)
static int rte_atomic64_test_and_set(rte_atomic64_t *v)
static uint64_t rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
static void rte_cio_wmb(void)
static int32_t rte_atomic32_read(const rte_atomic32_t *v)
static __rte_experimental int rte_atomic128_cmp_exchange(rte_int128_t *dst, rte_int128_t *exp, const rte_int128_t *src, unsigned int weak, int success, int failure)
static void rte_atomic64_set(rte_atomic64_t *v, int64_t new_value)
static int rte_atomic32_dec_and_test(rte_atomic32_t *v)
static void rte_atomic64_add(rte_atomic64_t *v, int64_t inc)
static void rte_io_rmb(void)