numam-dpdk/lib/stack/rte_stack_lf.c
Bruce Richardson 99a2dd955f lib: remove librte_ prefix from directory names
There is no reason for the DPDK libraries to all have 'librte_' prefix on
the directory names. This prefix makes the directory names longer and also
makes it awkward to add features referring to individual libraries in the
build - should the lib names be specified with or without the prefix.
Therefore, we can just remove the library prefix and use the library's
unique name as the directory name, i.e. 'eal' rather than 'librte_eal'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-21 14:04:09 +02:00

32 lines
676 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2019 Intel Corporation
*/
#include "rte_stack.h"
void
rte_stack_lf_init(struct rte_stack *s, unsigned int count)
{
struct rte_stack_lf_elem *elems = s->stack_lf.elems;
unsigned int i;
for (i = 0; i < count; i++)
__rte_stack_lf_push_elems(&s->stack_lf.free,
&elems[i], &elems[i], 1);
}
ssize_t
rte_stack_lf_get_memsize(unsigned int count)
{
ssize_t sz = sizeof(struct rte_stack);
sz += RTE_CACHE_LINE_ROUNDUP(count * sizeof(struct rte_stack_lf_elem));
/* Add padding to avoid false sharing conflicts caused by
* next-line hardware prefetchers.
*/
sz += 2 * RTE_CACHE_LINE_SIZE;
return sz;
}