NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Error
Collaboration diagram for DOCA Error:

Macros

#define DOCA_IS_ERROR(r)   doca_unlikely((r) != DOCA_SUCCESS)
 Compiler optimized macro to check if we have an error. More...
 
#define DOCA_ERROR_PROPAGATE(r, t)
 Save the first encountered doca_error_t. More...
 

Typedefs

typedef enum doca_error doca_error_t
 DOCA API return codes. More...
 

Enumerations

enum  doca_error {
  DOCA_SUCCESS = 0 , DOCA_ERROR_UNKNOWN = 1 , DOCA_ERROR_NOT_PERMITTED = 2 , DOCA_ERROR_IN_USE = 3 ,
  DOCA_ERROR_NOT_SUPPORTED = 4 , DOCA_ERROR_AGAIN = 5 , DOCA_ERROR_INVALID_VALUE = 6 , DOCA_ERROR_NO_MEMORY = 7 ,
  DOCA_ERROR_INITIALIZATION = 8 , DOCA_ERROR_TIME_OUT = 9 , DOCA_ERROR_SHUTDOWN = 10 , DOCA_ERROR_CONNECTION_RESET = 11 ,
  DOCA_ERROR_CONNECTION_ABORTED = 12 , DOCA_ERROR_CONNECTION_INPROGRESS = 13 , DOCA_ERROR_NOT_CONNECTED = 14 , DOCA_ERROR_NO_LOCK = 15 ,
  DOCA_ERROR_NOT_FOUND = 16 , DOCA_ERROR_IO_FAILED = 17 , DOCA_ERROR_BAD_STATE = 18 , DOCA_ERROR_UNSUPPORTED_VERSION = 19 ,
  DOCA_ERROR_OPERATING_SYSTEM = 20 , DOCA_ERROR_DRIVER = 21 , DOCA_ERROR_UNEXPECTED = 22 , DOCA_ERROR_ALREADY_EXIST = 23 ,
  DOCA_ERROR_FULL = 24 , DOCA_ERROR_EMPTY = 25 , DOCA_ERROR_IN_PROGRESS = 26 , DOCA_ERROR_TOO_BIG = 27 ,
  DOCA_ERROR_AUTHENTICATION = 28 , DOCA_ERROR_BAD_CONFIG = 29 , DOCA_ERROR_SKIPPED = 30
}
 DOCA API return codes. More...
 

Functions

DOCA_STABLE const char * doca_error_get_name (doca_error_t error)
 Returns the string representation of an error code name. More...
 
DOCA_STABLE const char * doca_error_get_descr (doca_error_t error)
 Returns the description string of an error code. More...
 

Detailed Description

DOCA Error provides information regarding different errors caused while using the DOCA libraries.

Macro Definition Documentation

◆ DOCA_ERROR_PROPAGATE

#define DOCA_ERROR_PROPAGATE (   r,
 
)
Value:
do { \
if (r == DOCA_SUCCESS) \
r = t; \
} while (0)
@ DOCA_SUCCESS
Definition: doca_error.h:38

Save the first encountered doca_error_t.

Updates the return value variable r to hold the first error that we encountered.

Definition at line 83 of file doca_error.h.

◆ DOCA_IS_ERROR

#define DOCA_IS_ERROR (   r)    doca_unlikely((r) != DOCA_SUCCESS)

Compiler optimized macro to check if we have an error.

Used in cases where error is unlikely to happen.

Definition at line 76 of file doca_error.h.

Typedef Documentation

◆ doca_error_t

typedef enum doca_error doca_error_t

DOCA API return codes.

Enumeration Type Documentation

◆ doca_error

enum doca_error

DOCA API return codes.

Enumerator
DOCA_SUCCESS 

Success

DOCA_ERROR_UNKNOWN 

Unknown error

DOCA_ERROR_NOT_PERMITTED 

Operation not permitted

DOCA_ERROR_IN_USE 

Resource already in use

DOCA_ERROR_NOT_SUPPORTED 

Operation not supported

DOCA_ERROR_AGAIN 

Resource temporarily unavailable, try again

DOCA_ERROR_INVALID_VALUE 

Invalid input

DOCA_ERROR_NO_MEMORY 

Memory allocation failure

DOCA_ERROR_INITIALIZATION 

Resource initialization failure

DOCA_ERROR_TIME_OUT 

Timer expired waiting for resource

DOCA_ERROR_SHUTDOWN 

Shut down in process or completed

DOCA_ERROR_CONNECTION_RESET 

Connection reset by peer

DOCA_ERROR_CONNECTION_ABORTED 

Connection aborted

DOCA_ERROR_CONNECTION_INPROGRESS 

Connection in progress

DOCA_ERROR_NOT_CONNECTED 

Not Connected

DOCA_ERROR_NO_LOCK 

Unable to acquire required lock

DOCA_ERROR_NOT_FOUND 

Resource Not Found

DOCA_ERROR_IO_FAILED 

Input/Output Operation Failed

DOCA_ERROR_BAD_STATE 

Bad State

DOCA_ERROR_UNSUPPORTED_VERSION 

Unsupported version

DOCA_ERROR_OPERATING_SYSTEM 

Operating system call failure

DOCA_ERROR_DRIVER 

DOCA Driver call failure

DOCA_ERROR_UNEXPECTED 

An unexpected scenario was detected

DOCA_ERROR_ALREADY_EXIST 

Resource already exist

DOCA_ERROR_FULL 

No more space in resource

DOCA_ERROR_EMPTY 

No entry is available in resource

DOCA_ERROR_IN_PROGRESS 

Operation is in progress

DOCA_ERROR_TOO_BIG 

Requested operation too big to be contained

DOCA_ERROR_AUTHENTICATION 

Authentication failure

DOCA_ERROR_BAD_CONFIG 

Configuration is not valid

DOCA_ERROR_SKIPPED 

Result is valid, but some previous output data was dropped

Definition at line 37 of file doca_error.h.

Function Documentation

◆ doca_error_get_descr()

DOCA_STABLE const char* doca_error_get_descr ( doca_error_t  error)

Returns the description string of an error code.

This function returns the description string of an error code. If the error code is not recognized, "unrecognized error code" is returned.

Parameters
[in]error- Error code to convert to description string.
Returns
char* pointer to a NULL-terminated string.

◆ doca_error_get_name()

DOCA_STABLE const char* doca_error_get_name ( doca_error_t  error)

Returns the string representation of an error code name.

Returns a string containing the name of an error code in the enum. If the error code is not recognized, "unrecognized error code" is returned.

Parameters
[in]error- Error code to convert to string.
Returns
char* pointer to a NULL-terminated string.