DPDK  18.11.11
Macros | Enumerations | Functions
rte_errno.h File Reference
#include <rte_per_lcore.h>

Go to the source code of this file.

Macros

#define rte_errno   RTE_PER_LCORE(_rte_errno)
 
#define __ELASTERROR   1000
 

Enumerations

enum  { RTE_MIN_ERRNO = __ELASTERROR, E_RTE_SECONDARY, E_RTE_NO_CONFIG, RTE_MAX_ERRNO }
 

Functions

 RTE_DECLARE_PER_LCORE (int, _rte_errno)
 
const char * rte_strerror (int errnum)
 

Detailed Description

API for error cause tracking

Definition in file rte_errno.h.

Macro Definition Documentation

#define rte_errno   RTE_PER_LCORE(_rte_errno)

Error number value, stored per-thread, which can be queried after calls to certain functions to determine why those functions failed.

Uses standard values from errno.h wherever possible, with a small number of additional possible values for RTE-specific conditions.

Examples:
examples/ipsec-secgw/ipsec-secgw.c, examples/ipsec-secgw/sa.c, examples/packet_ordering/main.c, examples/quota_watermark/qw/init.c, and examples/quota_watermark/qw/main.c.

Definition at line 29 of file rte_errno.h.

#define __ELASTERROR   1000

Check if we have a defined value for the max system-defined errno values. if no max defined, start from 1000 to prevent overlap with standard values

Definition at line 49 of file rte_errno.h.

Enumeration Type Documentation

anonymous enum

Error types

Enumerator
RTE_MIN_ERRNO 

Start numbering above std errno vals

E_RTE_SECONDARY 

Operation not allowed in secondary processes

E_RTE_NO_CONFIG 

Missing rte_config

RTE_MAX_ERRNO 

Max RTE error number

Definition at line 53 of file rte_errno.h.

Function Documentation

RTE_DECLARE_PER_LCORE ( int  ,
_rte_errno   
)

Per core error number.

const char* rte_strerror ( int  errnum)

Function which returns a printable string describing a particular error code. For non-RTE-specific error codes, this function returns the value from the libc strerror function.

Parameters
errnumThe error number to be looked up - generally the value of rte_errno
Returns
A pointer to a thread-local string containing the text describing the error.
Examples:
examples/l2fwd-jobstats/main.c, examples/packet_ordering/main.c, examples/quota_watermark/qw/init.c, and examples/quota_watermark/qw/main.c.