44 #define valid_pool(pool) ((unsigned int)pool_hdl2idx((pool)) < \
46 #define invalid_pool(pool) ((unsigned int)pool_hdl2idx((pool)) > \
50 const char **err_str);
52 int check_pool_uarea_persistence(
const em_pool_cfg_t *pool_cfg,
53 const char **err_str);
63 pool_create(
const char *name, em_pool_t req_pool,
const em_pool_cfg_t *pool_cfg);
66 pool_delete(em_pool_t pool);
69 pool_find(
const char *name);
71 void pool_info_print_hdr(
unsigned int num_pools);
72 void pool_info_print(em_pool_t pool);
74 void pool_stats_print(em_pool_t pool);
76 void subpools_stats_print(em_pool_t pool,
const int subpools[],
int num_subpools);
78 void subpools_stats_selected_print(em_pool_t pool,
const int subpools[],
81 void print_pool_elem_info(
void);
85 pool_hdl2idx(em_pool_t pool)
87 return (
int)(uintptr_t)pool - 1;
91 static inline em_pool_t
92 pool_idx2hdl(
int pool_idx)
94 return (em_pool_t)(uintptr_t)(pool_idx + 1);
99 pool_elem_get(em_pool_t pool)
101 const int pool_idx = pool_hdl2idx(pool);
107 mpool_elem = &
em_shm->mpool_tbl.pool[pool_idx];
119 pool_find_subpool(
const mpool_elem_t *
const pool_elem, uint32_t size)
125 size > pool_elem->
size[subpool]; subpool++)
144 static inline em_pool_t
145 pool_odp2em(odp_pool_t odp_pool)
152 int idx = odp_pool_index(odp_pool);
154 if (unlikely(idx < 0))
157 return (em_pool_t)(uintptr_t)
em_shm->mpool_tbl.pool_subpool_odp2em[idx].pool;
168 pool_subpool_odp2em(odp_pool_t odp_pool)
175 int idx = odp_pool_index(odp_pool);
177 if (unlikely(idx < 0))
180 return em_shm->mpool_tbl.pool_subpool_odp2em[idx];