EM-ODP  3.7.0
Event Machine on ODP
event_machine_hw_types.h File Reference
#include <odp/api/cpumask.h>
Include dependency graph for event_machine_hw_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  em_core_mask_t
 
struct  em_output_queue_conf_t
 

Macros

#define EM_POOL_UNDEF   EM_STATIC_CAST(em_pool_t, EM_HDL_UNDEF)
 
#define PRI_POOL   PRI_HDL
 
#define EM_QUEUE_PRIO_UNDEF   0xFF
 
#define EM_QUEUE_FLAG_DEFAULT   0
 
#define EM_QUEUE_FLAG_BLOCKING   0 /* blocking, fastest (default) */
 
#define EM_QUEUE_FLAG_NONBLOCKING_LF   1 /* non-blocking, lock-free */
 
#define EM_QUEUE_FLAG_NONBLOCKING_WF   2 /* non-blocking, wait-free */
 
#define EM_QUEUE_FLAG_ENQ_NOT_MTSAFE   4
 
#define EM_QUEUE_FLAG_DEQ_NOT_MTSAFE   8
 
#define EM_CORE_MASK_STRLEN   ((EM_MAX_CORES + 3) / 4 + 3)
 
#define EM_MAX_SUBPOOLS   4
 The number of subpools in each EM pool. The subpool is a pool with buffers of only one size.
 
#define EM_ERROR_FATAL_MASK   0x80000000
 
#define EM_ERROR_IS_FATAL(error)   (!!(EM_ERROR_FATAL_MASK & (error)))
 
#define EM_ERROR_SET_FATAL(error)   (EM_ERROR_FATAL_MASK | (error))
 
#define EM_FATAL(error)   EM_ERROR_SET_FATAL((error))
 
#define EM_ESCOPE_INTERNAL_TYPE   (0xFEu)
 
#define EM_ESCOPE_INTERNAL_MASK
 
#define EM_ESCOPE_INTERNAL(escope)
 
#define EM_ESCOPE_CONF_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0001)
 
#define EM_ESCOPE_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0002)
 
#define EM_ESCOPE_INIT_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0003)
 
#define EM_ESCOPE_TERM   (EM_ESCOPE_INTERNAL_MASK | 0x0004)
 
#define EM_ESCOPE_TERM_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0005)
 
#define EM_ESCOPE_POOL_CFG_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0101)
 
#define EM_ESCOPE_POOL_CREATE   (EM_ESCOPE_INTERNAL_MASK | 0x0102)
 
#define EM_ESCOPE_POOL_DELETE   (EM_ESCOPE_INTERNAL_MASK | 0x0103)
 
#define EM_ESCOPE_POOL_FIND   (EM_ESCOPE_INTERNAL_MASK | 0x0104)
 
#define EM_ESCOPE_POOL_GET_NAME   (EM_ESCOPE_INTERNAL_MASK | 0x0105)
 
#define EM_ESCOPE_POOL_GET_FIRST   (EM_ESCOPE_INTERNAL_MASK | 0x0106)
 
#define EM_ESCOPE_POOL_GET_NEXT   (EM_ESCOPE_INTERNAL_MASK | 0x0107)
 
#define EM_ESCOPE_POOL_INFO   (EM_ESCOPE_INTERNAL_MASK | 0x0108)
 
#define EM_ESCOPE_POOL_STATS   (EM_ESCOPE_INTERNAL_MASK | 0x0109)
 
#define EM_ESCOPE_POOL_STATS_RESET   (EM_ESCOPE_INTERNAL_MASK | 0x010A)
 
#define EM_ESCOPE_POOL_SUBPOOL_STATS   (EM_ESCOPE_INTERNAL_MASK | 0x010B)
 
#define EM_ESCOPE_POOL_SUBPOOL_STATS_RESET   (EM_ESCOPE_INTERNAL_MASK | 0x010C)
 
#define EM_ESCOPE_POOL_STATS_SELECTED   (EM_ESCOPE_INTERNAL_MASK | 0x010D)
 
#define EM_ESCOPE_POOL_SUBPOOL_STATS_SELECTED   (EM_ESCOPE_INTERNAL_MASK | 0x010E)
 
#define EM_ESCOPE_POOL_NUM_SUBPOOLS   (EM_ESCOPE_INTERNAL_MASK | 0x010F)
 
#define EM_ESCOPE_HOOKS_REGISTER_ALLOC   (EM_ESCOPE_INTERNAL_MASK | 0x0201)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_ALLOC   (EM_ESCOPE_INTERNAL_MASK | 0x0202)
 
#define EM_ESCOPE_HOOKS_REGISTER_FREE   (EM_ESCOPE_INTERNAL_MASK | 0x0203)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_FREE   (EM_ESCOPE_INTERNAL_MASK | 0x0204)
 
#define EM_ESCOPE_HOOKS_REGISTER_SEND   (EM_ESCOPE_INTERNAL_MASK | 0x0205)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_SEND   (EM_ESCOPE_INTERNAL_MASK | 0x0206)
 
#define EM_ESCOPE_HOOKS_REGISTER_TO_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x0207)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_TO_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x0208)
 
#define EM_ESCOPE_HOOKS_REGISTER_TO_ACTIVE   (EM_ESCOPE_INTERNAL_MASK | 0x0209)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_TO_ACTIVE   (EM_ESCOPE_INTERNAL_MASK | 0x020A)
 
#define EM_ESCOPE_HOOKS_REGISTER_WHILE_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x020B)
 
#define EM_ESCOPE_HOOKS_UNREGISTER_WHILE_IDLE
 
#define EM_ESCOPE_EVENT_SEND_DEVICE   (EM_ESCOPE_INTERNAL_MASK | 0x0301)
 
#define EM_ESCOPE_EVENT_SEND_DEVICE_MULTI   (EM_ESCOPE_INTERNAL_MASK | 0x0302)
 
#define EM_ESCOPE_EVENT_GROUP_UPDATE   (EM_ESCOPE_INTERNAL_MASK | 0x0501)
 
#define EM_ESCOPE_QUEUE_ENABLE   (EM_ESCOPE_INTERNAL_MASK | 0x0601)
 
#define EM_ESCOPE_QUEUE_ENABLE_ALL   (EM_ESCOPE_INTERNAL_MASK | 0x0602)
 
#define EM_ESCOPE_QUEUE_DISABLE   (EM_ESCOPE_INTERNAL_MASK | 0x0603)
 
#define EM_ESCOPE_QUEUE_DISABLE_ALL   (EM_ESCOPE_INTERNAL_MASK | 0x0604)
 
#define EM_ESCOPE_QUEUE_STATE_CHANGE   (EM_ESCOPE_INTERNAL_MASK | 0x0605)
 
#define EM_ESCOPE_QUEUE_GROUP_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0701)
 
#define EM_ESCOPE_QUEUE_GROUP_INIT_LOCAL   (EM_ESCOPE_INTERNAL_MASK | 0x0702)
 
#define EM_ESCOPE_QUEUE_GROUP_DEFAULT   (EM_ESCOPE_INTERNAL_MASK | 0x0703)
 
#define EM_ESCOPE_QUEUE_GROUP_ADD_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0704)
 
#define EM_ESCOPE_QUEUE_GROUP_REM_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0705)
 
#define EM_ESCOPE_EO_START_DONE_CB   (EM_ESCOPE_INTERNAL_MASK | 0x0801)
 
#define EM_ESCOPE_EO_START_SYNC_DONE_CB   (EM_ESCOPE_INTERNAL_MASK | 0x0802)
 
#define EM_ESCOPE_EO_STOP_DONE_CB   (EM_ESCOPE_INTERNAL_MASK | 0x0803)
 
#define EM_ESCOPE_EO_STOP_SYNC_DONE_CB   (EM_ESCOPE_INTERNAL_MASK | 0x0804)
 
#define EM_ESCOPE_EO_REMOVE_QUEUE_DONE_CB   (EM_ESCOPE_INTERNAL_MASK | 0x0805)
 
#define EM_ESCOPE_EO_REMOVE_QUEUE_SYNC_DONE_CB
 
#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_DONE_CB
 
#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_SYNC_DONE_CB
 
#define EM_ESCOPE_EO_LOCAL_FUNC_CALL_REQ   (EM_ESCOPE_INTERNAL_MASK | 0x0809)
 
#define EM_ESCOPE_INTERNAL_NOTIF   (EM_ESCOPE_INTERNAL_MASK | 0x080A)
 
#define EM_ESCOPE_INTERNAL_EVENT_RECV_FUNC   (EM_ESCOPE_INTERNAL_MASK | 0x080B)
 
#define EM_ESCOPE_EVENT_INTERNAL_DONE   (EM_ESCOPE_INTERNAL_MASK | 0x080C)
 
#define EM_ESCOPE_EVENT_INTERNAL_LFUNC_CALL   (EM_ESCOPE_INTERNAL_MASK | 0x080D)
 
#define EM_ESCOPE_INTERNAL_DONE_W_NOTIF_REQ   (EM_ESCOPE_INTERNAL_MASK | 0x080E)
 
#define EM_ESCOPE_CREATE_CTRL_QUEUES   (EM_ESCOPE_INTERNAL_MASK | 0x080F)
 
#define EM_ESCOPE_DELETE_CTRL_QUEUES   (EM_ESCOPE_INTERNAL_MASK | 0x0810)
 
#define EM_ESCOPE_POLL_UNSCHED_CTRL_QUEUE   (EM_ESCOPE_INTERNAL_MASK | 0x0811)
 
#define EM_ESCOPE_EVENT_TO_HDR   (EM_ESCOPE_INTERNAL_MASK | 0x0812)
 
#define EM_ESCOPE_EVENT_TO_HDR_MULTI   (EM_ESCOPE_INTERNAL_MASK | 0x0813)
 
#define EM_ESCOPE_EVENT_INIT_ODP   (EM_ESCOPE_INTERNAL_MASK | 0x0814)
 
#define EM_ESCOPE_EVENT_INIT_ODP_MULTI   (EM_ESCOPE_INTERNAL_MASK | 0x0815)
 
#define EM_ESCOPE_ODP_EXT   (EM_ESCOPE_INTERNAL_MASK | 0x1000)
 

Typedefs

typedef enum em_event_type_major_e em_event_type_major_e
 
typedef enum em_event_type_sw_minor_e em_event_type_sw_minor_e
 
typedef enum em_queue_type_e em_queue_type_e
 
typedef enum em_queue_prio_e em_queue_prio_e
 
typedef enum em_status_e em_status_e
 
typedef int(* em_log_func_t) (em_log_level_t level, const char *fmt,...) __attribute__((format(printf
 
typedef int(*) typedef int(* em_vlog_func_t) (em_log_level_t level, const char *fmt, va_list args)
 
typedef int(* em_input_poll_func_t) (void)
 
typedef int(* em_output_drain_func_t) (void)
 
typedef int(* em_output_func_t) (const em_event_t events[], const unsigned int num, const em_queue_t output_queue, void *output_fn_args)
 

Enumerations

enum  em_event_type_major_e {
  EM_EVENT_TYPE_UNDEF = 0, EM_EVENT_TYPE_SW = 1 << 24, EM_EVENT_TYPE_PACKET = 2 << 24, EM_EVENT_TYPE_TIMER = 3 << 24,
  EM_EVENT_TYPE_CRYPTO = 4 << 24, EM_EVENT_TYPE_VECTOR = 5 << 24, EM_EVENT_TYPE_TIMER_IND = 6 << 24
}
 
enum  em_event_type_sw_minor_e { EM_EVENT_TYPE_SW_DEFAULT = 0 }
 
enum  em_queue_type_e {
  EM_QUEUE_TYPE_UNDEF = 0, EM_QUEUE_TYPE_ATOMIC = 1, EM_QUEUE_TYPE_PARALLEL = 2, EM_QUEUE_TYPE_PARALLEL_ORDERED = 3,
  EM_QUEUE_TYPE_UNSCHEDULED = 4, EM_QUEUE_TYPE_LOCAL = 5, EM_QUEUE_TYPE_OUTPUT = 6
}
 
enum  em_queue_prio_e {
  EM_QUEUE_PRIO_LOWEST = 0, EM_QUEUE_PRIO_LOW = 2, EM_QUEUE_PRIO_NORMAL = 4, EM_QUEUE_PRIO_HIGH = 6,
  EM_QUEUE_PRIO_HIGHEST = 7
}
 
enum  em_status_e {
  EM_ERR_BAD_ARG = 1, EM_ERR_BAD_STATE = 2, EM_ERR_BAD_ID = 3, EM_ERR_BAD_TYPE = 4,
  EM_ERR_BAD_CONTEXT = 5, EM_ERR_BAD_POINTER = 6, EM_ERR_NOT_CREATED = 7, EM_ERR_NOT_FREE = 8,
  EM_ERR_NOT_FOUND = 9, EM_ERR_NOT_INITIALIZED = 10, EM_ERR_NOT_IMPLEMENTED = 11, EM_ERR_NOT_SUPPORTED = 12,
  EM_ERR_ALLOC_FAILED = 13, EM_ERR_OPERATION_FAILED = 14, EM_ERR_LIB_FAILED = 15, EM_ERR_TOO_LARGE = 16,
  EM_ERR_TOO_SMALL = 17, EM_ERR_EVENT_STATE = 18, EM_ERR_TIMEOUT = 19, EM_ERR_TOONEAR = 20,
  EM_ERR_TOOFAR = 21, EM_ERR_CANCELED = 22, EM_ERR
}
 
enum  em_log_level_t { EM_LOG_DBG, EM_LOG_PRINT, EM_LOG_ERR }
 

Functions

 EM_HANDLE_T (em_pool_t)
 

Detailed Description

Event Machine HW specific types

Definition in file event_machine_hw_types.h.

Macro Definition Documentation

◆ EM_CORE_MASK_STRLEN

#define EM_CORE_MASK_STRLEN   ((EM_MAX_CORES + 3) / 4 + 3)

Number of chars needed to hold core mask as a string:'0xcoremask' + '\0'

Examples
queue_group.c.

Definition at line 247 of file event_machine_hw_types.h.

◆ EM_ERROR_FATAL_MASK

#define EM_ERROR_FATAL_MASK   0x80000000

Fatal error mask

Definition at line 418 of file event_machine_hw_types.h.

◆ EM_ERROR_IS_FATAL

#define EM_ERROR_IS_FATAL (   error)    (!!(EM_ERROR_FATAL_MASK & (error)))

Test if error is fatal

Examples
error.c, queue_groups.c, queues.c, queues_local.c, queues_output.c, queues_unscheduled.c, and send_multi.c.

Definition at line 423 of file event_machine_hw_types.h.

◆ EM_ERROR_SET_FATAL

◆ EM_ESCOPE_CONF_INIT

#define EM_ESCOPE_CONF_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0001)

EM error scope: initialize the Event Machine em_conf_t struct

Definition at line 458 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EO_REMOVE_QUEUE_ALL_DONE_CB

#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_DONE_CB
Value:

Definition at line 656 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EO_REMOVE_QUEUE_ALL_SYNC_DONE_CB

#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_SYNC_DONE_CB
Value:

Definition at line 658 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EO_REMOVE_QUEUE_SYNC_DONE_CB

#define EM_ESCOPE_EO_REMOVE_QUEUE_SYNC_DONE_CB
Value:

Definition at line 654 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EVENT_GROUP_UPDATE

#define EM_ESCOPE_EVENT_GROUP_UPDATE   (EM_ESCOPE_INTERNAL_MASK | 0x0501)

EM internal esope: Update the event group count

Examples
event_group_abort.c.

Definition at line 632 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EVENT_SEND_DEVICE

#define EM_ESCOPE_EVENT_SEND_DEVICE   (EM_ESCOPE_INTERNAL_MASK | 0x0301)

EM error scope: send event to another device

Definition at line 621 of file event_machine_hw_types.h.

◆ EM_ESCOPE_EVENT_SEND_DEVICE_MULTI

#define EM_ESCOPE_EVENT_SEND_DEVICE_MULTI   (EM_ESCOPE_INTERNAL_MASK | 0x0302)

EM error scope: send event(s) to another device

Definition at line 626 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_ALLOC

#define EM_ESCOPE_HOOKS_REGISTER_ALLOC   (EM_ESCOPE_INTERNAL_MASK | 0x0201)

EM error scope: register API callback hook for em_alloc()

Definition at line 559 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_FREE

#define EM_ESCOPE_HOOKS_REGISTER_FREE   (EM_ESCOPE_INTERNAL_MASK | 0x0203)

EM error scope: register API callback hook for em_free()

Definition at line 569 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_SEND

#define EM_ESCOPE_HOOKS_REGISTER_SEND   (EM_ESCOPE_INTERNAL_MASK | 0x0205)

EM error scope: register API callback hook for em_send-variants

Definition at line 579 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_TO_ACTIVE

#define EM_ESCOPE_HOOKS_REGISTER_TO_ACTIVE   (EM_ESCOPE_INTERNAL_MASK | 0x0209)

EM error scope: register an idle hook called when entering the active state

Definition at line 599 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_TO_IDLE

#define EM_ESCOPE_HOOKS_REGISTER_TO_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x0207)

EM error scope: register an idle hook called when entering the idle state

Definition at line 589 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_REGISTER_WHILE_IDLE

#define EM_ESCOPE_HOOKS_REGISTER_WHILE_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x020B)

EM error scope: register an idle hook called while staying in idle state

Definition at line 609 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_ALLOC

#define EM_ESCOPE_HOOKS_UNREGISTER_ALLOC   (EM_ESCOPE_INTERNAL_MASK | 0x0202)

EM error scope: unregister API callback hook for em_alloc()

Definition at line 564 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_FREE

#define EM_ESCOPE_HOOKS_UNREGISTER_FREE   (EM_ESCOPE_INTERNAL_MASK | 0x0204)

EM error scope: unregister API callback hook for em_free()

Definition at line 574 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_SEND

#define EM_ESCOPE_HOOKS_UNREGISTER_SEND   (EM_ESCOPE_INTERNAL_MASK | 0x0206)

EM error scope: unregister API callback hook for em_send-variants

Definition at line 584 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_TO_ACTIVE

#define EM_ESCOPE_HOOKS_UNREGISTER_TO_ACTIVE   (EM_ESCOPE_INTERNAL_MASK | 0x020A)

EM error scope: unregister an idle hook called when entering the active state

Definition at line 604 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_TO_IDLE

#define EM_ESCOPE_HOOKS_UNREGISTER_TO_IDLE   (EM_ESCOPE_INTERNAL_MASK | 0x0208)

EM error scope: unregister an idle hook called when entering the idle state

Definition at line 594 of file event_machine_hw_types.h.

◆ EM_ESCOPE_HOOKS_UNREGISTER_WHILE_IDLE

#define EM_ESCOPE_HOOKS_UNREGISTER_WHILE_IDLE
Value:

EM error scope: unregister an idle hook called while staying in idle state

Definition at line 614 of file event_machine_hw_types.h.

◆ EM_ESCOPE_INIT

#define EM_ESCOPE_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0002)

EM error scope: initialize the Event Machine

Definition at line 463 of file event_machine_hw_types.h.

◆ EM_ESCOPE_INIT_CORE

#define EM_ESCOPE_INIT_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0003)

EM error scope: initialize an Event Machine core

Definition at line 468 of file event_machine_hw_types.h.

◆ EM_ESCOPE_INTERNAL

#define EM_ESCOPE_INTERNAL (   escope)
Value:

Test if the error scope identifies an EM Internal function

Definition at line 451 of file event_machine_hw_types.h.

◆ EM_ESCOPE_INTERNAL_MASK

#define EM_ESCOPE_INTERNAL_MASK
Value:

EM Internal (non-public API) functions error mask

See also
EM_ESCOPE_API_TYPE and EM_ESCOPE_API_MASK used by the public CLI (Command Line Interface) related API.

Definition at line 445 of file event_machine_hw_types.h.

◆ EM_ESCOPE_INTERNAL_TYPE

#define EM_ESCOPE_INTERNAL_TYPE   (0xFEu)

EM Internal (non-public API) functions error scope

See also
EM_ESCOPE_API_TYPE and EM_ESCOPE_API_MASK used by the public CLI (Command Line Interface) related API.

Definition at line 438 of file event_machine_hw_types.h.

◆ EM_ESCOPE_ODP_EXT

#define EM_ESCOPE_ODP_EXT   (EM_ESCOPE_INTERNAL_MASK | 0x1000)

EM ODP extensions error scope

Definition at line 678 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_CFG_INIT

#define EM_ESCOPE_POOL_CFG_INIT   (EM_ESCOPE_INTERNAL_MASK | 0x0101)

EM error scope: create an event pool

Definition at line 484 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_CREATE

#define EM_ESCOPE_POOL_CREATE   (EM_ESCOPE_INTERNAL_MASK | 0x0102)

EM error scope: create an event pool

Definition at line 489 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_DELETE

#define EM_ESCOPE_POOL_DELETE   (EM_ESCOPE_INTERNAL_MASK | 0x0103)

EM error scope: delete an event pool

Definition at line 494 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_FIND

#define EM_ESCOPE_POOL_FIND   (EM_ESCOPE_INTERNAL_MASK | 0x0104)

EM error scope: find an event pool by name

Definition at line 499 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_GET_FIRST

#define EM_ESCOPE_POOL_GET_FIRST   (EM_ESCOPE_INTERNAL_MASK | 0x0106)

EM error scope: event pool iteration - get first of iteration

Definition at line 509 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_GET_NAME

#define EM_ESCOPE_POOL_GET_NAME   (EM_ESCOPE_INTERNAL_MASK | 0x0105)

EM error scope: get an event pool name

Definition at line 504 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_GET_NEXT

#define EM_ESCOPE_POOL_GET_NEXT   (EM_ESCOPE_INTERNAL_MASK | 0x0107)

EM error scope: event pool iteration - get next of iteration

Definition at line 514 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_INFO

#define EM_ESCOPE_POOL_INFO   (EM_ESCOPE_INTERNAL_MASK | 0x0108)

EM error scope: event pool info & statistics

Definition at line 519 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_NUM_SUBPOOLS

#define EM_ESCOPE_POOL_NUM_SUBPOOLS   (EM_ESCOPE_INTERNAL_MASK | 0x010F)

EM error scope: event pool number of subpools

Definition at line 554 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_STATS

#define EM_ESCOPE_POOL_STATS   (EM_ESCOPE_INTERNAL_MASK | 0x0109)

EM error scope: event pool statistics

Definition at line 524 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_STATS_RESET

#define EM_ESCOPE_POOL_STATS_RESET   (EM_ESCOPE_INTERNAL_MASK | 0x010A)

EM error scope: event pool statistics

Definition at line 529 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_STATS_SELECTED

#define EM_ESCOPE_POOL_STATS_SELECTED   (EM_ESCOPE_INTERNAL_MASK | 0x010D)

EM error scope: event pool statistics selected

Definition at line 544 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_SUBPOOL_STATS

#define EM_ESCOPE_POOL_SUBPOOL_STATS   (EM_ESCOPE_INTERNAL_MASK | 0x010B)

EM error scope: event pool subpool statistics

Definition at line 534 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_SUBPOOL_STATS_RESET

#define EM_ESCOPE_POOL_SUBPOOL_STATS_RESET   (EM_ESCOPE_INTERNAL_MASK | 0x010C)

EM error scope: event pool subpool statistics

Definition at line 539 of file event_machine_hw_types.h.

◆ EM_ESCOPE_POOL_SUBPOOL_STATS_SELECTED

#define EM_ESCOPE_POOL_SUBPOOL_STATS_SELECTED   (EM_ESCOPE_INTERNAL_MASK | 0x010E)

EM error scope: event pool subpool statistics selected

Definition at line 549 of file event_machine_hw_types.h.

◆ EM_ESCOPE_TERM

#define EM_ESCOPE_TERM   (EM_ESCOPE_INTERNAL_MASK | 0x0004)

EM error scope: terminate the Event Machine

Definition at line 473 of file event_machine_hw_types.h.

◆ EM_ESCOPE_TERM_CORE

#define EM_ESCOPE_TERM_CORE   (EM_ESCOPE_INTERNAL_MASK | 0x0005)

EM error scope: terminate an Event Machine core

Definition at line 478 of file event_machine_hw_types.h.

◆ EM_POOL_UNDEF

◆ EM_QUEUE_FLAG_BLOCKING

#define EM_QUEUE_FLAG_BLOCKING   0 /* blocking, fastest (default) */

Blocking queue implementation. A suspeding thread may block all other threads, i.e. no block freedom guarantees. Implied by EM_QUEUE_FLAG_DEFAULT for the implementation on this system.

Definition at line 179 of file event_machine_hw_types.h.

◆ EM_QUEUE_FLAG_DEFAULT

#define EM_QUEUE_FLAG_DEFAULT   0

em_queue_flag_t values (system specific): Only combine with bitwise OR.

em_queue_flag_t default value. The EM queues will use implementation specific default values. The default values for this implementation values imply: EM_QUEUE_FLAG_DEFAULT = MTSAFE and BLOCKING queue implementation

Examples
bench_event.c, and queues_output.c.

Definition at line 171 of file event_machine_hw_types.h.

◆ EM_QUEUE_FLAG_DEQ_NOT_MTSAFE

#define EM_QUEUE_FLAG_DEQ_NOT_MTSAFE   8

em_queue_flag_t value (system specific). Only combine flags with bitwise OR.

Default multithread safe dequeue implementation not needed, the application guarantees there is no concurrent accesses in dequeue, i.e. em_queue_dequeue(). This can only be used with unscheduled queues and can potentially improve performance. The implementation may choose to ignore this flag. Use with care.

Examples
queues_unscheduled.c, and send_multi.c.

Definition at line 229 of file event_machine_hw_types.h.

◆ EM_QUEUE_FLAG_ENQ_NOT_MTSAFE

#define EM_QUEUE_FLAG_ENQ_NOT_MTSAFE   4

em_queue_flag_t value (system specific). Only combine flags with bitwise OR.

Default multithread safe enqueue implementation not needed, the application guarantees there is no concurrent accesses in enqueue, i.e. em_send(). This can only be used with unscheduled queues and can potentially improve performance. The implementation may choose to ignore this flag. Use with care.

Examples
queues_unscheduled.c, and send_multi.c.

Definition at line 216 of file event_machine_hw_types.h.

◆ EM_QUEUE_FLAG_NONBLOCKING_LF

#define EM_QUEUE_FLAG_NONBLOCKING_LF   1 /* non-blocking, lock-free */

em_queue_flag_t value (system specific). Only combine flags with bitwise OR.

Require a non-blocking and lock-free queue implementation. Other threads can make progress while a thread is suspended. Starvation freedom is not guaranteed. Queue creation will fail if set and not supported.

Definition at line 191 of file event_machine_hw_types.h.

◆ EM_QUEUE_FLAG_NONBLOCKING_WF

#define EM_QUEUE_FLAG_NONBLOCKING_WF   2 /* non-blocking, wait-free */

em_queue_flag_t value (system specific). Only combine flags with bitwise OR.

Require a non-blocking and wait-free queue implementation. Other threads can make progress while a thread is suspended. Starvation freedom is guaranteed. Queue creation will fail if set and not supported.

Definition at line 203 of file event_machine_hw_types.h.

◆ EM_QUEUE_PRIO_UNDEF

#define EM_QUEUE_PRIO_UNDEF   0xFF

Undefined

Examples
bench_event.c, queues_unscheduled.c, and send_multi.c.

Definition at line 157 of file event_machine_hw_types.h.

◆ PRI_POOL

Typedef Documentation

◆ em_event_type_major_e

Major event types.

◆ em_input_poll_func_t

typedef int(* em_input_poll_func_t) (void)

Input poll function - poll various input sources for pkts/events and enqueue into EM.

User provided function - EM calls this, if not NULL, in the dispatch loop on each core - set via 'em_conf.input.input_poll_fn'

Returns
number of pkts/events received from input and enqueued into EM

Definition at line 349 of file event_machine_hw_types.h.

◆ em_log_func_t

typedef int(* em_log_func_t) (em_log_level_t level, const char *fmt,...) __attribute__((format(printf

EM log function, variable number of args

Note
: both 'log()' and 'vlog()' need to be implemented if used.

Definition at line 329 of file event_machine_hw_types.h.

◆ em_output_drain_func_t

typedef int(* em_output_drain_func_t) (void)

'Periodical' draining of output from EM, if needed.

User provided function - EM calls this, if not NULL, in the dispatch loop on each core - set via 'em_conf.output.output_drain_fn'

Draining of output events/pkts: EM will every once in a while call this user provided function to ensure that low rate buffered output is eventually sent out. Not needed if your EM output queues (EM_QUEUE_TYPE_OUTPUT) always sends all events out. Useful in situations where output is buffered and sent out in bursts when enough output has been gathered - single events or low rate flows may, without this function, never be sent out (or too late) if the buffering threshold has not been reached.

Returns
number of events successfully drained and sent for output

Definition at line 367 of file event_machine_hw_types.h.

◆ em_output_func_t

typedef int(* em_output_func_t) (const em_event_t events[], const unsigned int num, const em_queue_t output_queue, void *output_fn_args)

Output function, user provided callback for queues of type EM_QUEUE_TYPE_OUTPUT.

This function will be called by em_send*() when sending to a queue of type EM_QUEUE_TYPE_OUTPUT and EM will take care of correct function calling order based on the scheduling context type. The function can use em_sched_context_type_current() if it needs information about e.g. ordering requirements set by the parent scheduled queue.

Parameters
eventsList of events to be sent out (ptr to array of events)
numNumber of events (positive integer)
output_queueOutput queue that the events were sent to (em_send*())
output_fn_argsExtra arguments to indicate e.g. ordering requirement of the source context.
Returns
number of events successfully sent (equal to num if all successful)

Definition at line 387 of file event_machine_hw_types.h.

◆ em_queue_prio_e

Portable queue priorities.

These are generic portable values to use for priority.

Alternatively application may choose to use numeric values in the valid range (from 0 to em_queue_get_num_prio() - 1).

See also
em_queue_prio_t, em_queue_get_num_prio()

◆ em_queue_type_e

Queue types

◆ em_status_e

typedef enum em_status_e em_status_e

Error/Status codes

◆ em_vlog_func_t

typedef int(*) typedef int(* em_vlog_func_t) (em_log_level_t level, const char *fmt, va_list args)

EM log function, va_list instead of variable number of args

Note
: both 'log()' and 'vlog()' need to be implemented if used.

Definition at line 337 of file event_machine_hw_types.h.

Enumeration Type Documentation

◆ em_event_type_major_e

Major event types.

Enumerator
EM_EVENT_TYPE_UNDEF 

Undef event type

EM_EVENT_TYPE_SW 

SW event

EM_EVENT_TYPE_PACKET 

Packet event

EM_EVENT_TYPE_TIMER 

Timer event

EM_EVENT_TYPE_CRYPTO 

Crypto event

EM_EVENT_TYPE_VECTOR 

Event contains a (packet) vector

EM_EVENT_TYPE_TIMER_IND 

Ring timer: read-only, no-payload periodic timeout indication. Only the ring timer should set this type, the user must never set this type manually via em_alloc...() or em_event_set_type().

Definition at line 67 of file event_machine_hw_types.h.

◆ em_event_type_sw_minor_e

Minor event types for the major EM_EVENT_TYPE_SW type.

Definition at line 98 of file event_machine_hw_types.h.

◆ em_log_level_t

EM log level

Definition at line 318 of file event_machine_hw_types.h.

◆ em_queue_prio_e

Portable queue priorities.

These are generic portable values to use for priority.

Alternatively application may choose to use numeric values in the valid range (from 0 to em_queue_get_num_prio() - 1).

See also
em_queue_prio_t, em_queue_get_num_prio()
Enumerator
EM_QUEUE_PRIO_LOWEST 

Lowest

EM_QUEUE_PRIO_LOW 

Low

EM_QUEUE_PRIO_NORMAL 

Normal

EM_QUEUE_PRIO_HIGH 

High

EM_QUEUE_PRIO_HIGHEST 

Highest

Definition at line 150 of file event_machine_hw_types.h.

◆ em_queue_type_e

Queue types

Enumerator
EM_QUEUE_TYPE_UNDEF 

Undefined

EM_QUEUE_TYPE_ATOMIC 

The application receives events one by one, non-concurrently to guarantee exclusive processing and ordering

EM_QUEUE_TYPE_PARALLEL 

The application may receive events fully concurrently, egress event ordering (when processed in parallel) not guaranteed

EM_QUEUE_TYPE_PARALLEL_ORDERED 

The application may receive events concurrently, but the system takes care of egress order (between two queues)

EM_QUEUE_TYPE_UNSCHEDULED 

A queue which is not connected to scheduling. The application needs to explicitly dequeue events

EM_QUEUE_TYPE_LOCAL 

A queue type for local virtual queue not connected to scheduling.

EM_QUEUE_TYPE_OUTPUT 

A system specific queue type to abstract output from EM, e.g. packet output or output towards a HW accelerator. The application uses em_send() and variants to send an event 'out'.

Definition at line 105 of file event_machine_hw_types.h.

◆ em_status_e

Error/Status codes

Enumerator
EM_ERR_BAD_ARG 

Invalid argument

EM_ERR_BAD_STATE 

Illegal state

EM_ERR_BAD_ID 

ID not from a valid range

EM_ERR_BAD_TYPE 

Invalid type

EM_ERR_BAD_CONTEXT 

Illegal context

EM_ERR_BAD_POINTER 

Pointer from bad memory area (e.g. NULL)

EM_ERR_NOT_CREATED 

Resource not created

EM_ERR_NOT_FREE 

Resource already reserved by someone else

EM_ERR_NOT_FOUND 

Resource not found

EM_ERR_NOT_INITIALIZED 

Not properly initialized (e.g. not using provided initializer)

EM_ERR_NOT_IMPLEMENTED 

Implementation missing (placeholder)

EM_ERR_NOT_SUPPORTED 

Feature or value combination is not supported

EM_ERR_ALLOC_FAILED 

Resource allocation failed

EM_ERR_OPERATION_FAILED 

Operation failed

EM_ERR_LIB_FAILED 

Failure in a library function

EM_ERR_TOO_LARGE 

Value over the limit

EM_ERR_TOO_SMALL 

Value under the limit

EM_ERR_EVENT_STATE 

ESV (reserved): Invalid event state detected, e.g. double-free

EM_ERR_TIMEOUT 

Operation timeout (e.g. waiting on a lock)

EM_ERR_TOONEAR 

Operation is too near current time or in past

EM_ERR_TOOFAR 

Time target too far, e.g. timeout exceeds maximum supported value

EM_ERR_CANCELED 

Timeout was canceled, e.g. periodic timer

EM_ERR 

Other error. This is the last error code (for bounds checking)

Definition at line 259 of file event_machine_hw_types.h.

EM_ESCOPE_INTERNAL_TYPE
#define EM_ESCOPE_INTERNAL_TYPE
Definition: event_machine_hw_types.h:438
EM_ESCOPE_BIT
#define EM_ESCOPE_BIT
Definition: event_machine_types.h:359
EM_ESCOPE_MASK
#define EM_ESCOPE_MASK
Definition: event_machine_types.h:371
EM_ESCOPE_INTERNAL_MASK
#define EM_ESCOPE_INTERNAL_MASK
Definition: event_machine_hw_types.h:445