27 #define RTE_TAILQ_STACK_NAME "RTE_STACK" 28 #define RTE_STACK_MZ_PREFIX "STK_" 30 #define RTE_STACK_NAMESIZE (RTE_MEMZONE_NAMESIZE - \ 31 sizeof(RTE_STACK_MZ_PREFIX) + 1) 33 struct rte_stack_lf_elem {
35 struct rte_stack_lf_elem *next;
38 struct rte_stack_lf_head {
39 struct rte_stack_lf_elem *top;
43 struct rte_stack_lf_list {
45 struct rte_stack_lf_head head __rte_aligned(16);
55 struct rte_stack_lf_list used __rte_cache_aligned;
57 struct rte_stack_lf_list free __rte_cache_aligned;
59 struct rte_stack_lf_elem elems[] __rte_cache_aligned;
65 struct rte_stack_std {
83 struct rte_stack_lf stack_lf;
84 struct rte_stack_std stack_std;
92 #define RTE_STACK_F_LF 0x0001 94 #include "rte_stack_std.h" 95 #include "rte_stack_lf.h" 112 RTE_ASSERT(s != NULL);
113 RTE_ASSERT(obj_table != NULL);
116 return __rte_stack_lf_push(s, obj_table, n);
118 return __rte_stack_std_push(s, obj_table, n);
136 RTE_ASSERT(s != NULL);
137 RTE_ASSERT(obj_table != NULL);
140 return __rte_stack_lf_pop(s, obj_table, n);
142 return __rte_stack_std_pop(s, obj_table, n);
156 RTE_ASSERT(s != NULL);
159 return __rte_stack_lf_count(s);
161 return __rte_stack_std_count(s);
175 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)
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)
#define __rte_cache_aligned
static __rte_always_inline unsigned int rte_stack_pop(struct rte_stack *s, void **obj_table, unsigned int n)
#define RTE_STACK_NAMESIZE