- struct rte_mempool_stack *s;
- unsigned n = mp->size;
- int size = sizeof(*s) + (n+16)*sizeof(void *);
-
- /* Allocate our local memory structure */
- s = rte_zmalloc_socket("mempool-stack",
- size,
- RTE_CACHE_LINE_SIZE,
- mp->socket_id);
- if (s == NULL) {
- RTE_LOG(ERR, MEMPOOL, "Cannot allocate stack!\n");
- return -ENOMEM;
+ char name[RTE_STACK_NAMESIZE];
+ struct rte_stack *s;
+ int ret;
+
+ ret = snprintf(name, sizeof(name),
+ RTE_MEMPOOL_MZ_FORMAT, mp->name);
+ if (ret < 0 || ret >= (int)sizeof(name)) {
+ rte_errno = ENAMETOOLONG;
+ return -rte_errno;