5#ifndef _RTE_STACK_LF_C11_H_
6#define _RTE_STACK_LF_C11_H_
12__rte_stack_lf_count(
struct rte_stack *s)
29 return (
unsigned int)rte_atomic_load_explicit(&s->stack_lf.used.len,
30 rte_memory_order_relaxed);
34__rte_stack_lf_push_elems(
struct rte_stack_lf_list *list,
35 struct rte_stack_lf_elem *first,
36 struct rte_stack_lf_elem *last,
39 struct rte_stack_lf_head old_head;
42 old_head = list->head;
45 struct rte_stack_lf_head new_head;
51 new_head.cnt = old_head.cnt + 1;
53 last->next = old_head.top;
59 (rte_int128_t *)&list->head,
60 (rte_int128_t *)&old_head,
61 (rte_int128_t *)&new_head,
62 1, rte_memory_order_release,
63 rte_memory_order_relaxed);
64 }
while (success == 0);
69 rte_atomic_fetch_add_explicit(&list->len, num, rte_memory_order_release);
73__rte_stack_lf_pop_elems(
struct rte_stack_lf_list *list,
76 struct rte_stack_lf_elem **last)
78 struct rte_stack_lf_head old_head;
83 len = rte_atomic_load_explicit(&list->len, rte_memory_order_relaxed);
91 if (rte_atomic_compare_exchange_weak_explicit(&list->len,
93 rte_memory_order_acquire,
94 rte_memory_order_relaxed))
101 old_head = list->head;
105 struct rte_stack_lf_head new_head;
106 struct rte_stack_lf_elem *tmp;
124 for (i = 0; i < num && tmp != NULL; i++) {
127 obj_table[i] = tmp->data;
137 old_head = list->head;
142 new_head.cnt = old_head.cnt + 1;
159 (rte_int128_t *)&list->head,
160 (rte_int128_t *)&old_head,
161 (rte_int128_t *)&new_head,
162 0, rte_memory_order_relaxed,
163 rte_memory_order_relaxed);
164 }
while (success == 0);
static 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_atomic_thread_fence(rte_memory_order memorder)
#define __rte_always_inline
static void rte_prefetch0(const volatile void *p)