numam-dpdk/lib/librte_stack/rte_stack_pvt.h
Gage Eads 05d3b5283c stack: introduce stack library
The rte_stack library provides an API for configuration and use of a
bounded stack of pointers. Push and pop operations are MT-safe, allowing
concurrent access, and the interface supports pushing and popping multiple
pointers at a time.

The library's interface is modeled after another DPDK data structure,
rte_ring, and its lock-based implementation is derived from the stack
mempool handler. An upcoming commit will migrate the stack mempool handler
to rte_stack.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2019-04-04 22:06:16 +02:00

35 lines
626 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2019 Intel Corporation
*/
#ifndef _RTE_STACK_PVT_H_
#define _RTE_STACK_PVT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <rte_log.h>
extern int stack_logtype;
#define STACK_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ##level, stack_logtype, "%s(): "fmt "\n", \
__func__, ##args)
#define STACK_LOG_ERR(fmt, args...) \
STACK_LOG(ERR, fmt, ## args)
#define STACK_LOG_WARN(fmt, args...) \
STACK_LOG(WARNING, fmt, ## args)
#define STACK_LOG_INFO(fmt, args...) \
STACK_LOG(INFO, fmt, ## args)
#ifdef __cplusplus
}
#endif
#endif /* _RTE_STACK_PVT_H_ */