| 7 | #include <rte_stack.h> |
| 8 | |
| 9 | static int |
| 10 | __stack_alloc(struct rte_mempool *mp, uint32_t flags) |
| 11 | { |
| 12 | char name[RTE_STACK_NAMESIZE]; |
| 13 | struct rte_stack *s; |
| 14 | int ret; |
| 15 | |
| 16 | ret = snprintf(name, sizeof(name), |
| 17 | RTE_MEMPOOL_MZ_FORMAT, mp->name); |
| 18 | if (ret < 0 || ret >= (int)sizeof(name)) { |
| 19 | rte_errno = ENAMETOOLONG; |
| 20 | return -rte_errno; |
| 21 | } |
| 22 | |
| 23 | s = rte_stack_create(name, mp->size, mp->socket_id, flags); |
| 24 | if (s == NULL) |
| 25 | return -rte_errno; |
| 26 | |
| 27 | mp->pool_data = s; |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |
| 32 | static int |
| 33 | stack_alloc(struct rte_mempool *mp) |
no test coverage detected