EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
em_eo.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <odp_api.h>
#include <event_machine.h>
#include "em_eo_types.h"
#include "em_internal_event_types.h"
#include "em_mem.h"
#include "em_queue_types.h"
#include "misc/objpool.h"
Include dependency graph for em_eo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define invalid_eo(eo)   ((unsigned int)eo_hdl2idx((eo)) >= EM_MAX_EOS)
 

Functions

em_status_t eo_init (eo_tbl_t eo_tbl[], eo_pool_t *eo_pool)
 
em_eo_t eo_alloc (void)
 
em_status_t eo_free (em_eo_t eo)
 
em_status_t eo_add_queue (eo_elem_t *const eo_elem, queue_elem_t *const q_elem)
 
em_status_t eo_rem_queue (eo_elem_t *const eo_elem, queue_elem_t *const q_elem)
 
em_status_t eo_rem_queue_all (eo_elem_t *const eo_elem)
 
em_status_t eo_delete_queue_all (eo_elem_t *const eo_elem)
 
int eo_start_local_req (eo_elem_t *const eo_elem, int num_notif, const em_notif_t notif_tbl[])
 
int eo_start_sync_local_req (eo_elem_t *const eo_elem)
 
int eo_start_buffer_events (const em_event_t events[], int num, em_queue_t queue)
 
void eo_start_send_buffered_events (eo_elem_t *const eo_elem)
 
int eo_stop_local_req (eo_elem_t *const eo_elem, int num_notif, const em_notif_t notif_tbl[])
 
int eo_stop_sync_local_req (eo_elem_t *const eo_elem)
 
em_status_t eo_stop_done (eo_elem_t *const eo_elem)
 
int eo_remove_queue_local_req (eo_elem_t *const eo_elem, queue_elem_t *const q_elem, int num_notif, const em_notif_t notif_tbl[])
 
int eo_remove_queue_sync_local_req (eo_elem_t *const eo_elem, queue_elem_t *const q_elem)
 
int eo_remove_queue_all_local_req (eo_elem_t *const eo_elem, int delete_queues, int num_notif, const em_notif_t notif_tbl[])
 
int eo_remove_queue_all_sync_local_req (eo_elem_t *const eo_elem, int delete_queues)
 
unsigned int eo_count (void)
 
size_t eo_name (const eo_elem_t *const eo_elem, char name[], const size_t maxlen)
 
odp_stash_t eo_start_stash_create (void)
 Create a stash used to buffer events sent during EO-start.
 
void i_event__eo_local_func_call_req (const internal_event_t *i_ev)
 
void eo_info_print_all (void)
 
void eo_queue_info_print (em_eo_t eo)
 
void eo_start_local_fn_at_init (void)
 Run EO local-start functions for all EOs on a new core (if configured)
 
void eo_stop_local_fn_at_term (void)
 Run EO local-stop funcs for all EOs during term-core (if configured)
 

Detailed Description

EM internal EO functions

Definition in file em_eo.h.

Macro Definition Documentation

◆ invalid_eo

#define invalid_eo (   eo)    ((unsigned int)eo_hdl2idx((eo)) >= EM_MAX_EOS)

Definition at line 57 of file em_eo.h.

Function Documentation

◆ eo_add_queue()

em_status_t eo_add_queue ( eo_elem_t *const  eo_elem,
queue_elem_t *const  q_elem 
)

Add a queue to an EO

Definition at line 240 of file em_eo.c.

◆ eo_alloc()

em_eo_t eo_alloc ( void  )

Definition at line 204 of file em_eo.c.

◆ eo_count()

unsigned int eo_count ( void  )

Definition at line 1342 of file em_eo.c.

◆ eo_delete_queue_all()

em_status_t eo_delete_queue_all ( eo_elem_t *const  eo_elem)

Definition at line 343 of file em_eo.c.

◆ eo_free()

em_status_t eo_free ( em_eo_t  eo)

Definition at line 220 of file em_eo.c.

◆ eo_info_print_all()

void eo_info_print_all ( void  )

Print information about all EOs

Definition at line 1403 of file em_eo.c.

◆ eo_init()

em_status_t eo_init ( eo_tbl_t  eo_tbl[],
eo_pool_t eo_pool 
)

Definition at line 169 of file em_eo.c.

◆ eo_name()

size_t eo_name ( const eo_elem_t *const  eo_elem,
char  name[],
const size_t  maxlen 
)

Definition at line 1347 of file em_eo.c.

◆ eo_queue_info_print()

void eo_queue_info_print ( em_eo_t  eo)

Print information about all queues of the given eo

Definition at line 1476 of file em_eo.c.

◆ eo_rem_queue()

em_status_t eo_rem_queue ( eo_elem_t *const  eo_elem,
queue_elem_t *const  q_elem 
)

Remove a queue from an EO

Definition at line 297 of file em_eo.c.

◆ eo_rem_queue_all()

em_status_t eo_rem_queue_all ( eo_elem_t *const  eo_elem)

Definition at line 316 of file em_eo.c.

◆ eo_remove_queue_all_local_req()

int eo_remove_queue_all_local_req ( eo_elem_t *const  eo_elem,
int  delete_queues,
int  num_notif,
const em_notif_t  notif_tbl[] 
)

Definition at line 930 of file em_eo.c.

◆ eo_remove_queue_all_sync_local_req()

int eo_remove_queue_all_sync_local_req ( eo_elem_t *const  eo_elem,
int  delete_queues 
)

Definition at line 989 of file em_eo.c.

◆ eo_remove_queue_local_req()

int eo_remove_queue_local_req ( eo_elem_t *const  eo_elem,
queue_elem_t *const  q_elem,
int  num_notif,
const em_notif_t  notif_tbl[] 
)

Definition at line 811 of file em_eo.c.

◆ eo_remove_queue_sync_local_req()

int eo_remove_queue_sync_local_req ( eo_elem_t *const  eo_elem,
queue_elem_t *const  q_elem 
)

Definition at line 867 of file em_eo.c.

◆ eo_start_buffer_events()

int eo_start_buffer_events ( const em_event_t  events[],
int  num,
em_queue_t  queue 
)

Called by em_send() & variants during an EO start-function.

Events sent from within the EO-start functions are buffered and sent after the start-operation has completed. Otherwise it would not be possible to reliably send events from the start-functions to the EO's own queues.

Definition at line 515 of file em_eo.c.

◆ eo_start_local_fn_at_init()

void eo_start_local_fn_at_init ( void  )

Run EO local-start functions for all EOs on a new core (if configured)

If the EM-core is added after initial startup and EO:s are already created and running: check all running EO's and call the local start functions (if available).

Definition at line 1597 of file em_eo.c.

◆ eo_start_local_req()

int eo_start_local_req ( eo_elem_t *const  eo_elem,
int  num_notif,
const em_notif_t  notif_tbl[] 
)

Request all EM-cores (worker or control) to run an EO's local start function as triggered from em_eo_start()

Parameters
eo_elemEO element pointer
num_notifNumber of notifications in notif_tbl
notif_tblNotification table, can be NULL if num_notif is 0
Returns
the number of requests sent or a negative value on error
Return values
0if no requests were sent
>0the number of requests sent
<0on error

Definition at line 393 of file em_eo.c.

◆ eo_start_send_buffered_events()

void eo_start_send_buffered_events ( eo_elem_t *const  eo_elem)

Send the buffered events at the end of the EO-start operation.

Events sent from within the EO-start functions are buffered and sent after the start-operation has completed. Otherwise it would not be possible to reliably send events from the start-functions to the EO's own queues.

Definition at line 575 of file em_eo.c.

◆ eo_start_stash_create()

odp_stash_t eo_start_stash_create ( void  )

Create a stash used to buffer events sent during EO-start.

Definition at line 1548 of file em_eo.c.

◆ eo_start_sync_local_req()

int eo_start_sync_local_req ( eo_elem_t *const  eo_elem)

Request all EM-cores (worker or control) to run an EO's local start function as triggered from em_eo_start_sync()

Parameters
eo_elemEO element pointer
Returns
the number of requests sent or a negative value on error
Return values
0if no requests were sent
>0the number of requests sent
<0on error

Definition at line 453 of file em_eo.c.

◆ eo_stop_done()

em_status_t eo_stop_done ( eo_elem_t *const  eo_elem)

Helper to eo_stop_done_callback() and em_eo_stop()

Returns
EO global stop function return value

Definition at line 685 of file em_eo.c.

◆ eo_stop_local_fn_at_term()

void eo_stop_local_fn_at_term ( void  )

Run EO local-stop funcs for all EOs during term-core (if configured)

If the EM-core is removed while EOs are running: check all running EO's and call the local stop function (if available).

Definition at line 1647 of file em_eo.c.

◆ eo_stop_local_req()

int eo_stop_local_req ( eo_elem_t *const  eo_elem,
int  num_notif,
const em_notif_t  notif_tbl[] 
)

Request all EM-cores (worker or control) to run an EO's local stop function as triggered from em_eo_stop()

Parameters
eo_elemEO element pointer
num_notifNumber of notifications to send
notif_tblArray of notifications to send
Returns
the number of requests sent or a negative value on error
Return values
0if no requests were sent
>0the number of requests sent
<0on error

Definition at line 662 of file em_eo.c.

◆ eo_stop_sync_local_req()

int eo_stop_sync_local_req ( eo_elem_t *const  eo_elem)

Request all EM-cores (worker or control) to run an EO's local stop function as triggered from em_eo_stop_sync()

Parameters
eo_elemEO element pointer
Returns
the number of requests sent or a negative value on error
Return values
0if no requests were sent
>0the number of requests sent
<0on error

Definition at line 765 of file em_eo.c.

◆ i_event__eo_local_func_call_req()

void i_event__eo_local_func_call_req ( const internal_event_t i_ev)

EM internal event handler (see em_internal_event.c&h) Handle the internal event requesting a local function call.

Definition at line 1241 of file em_eo.c.