EM-ODP
3.7.0
Event Machine on ODP
|
#include <odp/api/cpumask.h>
Go to the source code of this file.
Data Structures | |
struct | em_core_mask_t |
struct | em_output_queue_conf_t |
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) |
Functions | |
EM_HANDLE_T (em_pool_t) | |
Event Machine HW specific types
Definition in file event_machine_hw_types.h.
#define EM_CORE_MASK_STRLEN ((EM_MAX_CORES + 3) / 4 + 3) |
Number of chars needed to hold core mask as a string:'0xcoremask' + '\0'
Definition at line 247 of file event_machine_hw_types.h.
#define EM_ERROR_FATAL_MASK 0x80000000 |
Fatal error mask
Definition at line 418 of file event_machine_hw_types.h.
#define EM_ERROR_IS_FATAL | ( | error | ) | (!!(EM_ERROR_FATAL_MASK & (error))) |
Test if error is fatal
Definition at line 423 of file event_machine_hw_types.h.
#define EM_ERROR_SET_FATAL | ( | error | ) | (EM_ERROR_FATAL_MASK | (error)) |
Set a fatal error code
Definition at line 428 of file event_machine_hw_types.h.
#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.
#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_DONE_CB |
Definition at line 656 of file event_machine_hw_types.h.
#define EM_ESCOPE_EO_REMOVE_QUEUE_ALL_SYNC_DONE_CB |
Definition at line 658 of file event_machine_hw_types.h.
#define EM_ESCOPE_EO_REMOVE_QUEUE_SYNC_DONE_CB |
Definition at line 654 of file event_machine_hw_types.h.
#define EM_ESCOPE_EVENT_GROUP_UPDATE (EM_ESCOPE_INTERNAL_MASK | 0x0501) |
EM internal esope: Update the event group count
Definition at line 632 of file event_machine_hw_types.h.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#define EM_ESCOPE_HOOKS_UNREGISTER_WHILE_IDLE |
EM error scope: unregister an idle hook called while staying in idle state
Definition at line 614 of file event_machine_hw_types.h.
#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.
#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.
#define EM_ESCOPE_INTERNAL | ( | escope | ) |
Test if the error scope identifies an EM Internal function
Definition at line 451 of file event_machine_hw_types.h.
#define EM_ESCOPE_INTERNAL_MASK |
EM Internal (non-public API) functions error mask
Definition at line 445 of file event_machine_hw_types.h.
#define EM_ESCOPE_INTERNAL_TYPE (0xFEu) |
EM Internal (non-public API) functions error scope
Definition at line 438 of file event_machine_hw_types.h.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#define EM_POOL_UNDEF EM_STATIC_CAST(em_pool_t, EM_HDL_UNDEF) |
Undefined EM pool
Definition at line 60 of file event_machine_hw_types.h.
#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.
#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
Definition at line 171 of file event_machine_hw_types.h.
#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.
Definition at line 229 of file event_machine_hw_types.h.
#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.
Definition at line 216 of file event_machine_hw_types.h.
#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.
#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.
#define EM_QUEUE_PRIO_UNDEF 0xFF |
Undefined
Definition at line 157 of file event_machine_hw_types.h.
#define PRI_POOL PRI_HDL |
em_pool_t printf format
Definition at line 62 of file event_machine_hw_types.h.
typedef enum em_event_type_major_e em_event_type_major_e |
Major event types.
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'
Definition at line 349 of file event_machine_hw_types.h.
typedef int(* em_log_func_t) (em_log_level_t level, const char *fmt,...) __attribute__((format(printf |
EM log function, variable number of args
Definition at line 329 of file event_machine_hw_types.h.
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.
Definition at line 367 of file event_machine_hw_types.h.
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.
events | List of events to be sent out (ptr to array of events) |
num | Number of events (positive integer) |
output_queue | Output queue that the events were sent to (em_send*()) |
output_fn_args | Extra arguments to indicate e.g. ordering requirement of the source context. |
Definition at line 387 of file event_machine_hw_types.h.
typedef enum em_queue_prio_e 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).
typedef enum em_queue_type_e em_queue_type_e |
Queue types
typedef enum em_status_e em_status_e |
Error/Status codes
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
Definition at line 337 of file event_machine_hw_types.h.
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.
Minor event types for the major EM_EVENT_TYPE_SW type.
Definition at line 98 of file event_machine_hw_types.h.
enum em_log_level_t |
EM log level
Definition at line 318 of file event_machine_hw_types.h.
enum 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).
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.
enum 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.
enum em_status_e |
Error/Status codes
Definition at line 259 of file event_machine_hw_types.h.