1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
8 rte_stack_lf_init(struct rte_stack *s, unsigned int count)
10 struct rte_stack_lf_elem *elems = s->stack_lf.elems;
13 for (i = 0; i < count; i++)
14 __rte_stack_lf_push_elems(&s->stack_lf.free,
15 &elems[i], &elems[i], 1);
19 rte_stack_lf_get_memsize(unsigned int count)
21 ssize_t sz = sizeof(struct rte_stack);
23 sz += RTE_CACHE_LINE_ROUNDUP(count * sizeof(struct rte_stack_lf_elem));
25 /* Add padding to avoid false sharing conflicts caused by
26 * next-line hardware prefetchers.
28 sz += 2 * RTE_CACHE_LINE_SIZE;