25 #define RTE_TAILQ_STACK_NAME "RTE_STACK" 26 #define RTE_STACK_MZ_PREFIX "STK_" 28 #define RTE_STACK_NAMESIZE (RTE_MEMZONE_NAMESIZE - \ 29 sizeof(RTE_STACK_MZ_PREFIX) + 1) 31 struct rte_stack_lf_elem {
33 struct rte_stack_lf_elem *next;
36 struct rte_stack_lf_head {
37 struct rte_stack_lf_elem *top;
41 struct rte_stack_lf_list {
43 alignas(16)
struct rte_stack_lf_head head;
45 RTE_ATOMIC(uint64_t) len;
53 alignas(RTE_CACHE_LINE_SIZE)
struct rte_stack_lf_list used;
55 alignas(RTE_CACHE_LINE_SIZE)
struct rte_stack_lf_list free;
57 alignas(RTE_CACHE_LINE_SIZE)
struct rte_stack_lf_elem elems[];
63 struct rte_stack_std {
80 struct rte_stack_lf stack_lf;
81 struct rte_stack_std stack_std;
89 #define RTE_STACK_F_LF 0x0001 91 #include "rte_stack_std.h" 92 #include "rte_stack_lf.h" 113 RTE_ASSERT(s != NULL);
114 RTE_ASSERT(obj_table != NULL);
117 return __rte_stack_lf_push(s, obj_table, n);
119 return __rte_stack_std_push(s, obj_table, n);
137 RTE_ASSERT(s != NULL);
138 RTE_ASSERT(obj_table != NULL);
141 return __rte_stack_lf_pop(s, obj_table, n);
143 return __rte_stack_std_pop(s, obj_table, n);
157 RTE_ASSERT(s != NULL);
160 return __rte_stack_lf_count(s);
162 return __rte_stack_std_count(s);
176 RTE_ASSERT(s != NULL);
void rte_stack_free(struct rte_stack *s)
#define __rte_always_inline
struct rte_stack * rte_stack_lookup(const char *name)
#define __rte_cache_aligned
static __rte_always_inline unsigned int rte_stack_count(struct rte_stack *s)
struct rte_stack * rte_stack_create(const char *name, unsigned int count, int socket_id, uint32_t flags)
static __rte_always_inline unsigned int rte_stack_push(struct rte_stack *s, void *const *obj_table, unsigned int n)
static __rte_always_inline unsigned int rte_stack_free_count(struct rte_stack *s)
static __rte_always_inline unsigned int rte_stack_pop(struct rte_stack *s, void **obj_table, unsigned int n)
#define RTE_STACK_NAMESIZE