API Reference Manual
1.46.0
|
Generic event metadata and operations.
Macros | |
#define | ODP_EVENT_INVALID ((odp_event_t)0) |
Invalid event. | |
Typedefs | |
typedef _odp_abi_event_t * | odp_event_t |
ODP event. | |
Enumerations | |
enum | odp_event_type_t { ODP_EVENT_BUFFER = 1 , ODP_EVENT_PACKET = 2 , ODP_EVENT_TIMEOUT = 3 , ODP_EVENT_IPSEC_STATUS = 5 , ODP_EVENT_PACKET_VECTOR = 6 , ODP_EVENT_PACKET_TX_COMPL = 7 , ODP_EVENT_DMA_COMPL = 8 , ODP_EVENT_ML_COMPL = 9 } |
Event type. More... | |
enum | odp_event_subtype_t { ODP_EVENT_NO_SUBTYPE = 0 , ODP_EVENT_PACKET_BASIC = 1 , ODP_EVENT_PACKET_CRYPTO = 2 , ODP_EVENT_PACKET_IPSEC = 3 , ODP_EVENT_PACKET_COMP = 4 , ODP_EVENT_ML_COMPL_LOAD = 5 , ODP_EVENT_ML_COMPL_RUN = 6 } |
Event subtype. More... | |
Functions | |
odp_event_type_t | odp_event_type (odp_event_t event) |
Event type of an event. More... | |
odp_event_subtype_t | odp_event_subtype (odp_event_t event) |
Event subtype of an event. More... | |
odp_event_type_t | odp_event_types (odp_event_t event, odp_event_subtype_t *subtype) |
Event type and subtype of an event. More... | |
void | odp_event_types_multi (const odp_event_t event[], odp_event_type_t type[], odp_event_subtype_t subtype[], int num) |
Event types and subtypes of multiple events. More... | |
int | odp_event_type_multi (const odp_event_t event[], int num, odp_event_type_t *type) |
Event type of multiple events. More... | |
odp_pool_t | odp_event_pool (odp_event_t event) |
Event pool. More... | |
void * | odp_event_user_area (odp_event_t event) |
Event user area. More... | |
void * | odp_event_user_area_and_flag (odp_event_t event, int *flag) |
Event user area and flag. More... | |
void | odp_event_user_flag_set (odp_event_t event, int val) |
Set event user flag. More... | |
int | odp_event_filter_packet (const odp_event_t event[], odp_packet_t packet[], odp_event_t remain[], int num) |
Filter and convert packet events. More... | |
uint64_t | odp_event_to_u64 (odp_event_t hdl) |
Get printable value for an odp_event_t. More... | |
int | odp_event_is_valid (odp_event_t event) |
Check that event is valid. More... | |
void | odp_event_free (odp_event_t event) |
Free event. More... | |
void | odp_event_free_multi (const odp_event_t event[], int num) |
Free multiple events. More... | |
void | odp_event_free_sp (const odp_event_t event[], int num) |
Free multiple events to the same pool. More... | |
uint32_t | odp_event_flow_id (odp_event_t event) |
Event flow id value. More... | |
void | odp_event_flow_id_set (odp_event_t event, uint32_t flow_id) |
Set event flow id value. More... | |
enum odp_event_type_t |
Event type.
Event type specifies purpose and general format of an event. It can be checked with odp_event_type() or odp_event_types(). Each event type has functions (e.g. odp_buffer_from_event()) to convert between the generic event handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t). Results are undefined, if conversion function of a wrong event type is used. Application cannot change event type by chaining conversion functions.
List of event types:
Definition at line 26 of file api/abi-default/event_types.h.
enum odp_event_subtype_t |
Event subtype.
Event subtype expands event type specification by providing more detailed purpose and format of an event. It can be checked with odp_event_subtype() or odp_event_types(). Each event subtype may define specific functions (e.g. odp_ipsec_packet_from_event()) to convert between the generic event handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). When subtype is known, these subtype specific functions should be preferred over the event type general function (e.g. odp_packet_from_event()). Results are undefined, if conversion function of a wrong event subtype is used. Application cannot change event subtype by chaining conversion functions.
List of event subtypes:
Definition at line 37 of file api/abi-default/event_types.h.
odp_event_type_t odp_event_type | ( | odp_event_t | event | ) |
Event type of an event.
Event type specifies purpose and general format of an event.
event | Event handle |
odp_event_subtype_t odp_event_subtype | ( | odp_event_t | event | ) |
Event subtype of an event.
Event subtype expands event type specification by providing more detailed purpose and format of an event.
event | Event handle |
odp_event_type_t odp_event_types | ( | odp_event_t | event, |
odp_event_subtype_t * | subtype | ||
) |
Event type and subtype of an event.
Returns event type and outputs event subtype.
event | Event handle | |
[out] | subtype | Pointer to event subtype for output |
void odp_event_types_multi | ( | const odp_event_t | event[], |
odp_event_type_t | type[], | ||
odp_event_subtype_t | subtype[], | ||
int | num | ||
) |
Event types and subtypes of multiple events.
Outputs the event types and subtypes (optional) of all given events into the output arrays. Application can pass NULL as 'subtype' parameter if subtype values are not required. The types are written in the same order as input events.
event | Array of event handles | |
[out] | type | Event type array for output |
[out] | subtype | Event subtype array for output, or NULL |
num | Number of events, event types, and optionally subtypes |
int odp_event_type_multi | ( | const odp_event_t | event[], |
int | num, | ||
odp_event_type_t * | type | ||
) |
Event type of multiple events.
Returns the number of first events in the array which have the same event type. Outputs the event type of those events.
event | Array of event handles | |
num | Number of events (> 0) | |
[out] | type | Event type pointer for output |
odp_pool_t odp_event_pool | ( | odp_event_t | event | ) |
Event pool.
Returns handle to the pool where the event was allocated from. If the underlying event type does not have an API for returning pool handle (e.g. ODP_EVENT_IPSEC_STATUS), ODP_POOL_INVALID is returned.
event | Event handle |
void* odp_event_user_area | ( | odp_event_t | event | ) |
Event user area.
Returns pointer to the user area associated with the event. This maps to the user area of underlying event type (e.g. odp_packet_user_area() for packets). If the event does not have user area, NULL is returned.
event | Event handle |
NULL | The event does not have user area |
void* odp_event_user_area_and_flag | ( | odp_event_t | event, |
int * | flag | ||
) |
Event user area and flag.
Returns pointer to the user area and outputs value of user flag associated with the event. The user area maps to the user area of underlying event type (e.g. odp_packet_user_area() for packets). If the event does not have user area, NULL is returned.
The user flag maps to the user flag value of underlying event type (e.g. odp_packet_user_flag() for packets). If the event does not have user flag, a negative value is outputted.
event | Event handle | |
[out] | flag | User flag value pointer for output. >0 if user flag is set, 0 if flags is not set, or <0 if event does not have user flag. |
NULL | The event does not have user area |
void odp_event_user_flag_set | ( | odp_event_t | event, |
int | val | ||
) |
Set event user flag.
Set (or clear) the user flag.
The user flag maps to the user flag value of underlying event type (e.g. odp_packet_user_flag() for packets). If the event does not have user flag, nothing is done.
event | Event handle |
val | New value for the flag. Zero clears the flag, other values set the flag. |
int odp_event_filter_packet | ( | const odp_event_t | event[], |
odp_packet_t | packet[], | ||
odp_event_t | remain[], | ||
int | num | ||
) |
Filter and convert packet events.
Checks event type of all input events, converts all packet events and outputs packet handles. Returns the number packet handles outputted. Outputs the remaining, non-packet event handles to 'remain' array. Handles are outputted to both arrays in the same order those are stored in 'event' array. Both output arrays must fit 'num' elements.
event | Array of event handles | |
[out] | packet | Packet handle array for output |
[out] | remain | Event handle array for output of remaining, non-packet events |
num | Number of events (> 0) |
uint64_t odp_event_to_u64 | ( | odp_event_t | hdl | ) |
Get printable value for an odp_event_t.
hdl | odp_event_t handle to be printed |
int odp_event_is_valid | ( | odp_event_t | event | ) |
Check that event is valid.
This function can be used for debugging purposes to check if an event handle represents a valid event. The level of error checks depends on the implementation. The call should not crash if the event handle is corrupted.
event | Event handle |
1 | Event handle represents a valid event. |
0 | Event handle does not represent a valid event. |
void odp_event_free | ( | odp_event_t | event | ) |
Free event.
Frees the event based on its type. Results are undefined if event type is unknown.
In case of packet vector events (ODP_EVENT_PACKET_VECTOR) the function frees the packet vector and all packets stored inside it.
event | Event handle |
void odp_event_free_multi | ( | const odp_event_t | event[], |
int | num | ||
) |
Free multiple events.
Otherwise like odp_event_free(), but frees multiple events to their originating pools.
event | Array of event handles |
num | Number of events to free |
void odp_event_free_sp | ( | const odp_event_t | event[], |
int | num | ||
) |
Free multiple events to the same pool.
Otherwise like odp_event_free_multi(), but all events must be from the same originating pool.
event | Array of event handles |
num | Number of events to free |
uint32_t odp_event_flow_id | ( | odp_event_t | event | ) |
Event flow id value.
Returns the flow id value set in the event. Usage of flow id enables scheduler to maintain multiple synchronization contexts per single queue. For example, when multiple flows are assigned to an atomic queue, events of a single flow (events from the same queue with the same flow id value) are guaranteed to be processed by only single thread at a time. For packets received through packet input initial event flow id will be same as flow hash generated for packets. The hash algorithm and therefore the resulting flow id value is implementation specific. Use pktio API configuration options to select the fields used for initial flow id calculation. For all other events initial flow id is zero An application can change event flow id using odp_event_flow_id_set().
event | Event handle |
void odp_event_flow_id_set | ( | odp_event_t | event, |
uint32_t | flow_id | ||
) |
Set event flow id value.
Store the event flow id for the event and sets the flow id flag. When scheduler is configured as flow aware, scheduled queue synchronization will be based on this id within each queue. When scheduler is configured as flow unaware, event flow id is ignored by the implementation. The value of flow id must be less than the number of flows configured in the scheduler.
event | Event handle |
flow_id | Flow event id to be set. |