EM-ODP
3.7.0
Event Machine on ODP
|
#include <event_machine_init.h>
Data Fields | |
uint16_t | device_id |
int | event_timer |
int | thread_per_core |
int | process_per_core |
int | core_count |
em_core_mask_t | phys_mask |
em_pool_cfg_t | default_pool_cfg |
struct { | |
em_log_func_t log_fn | |
em_vlog_func_t vlog_fn | |
} | log |
struct { | |
em_input_poll_func_t input_poll_fn | |
em_core_mask_t input_poll_mask | |
} | input |
struct { | |
em_output_drain_func_t output_drain_fn | |
em_core_mask_t output_drain_mask | |
} | output |
em_api_hooks_t | api_hooks |
em_idle_hooks_t | idle_hooks |
Event Machine run-time configuration options given at startup to em_init()
The 'em_conf_t' struct should be initialized with em_conf_init() before use. This initialization provides better backwards compatibility since all options will be set to default values. The user must further set the needed configuration and call em_init():
Content is copied into EM by em_init().
Definition at line 93 of file event_machine_init.h.
em_api_hooks_t em_conf_t::api_hooks |
User provided API callback hooks. Set only the needed hooks to avoid performance degradation. Only used if EM_API_HOOKS_ENABLE != 0
Definition at line 218 of file event_machine_init.h.
int em_conf_t::core_count |
Number of EM-cores (== number of EM-threads or EM-processes). The 'core_count' must match the number of bits set in 'phys_mask'. EM-cores will be enumerated from 0 to 'core_count-1' regardless of the actual physical core ids. Default value is 0 and needs to be changed by the user.
Definition at line 132 of file event_machine_init.h.
em_pool_cfg_t em_conf_t::default_pool_cfg |
Pool configuration for the EM default pool (EM_POOL_DEFAULT). Default value is set by em_pool_cfg_init() and needs to be changed by the user.
Note that if the default pool configuration is also given in the config file through option 'startup_pools', it will override this default pool configuration.
Definition at line 160 of file event_machine_init.h.
uint16_t em_conf_t::device_id |
EM device id - use different device ids for each EM instance or remote EM device that need to communicate with each other. Default value is 0.
Definition at line 99 of file event_machine_init.h.
int em_conf_t::event_timer |
Event Timer: enable=1, disable=0. Default value is 0 (disable).
Definition at line 105 of file event_machine_init.h.
em_idle_hooks_t em_conf_t::idle_hooks |
User provided idle callback hooks. Set only the needed hooks to avoid performance degradation. Only used if EM_IDLE_HOOKS_ENABLE != 0
Definition at line 225 of file event_machine_init.h.
struct { ... } em_conf_t::input |
EM event/pkt input related functions and config
em_input_poll_func_t em_conf_t::input_poll_fn |
User provided function, called from within the EM-dispatch loop, mainly for polling various input sources for events or pkts and then enqueue them into EM. Set to 'NULL' if not needed (default).
Definition at line 182 of file event_machine_init.h.
em_core_mask_t em_conf_t::input_poll_mask |
EM core mask to control which EM-cores (0 to 'core_count-1') input_poll_fn() will be called on. The provided mask has to be equal or a subset of the EM core mask with all 'core_count' bits set. A zero mask means execution on all EM cores (default).
Definition at line 190 of file event_machine_init.h.
struct { ... } em_conf_t::log |
EM log functions. Default values are NULL and causes EM to use internal default log-functions.
em_log_func_t em_conf_t::log_fn |
EM log function, user overridable, variable number of args
Definition at line 169 of file event_machine_init.h.
struct { ... } em_conf_t::output |
EM event/pkt output related functions and config
em_output_drain_func_t em_conf_t::output_drain_fn |
User provided function, called from within the EM-dispatch loop, mainly for 'periodical' draining of buffered output to make sure events/pkts are eventually sent out even if the rate is low or stops for a while. Set to 'NULL' if not needed (default).
Definition at line 202 of file event_machine_init.h.
em_core_mask_t em_conf_t::output_drain_mask |
EM core mask to control which EM-cores (0 to 'core_count-1') output_drain_fn() will be called on. The provided mask has to be equal or a subset of the EM core mask with all 'core_count' bits set. A zero mask means execution on all EM cores (default).
Definition at line 210 of file event_machine_init.h.
em_core_mask_t em_conf_t::phys_mask |
Physical core mask, exactly listing the physical CPU cores to be used by EM (this is a physical core mask even though the 'em_core_mask_t' type is used). Default value is all-0 and needs to be changed by the user.
Definition at line 149 of file event_machine_init.h.
int em_conf_t::process_per_core |
RunMode: EM run with one process per core. Set 'true' to select process-per-core mode. Default value is 0.
Definition at line 123 of file event_machine_init.h.
int em_conf_t::thread_per_core |
RunMode: EM run with one thread per core. Set 'true' to select thread-per-core mode. This is the recommended mode, but the user must explicitly set it to enable. Default value is 0.
Definition at line 115 of file event_machine_init.h.
em_vlog_func_t em_conf_t::vlog_fn |
EM log function, user overridable, va_list
Definition at line 171 of file event_machine_init.h.