API Reference Manual  1.50.0
odp_timer_pool_param_t Struct Reference

Timer pool parameters. More...

#include <timer_types.h>

Collaboration diagram for odp_timer_pool_param_t:
[legend]

Data Fields

odp_timer_type_t timer_type
 Timer type. More...
 
odp_timer_clk_src_t clk_src
 Clock source for timers. More...
 
odp_timer_exp_mode_t exp_mode
 Timer expiration mode. More...
 
uint64_t res_ns
 Timeout resolution in nanoseconds. More...
 
uint64_t res_hz
 Timeout resolution in hertz. More...
 
uint64_t min_tmo
 Minimum relative timeout in nanoseconds. More...
 
uint64_t max_tmo
 Maximum relative timeout in nanoseconds. More...
 
struct {
   struct {
      odp_fract_u64_t   base_freq_hz
 Timer pool base frequency in hertz. More...
 
      uint64_t   max_multiplier
 Maximum base frequency multiplier. More...
 
   }   base_mul
 Pool parameters for ODP_TIMER_TYPE_PERIODIC_BASE_MUL. More...
 
   struct {
      odp_fract_u64_t *   freq_hz
 Array of constraining periodic timer frequencies for the pool in hertz in ascending order. More...
 
      uint32_t   num
 Number of items in 'freq_hz' array.
 
   }   freq
 Pool parameters for ODP_TIMER_TYPE_PERIODIC_FREQ. More...
 
   uint32_t   uarea_size
 Minimum user area size in bytes. More...
 
   uint32_t   max_pending_tmo
 Maximum number of pending timeout events. More...
 
periodic
 Periodic timer pool parameters. More...
 
uint32_t num_timers
 Number of timers in the pool.
 
uint16_t priority
 Timer pool priority. More...
 
int priv
 Thread private timer pool. More...
 

Detailed Description

Field Documentation

◆ timer_type

odp_timer_type_t odp_timer_pool_param_t::timer_type

Timer type.

Select whether the pool is created for single shot (ODP_TIMER_TYPE_SINGLE) or periodic (ODP_TIMER_TYPE_PERIODIC_BASE_MUL/ODP_TIMER_TYPE_PERIODIC_FREQ) timers. All timers in a pool are of the same type. Timer capabilities specify how many pools of each type are supported.

The default value is ODP_TIMER_TYPE_SINGLE.

Examples
odp_timer_accuracy.c, and odp_timer_stress.c.

Definition at line 367 of file api/spec/timer_types.h.

◆ clk_src

odp_timer_clk_src_t odp_timer_pool_param_t::clk_src

Clock source for timers.

The default value is ODP_CLOCK_DEFAULT.

Examples
odp_bench_timer.c, odp_debug.c, odp_sched_pktio.c, odp_stress.c, odp_sysinfo.c, odp_timer_accuracy.c, odp_timer_perf.c, odp_timer_simple.c, and odp_timer_stress.c.

Definition at line 372 of file api/spec/timer_types.h.

◆ exp_mode

odp_timer_exp_mode_t odp_timer_pool_param_t::exp_mode

Timer expiration mode.

The default value is ODP_TIMER_EXP_AFTER.

Definition at line 377 of file api/spec/timer_types.h.

◆ res_ns

uint64_t odp_timer_pool_param_t::res_ns

Timeout resolution in nanoseconds.

Timer pool must serve timeouts with this or higher resolution. The minimum valid value (highest resolution) is defined by timer resolution capability. When this parameter is used, set 'res_hz' to zero. The default value is zero.

Examples
odp_bench_timer.c, odp_debug.c, odp_sched_pktio.c, odp_stress.c, odp_sysinfo.c, odp_timer_accuracy.c, odp_timer_perf.c, odp_timer_simple.c, and odp_timer_stress.c.

Definition at line 383 of file api/spec/timer_types.h.

◆ res_hz

uint64_t odp_timer_pool_param_t::res_hz

Timeout resolution in hertz.

This may be used to specify the highest required resolution in hertz instead of nanoseconds. When this parameter is used, set 'res_ns' to zero. The default value is zero.

Examples
odp_timer_accuracy.c.

Definition at line 388 of file api/spec/timer_types.h.

◆ min_tmo

uint64_t odp_timer_pool_param_t::min_tmo

Minimum relative timeout in nanoseconds.

All requested timeouts will be at least this many nanoseconds after the current time of the timer pool. Timer set functions return an error, if too short timeout was requested. The value may be also smaller than the requested resolution.

The default value is zero. Ignored when timer type is periodic.

Examples
odp_bench_timer.c, odp_debug.c, odp_sched_pktio.c, odp_stress.c, odp_sysinfo.c, odp_timer_accuracy.c, odp_timer_perf.c, odp_timer_simple.c, and odp_timer_stress.c.

Definition at line 398 of file api/spec/timer_types.h.

◆ max_tmo

uint64_t odp_timer_pool_param_t::max_tmo

Maximum relative timeout in nanoseconds.

All requested timeouts will be at most this many nanoseconds after the current time of the timer pool. Timer set functions return an error, if too long timeout was requested.

Ignored when timer type is periodic.

Examples
odp_bench_timer.c, odp_debug.c, odp_sched_pktio.c, odp_stress.c, odp_sysinfo.c, odp_timer_accuracy.c, odp_timer_perf.c, odp_timer_simple.c, and odp_timer_stress.c.

Definition at line 408 of file api/spec/timer_types.h.

◆ base_freq_hz

odp_fract_u64_t odp_timer_pool_param_t::base_freq_hz

Timer pool base frequency in hertz.

A periodic timer pool has a base frequency. Each timer of the pool has an expiration frequency that is an integer multiple of the base frequency.

Fraction part of the value is always less than one, see odp_timer_periodic_capability_t::base_mul::base_freq_hz for details. The default value is zero.

An example with two timer frequencies: base_freq_hz.integer = 33333, .numer = 1, .denom = 3 max_multiplier = 30 timer A: multiplier = 2 timer frequency: 2 * 33333 1/3 Hz = 66.6666..kHz timer B: multiplier = 30 timer frequency: 30 * 33333 1/3 Hz = 1 MHz

Definition at line 466 of file api/spec/timer_types.h.

◆ max_multiplier

uint64_t odp_timer_pool_param_t::max_multiplier

Maximum base frequency multiplier.

This is the maximum base frequency multiplier value (odp_timer_periodic_param_t::base_mul::multiplier) for any timer in the pool.

Definition at line 474 of file api/spec/timer_types.h.

◆ 

struct { ... } odp_timer_pool_param_t::base_mul

Pool parameters for ODP_TIMER_TYPE_PERIODIC_BASE_MUL.

With ODP_TIMER_TYPE_PERIODIC_BASE_MUL, a periodic timer pool can be thought as a wall clock, where the base frequency 'base_freq_hz' defines how many times per second a pointer travels around the clock face. When a timer (see "Timer A" in the figure) is configured with the base frequency multiplier (see odp_timer_periodic_param_t) of one, a single reference to it is placed into the clock face. When a timer (see "Timer B") is started with the multiplier value of two, two references to it is placed into opposite sides of the clock face, etc. When the pointer reaches a timer reference, the timer expires and a timeout event is sent. The maximum base frequency multiplier 'max_multiplier' defines the maximum number of references a timer can have on the clock face.

Periodic timer pool
o
o o <--- Timer B
o \ o
\
Timer B ---> o \ o <--- Timer A
o
Timer pool: max_multiplier = 8
Timer A: multiplier = 1
Timer B: multiplier = 2
Examples
odp_timer_accuracy.c, and odp_timer_stress.c.

◆ freq_hz

odp_fract_u64_t* odp_timer_pool_param_t::freq_hz

Array of constraining periodic timer frequencies for the pool in hertz in ascending order.

Array of constraining periodic timer frequencies to configure and dimension the underlying timer pool resources. At least one frequency must be listed.

The array additionally defines the allowed periodic timer frequency range for the pool timers. All application requested timer frequencies must be from the minimum timer frequency of 'freq_hz[0]' to the maximum timer frequency of 'freq_hz[num - 1]' (see odp_timer_periodic_param_t::freq::freq_hz). Application may request also timer frequencies that are not present in 'freq_hz' array, but these may suffer from inaccuracies (e.g. drift or jitter) if not exactly compatible (see odp_timer_periodic_capability()) with the 'freq_hz' frequencies.

Definition at line 503 of file api/spec/timer_types.h.

◆ 

struct { ... } odp_timer_pool_param_t::freq

Pool parameters for ODP_TIMER_TYPE_PERIODIC_FREQ.

With ODP_TIMER_TYPE_PERIODIC_FREQ, period is defined directly with the wanted timer frequency. Timer pool is configured with a list of constraining periodic timer frequencies which results in a more flexible resource compared to ODP_TIMER_TYPE_PERIODIC_BASE_MUL timer pools.

◆ uarea_size

uint32_t odp_timer_pool_param_t::uarea_size

Minimum user area size in bytes.

User area size for a timeout pool to-be-created by implementation for this timer pool. The maximum value is defined by pool capability tmo.max_uarea_size. Specify as 0 if no user area is needed. The default value is 0.

Definition at line 516 of file api/spec/timer_types.h.

◆ max_pending_tmo

uint32_t odp_timer_pool_param_t::max_pending_tmo

Maximum number of pending timeout events.

This is the maximum number of timeout events from this pool, which have been sent by timer but have not yet been acknowledged with odp_timer_periodic_ack() calls. When this limit is reached, the timer implementation will start throttling new timeout events until enough pending events have been acknowledged. The precise throttling behavior is implementation specific.

Use non-zero value from 'min_pending_tmo' to 'max_pending_tmo' (see odp_timer_capability_t::periodic) to enable flow control. When value is zero, timeout event flow control is disabled. The default value is zero.

Definition at line 530 of file api/spec/timer_types.h.

◆ 

struct { ... } odp_timer_pool_param_t::periodic

Periodic timer pool parameters.

Additional parameters for periodic timer pools. Ignored when timer type is single shot.

Examples
odp_timer_accuracy.c, and odp_timer_stress.c.

◆ priority

uint16_t odp_timer_pool_param_t::priority

Timer pool priority.

Timers allocated from pools with a higher priority value are served with higher priority than timers allocated from pools with a lower priority value. The prioritization algorithm is implementation specific. Note that lower priority timers may get delayed due to higher priority timer processing. All values between zero and 'max_priority' (see odp_timer_capability_t) are valid. The default value is zero.

Definition at line 545 of file api/spec/timer_types.h.

◆ priv

int odp_timer_pool_param_t::priv

Thread private timer pool.

When zero, multiple thread may use the timer pool concurrently. When non-zero, only single thread uses the timer pool (concurrently). The default value is zero.

Examples
odp_stress.c, odp_timer_perf.c, and odp_timer_simple.c.

Definition at line 550 of file api/spec/timer_types.h.


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