1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
8 * API for error cause tracking
18 #include <rte_per_lcore.h>
20 RTE_DECLARE_PER_LCORE(int, _rte_errno); /**< Per core error number. */
23 * Error number value, stored per-thread, which can be queried after
24 * calls to certain functions to determine why those functions failed.
26 * Uses standard values from errno.h wherever possible, with a small number
27 * of additional possible values for RTE-specific conditions.
29 #define rte_errno RTE_PER_LCORE(_rte_errno)
32 * Function which returns a printable string describing a particular
33 * error code. For non-RTE-specific error codes, this function returns
34 * the value from the libc strerror function.
37 * The error number to be looked up - generally the value of rte_errno
39 * A pointer to a thread-local string containing the text describing
42 const char *rte_strerror(int errnum);
46 * Check if we have a defined value for the max system-defined errno values.
47 * if no max defined, start from 1000 to prevent overlap with standard values
49 #define __ELASTERROR 1000
54 RTE_MIN_ERRNO = __ELASTERROR, /**< Start numbering above std errno vals */
56 E_RTE_SECONDARY, /**< Operation not allowed in secondary processes */
57 E_RTE_NO_CONFIG, /**< Missing rte_config */
59 RTE_MAX_ERRNO /**< Max RTE error number */
66 #endif /* _RTE_ERRNO_H_ */