EM-ODP  3.7.0
Event Machine on ODP
em_pool_cfg_t Struct Reference
Collaboration diagram for em_pool_cfg_t:

Data Fields

em_event_type_t event_type
 
struct {
   bool   in_use
 
   uint32_t   value
 
align_offset
 
struct {
   bool   in_use
 
   size_t   size
 
user_area
 
struct {
   struct {
      bool   in_use
 
      uint32_t   value
 
   }   headroom
 
pkt
 
int num_subpools
 
struct {
   uint32_t   size
 
   uint32_t   num
 
   uint32_t   cache_size
 
subpool [EM_MAX_SUBPOOLS]
 
struct {
   bool   in_use
 
   em_pool_stats_opt_t   opt
 
stats_opt
 
uint32_t __internal_check
 

Detailed Description

Field Documentation

◆ __internal_check

uint32_t em_pool_cfg_t::__internal_check

Internal check - don't touch!

EM will verify that em_pool_cfg_init(pool_cfg) has been called before creating a pool with em_pool_create(..., pool_cfg)

Definition at line 319 of file event_machine_pool.h.

◆ align_offset

struct { ... } em_pool_cfg_t::align_offset

Alignment offset in bytes for the event payload start address (for all events allocated from this EM pool).

Only valid for pools with event_type EM_EVENT_TYPE_SW or EM_EVENT_TYPE_PACKET (i.e. ignored for EM_EVENT_TYPE_VECTOR pools).

The default EM event payload start address alignment is a power-of-two that is at minimum 32 bytes (i.e. 32 B, 64 B, 128 B etc. depending on e.g. target cache-line size). The 'align_offset.value' option can be used to fine-tune the start-address by a small offset to e.g. make room for a small SW header before the rest of the payload that might need a specific alignment for direct HW-access. Example: setting 'align_offset.value = 8' makes sure that the payload after 8 bytes will be aligned at minimum (2^x) 32 bytes.

This option conserns all events allocated from the pool and overrides the global config file option 'pool.align_offset' for this pool.

◆ cache_size

uint32_t em_pool_cfg_t::cache_size

Maximum number of locally cached subpool events per EM-core.

Allocating or freeing events from a core-local event-cache can be faster than using the global event subpool. Cached events are only available on the local core and can reduce the number of globally free events in the subpool, thus consider setting 'num > EM-core-count * cache_size'. The actual used cache_size will be smaller than or equal to the requested value, depending on the implementation.

Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

Definition at line 294 of file event_machine_pool.h.

◆ event_type

em_event_type_t em_pool_cfg_t::event_type

The event type determines the pool type used:

  • EM_EVENT_TYPE_SW creates subpools of type 'ODP_POOL_BUFFER' This kind of EM pool can be used to allocate events of major type EM_EVENT_TYPE_SW.
  • EM_EVENT_TYPE_PACKET creates subpools of type 'ODP_POOL_PACKET' This kind of EM pool can be used to allocate events of major type EM_EVENT_TYPE_PACKET or EM_EVENT_TYPE_SW.
  • EM_EVENT_TYPE_VECTOR creates subpools of type 'ODP_POOL_VECTOR' This kind of EM pool can ONLY be used to allocate event vectors of major event type EM_EVENT_TYPE_VECTOR.
    Note
    Only major event types are considered here, setting the minor type is an error.
Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

Definition at line 156 of file event_machine_pool.h.

◆ headroom

struct { ... } em_pool_cfg_t::headroom

Pool-specific packet minimum headroom

This option conserns all events allocated from the pool and overrides the global config file option 'pool.pkt_headroom' for this pool.

◆ in_use

bool em_pool_cfg_t::in_use

Select: Use pool-specific align-offset 'value' from below or use the global default value 'pool.align_offset' from the config file. false: Use 'pool.align_offset' from the config file (default) true: Use pool-specific value set below.

Select: Use pool-specific event user area 'size' from below or use the global default value 'pool.user_area_size' from the config file. false: Use 'pool.user_area_size' from config file (default). true: Use pool-specific size set below.

Select: Use pool-specific packet headroom value from below or use the global default value 'pool.pkt_headroom' from the config file. false: Use 'pool.pkt_headroom' from the config file (default). true: Use pool-specific value set below.

Select: Use pool-specific statistic options from below or use the global default value 'pool.statistics' from the config file. false: Use 'pool.statistics' from config file (default). true: Use pool-specific statistic options set below.

Examples
bench_event.c, bench_pool.c, and queue_types_ag.c.

Definition at line 185 of file event_machine_pool.h.

◆ num

uint32_t em_pool_cfg_t::num

Number of events in the subpool (num > 0)

Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

Definition at line 281 of file event_machine_pool.h.

◆ num_subpools

int em_pool_cfg_t::num_subpools

Number of subpools within one EM pool, min=1, max=EM_MAX_SUBPOOLS

Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

Definition at line 264 of file event_machine_pool.h.

◆ pkt

struct { ... } em_pool_cfg_t::pkt

Parameters for an EM-pool with '.event_type = EM_EVENT_TYPE_PACKET' Ignored for other pool types.

◆ size [1/2]

size_t em_pool_cfg_t::size

Pool-specific event user area size in bytes (only evaluated if 'in_use=true'). Overrides the config file 'pool.user_area_size' for this pool 0: Explicitly set 'No user area' for the pool.

Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

Definition at line 224 of file event_machine_pool.h.

◆ size [2/2]

uint32_t em_pool_cfg_t::size

.event_type = EM_EVENT_TYPE_SW or EM_EVENT_TYPE_PACKET: Event payload size of the subpool (size > 0), bytes(B). EM does not initialize the payload data. .event_type = EM_EVENT_TYPE_VECTOR: Max number of events in a vector from the subpool, i.e. 'number of em_event_t:s in the vector's event-table[]'. EM does not initialize the vector.

Definition at line 278 of file event_machine_pool.h.

◆ stats_opt

struct { ... } em_pool_cfg_t::stats_opt

Pool statistic options for all subpools

◆ subpool

struct { ... } em_pool_cfg_t::subpool[EM_MAX_SUBPOOLS]

Subpool params array: .subpool[num_subpools]

Examples
bench_event.c, bench_pool.c, loop_vectors.c, pool_perf.c, and queue_types_ag.c.

◆ user_area

struct { ... } em_pool_cfg_t::user_area

Event user area size in bytes. (for all events allocated from this EM pool).

The user area is located within the event metadata (hdr) and is not part of the event payload. The event user area can e.g. be used to store additional state data related to the payload contents. EM does not initialize the contents of the user area.

This option concerns all events allocated from the pool and overrides the global config file option 'pool.user_area_size' for this pool.

Examples
bench_event.c, bench_pool.c, and queue_types_ag.c.

◆ value

uint32_t em_pool_cfg_t::value

Pool-specific event payload alignment offset value in bytes (only evaluated if 'in_use=true'). Overrides the config file value 'pool.align_offset' for this pool. The given 'value' must be a small power-of-two: 2, 4, or 8 0: Explicitly set 'No align offset' for the pool.

Pool-specific packet minimum headroom in bytes, each packet must have at least this much headroom. (only evaluated if 'in_use=true'). Overrides the config file value 'pool.pkt_headroom' for this pool. 0: Explicitly set 'No headroom' for the pool.

Definition at line 194 of file event_machine_pool.h.


The documentation for this struct was generated from the following file: