API Reference Manual
1.47.0
|
Event vector metadata and operations.
Data Structures | |
struct | odp_event_aggr_config_t |
Event vector configuration. More... | |
struct | odp_event_aggr_capability_t |
Event aggregator capabilities. More... | |
Macros | |
#define | ODP_EVENT_VECTOR_INVALID ((odp_event_vector_t)0) |
Invalid event vector. | |
Typedefs | |
typedef _odp_abi_event_vector_t * | odp_event_vector_t |
ODP event vector. | |
typedef struct odp_event_aggr_config_t | odp_event_aggr_config_t |
Event vector configuration. | |
typedef struct odp_event_aggr_capability_t | odp_event_aggr_capability_t |
Event aggregator capabilities. | |
odp_event_vector_t odp_event_vector_from_event | ( | odp_event_t | ev | ) |
Get event vector handle from event.
Converts an ODP_EVENT_VECTOR type event to an event vector handle.
ev | Event handle |
odp_event_t odp_event_vector_to_event | ( | odp_event_vector_t | evv | ) |
Convert event vector handle to event.
evv | Event vector handle |
odp_event_vector_t odp_event_vector_alloc | ( | odp_pool_t | pool | ) |
Allocate event vector from event vector pool.
Allocates an event vector from the specified event vector pool. The pool must have been created with the ODP_POOL_EVENT_VECTOR type.
A newly allocated vector shall not contain any events, instead, alloc operation shall reserve the space for odp_pool_param_t::event_vector.max_size events.
pool | Event vector pool handle |
ODP_EVENT_VECTOR_INVALID | Event vector could not be allocated |
void odp_event_vector_free | ( | odp_event_vector_t | evv | ) |
Free event vector.
Frees the event vector into the event vector pool it was allocated from.
This API just frees the vector, not any events inside the vector. Application can use odp_event_free() to free the vector and events inside the vector.
evv | Event vector handle |
uint32_t odp_event_vector_tbl | ( | odp_event_vector_t | evv, |
odp_event_t ** | event_tbl | ||
) |
Get event vector table.
Event vector table is an array of events (odp_event_t) stored in contiguous memory location. Upon completion of this API, the implementation returns the event table pointer in event_tbl.
The maximum number of events this vector can hold is defined by odp_pool_param_t::event_vector.max_size. The return value of this function will not be greater than odp_pool_param_t::event_vector.max_size
The event_tbl points to the event vector table. Application can edit the event handles in the table directly (up to odp_pool_param_t::event_vector.max_size). Application must update the size of the table using odp_event_vector_size_set() when there is a change in the size of the vector.
Invalid event handles (ODP_EVENT_INVALID) are not allowed to be stored in the table to allow consumers of odp_event_vector_t handle to have optimized implementation. So consumption of events in the middle of the vector would call for moving the remaining events up to form a contiguous array of events and update the size of the new vector using odp_event_vector_size_set().
The table memory is backed by an event vector pool buffer. The ownership of the table memory is linked to the ownership of the event. I.e. after sending the event to a queue, the sender loses ownership to the table also.
evv | Event vector handle | |
[out] | event_tbl | Points to event vector table |
uint32_t odp_event_vector_size | ( | odp_event_vector_t | evv | ) |
Number of events in a vector.
evv | Event vector handle |
odp_event_type_t odp_event_vector_type | ( | odp_event_vector_t | evv | ) |
Type of events stored in event vector.
If all events in the vector are of the same type, function returns the particular event type. If the vector is empty or includes multiple event types, ODP_EVENT_ANY is returned instead.
evv | Event vector handle |
void odp_event_vector_size_set | ( | odp_event_vector_t | evv, |
uint32_t | size | ||
) |
Set the number of events stored in a vector.
Update the number of events stored in a vector. When the application is producing an event vector, this function shall be used by the application to set the number of events available in this vector.
The maximum number of events this vector can hold is defined by odp_pool_param_t::event_vector.max_size. The size value must not be greater than odp_pool_param_t::event_vector.max_size
All handles in the vector table (0 .. size - 1) need to be valid event handles.
evv | Event vector handle |
size | Number of events in this vector |
void* odp_event_vector_user_area | ( | odp_event_vector_t | evv | ) |
Event vector user area.
Returns pointer to the user area associated with the event vector. Size of the area is fixed and defined in vector pool parameters.
evv | Event vector handle |
NULL | The event vector does not have user area |
int odp_event_vector_user_flag | ( | odp_event_vector_t | evv | ) |
Check user flag.
Implementation clears user flag during new event vector creation (e.g. alloc and packet input) and reset. User may set the flag with odp_event_vector_user_flag_set(). Implementation never sets the flag, only clears it. The flag may be useful e.g. to mark when the user area content is valid.
evv | Event vector handle |
0 | User flag is clear |
>0 | User flag is set |
void odp_event_vector_user_flag_set | ( | odp_event_vector_t | evv, |
int | val | ||
) |
Set user flag.
Set (or clear) the user flag.
evv | Event vector handle |
val | New value for the flag. Zero clears the flag, other values set the flag. |
odp_pool_t odp_event_vector_pool | ( | odp_event_vector_t | evv | ) |
Event vector pool.
Returns handle to the event vector pool where the event vector was allocated from.
evv | Event vector handle |
void odp_event_vector_print | ( | odp_event_vector_t | evv | ) |
Print debug information about event vector.
Print implementation defined information about event vector to the ODP log. The information is intended to be used for debugging.
evv | Event vector handle |
uint64_t odp_event_vector_to_u64 | ( | odp_event_vector_t | evv | ) |
Get printable value for event vector handle.
evv | Handle to be converted for debugging |