DPDK  24.07.0
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

◆ rte_errno

#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/dma/dmafwd.c, examples/ipsec-secgw/ipsec-secgw.c, examples/ipsec-secgw/ipsec_worker.c, examples/ipsec-secgw/sa.c, examples/ipsec-secgw/sad.c, examples/l2fwd-macsec/main.c, examples/packet_ordering/main.c, and examples/rxtx_callbacks/main.c.

Definition at line 29 of file rte_errno.h.

◆ __ELASTERROR

#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

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()

RTE_DECLARE_PER_LCORE ( int  ,
_rte_errno   
)

Per core error number.

◆ rte_strerror()

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/bbdev_app/main.c, examples/bond/main.c, examples/distributor/main.c, examples/dma/dmafwd.c, examples/ethtool/ethtool-app/main.c, examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/flow_filtering/main.c, examples/ip_fragmentation/main.c, examples/ip_pipeline/cli.c, examples/ip_reassembly/main.c, examples/ipsec-secgw/ipsec-secgw.c, examples/ipv4_multicast/main.c, examples/l2fwd-crypto/main.c, examples/l2fwd-event/main.c, examples/l2fwd-jobstats/main.c, examples/l2fwd-keepalive/main.c, examples/l2fwd-macsec/main.c, examples/l2fwd/main.c, examples/l3fwd-graph/main.c, examples/l3fwd-power/main.c, examples/l3fwd/main.c, examples/link_status_interrupt/main.c, examples/multi_process/client_server_mp/mp_server/init.c, examples/multi_process/client_server_mp/mp_server/main.c, examples/multi_process/symmetric_mp/main.c, examples/packet_ordering/main.c, examples/ptpclient/ptpclient.c, examples/qos_meter/main.c, examples/qos_sched/init.c, examples/rxtx_callbacks/main.c, examples/server_node_efd/efd_server/init.c, examples/server_node_efd/efd_server/main.c, examples/vhost/main.c, examples/vm_power_manager/guest_cli/vm_power_cli_guest.c, examples/vm_power_manager/main.c, examples/vmdq/main.c, and examples/vmdq_dcb/main.c.