API Reference Manual  1.45.0
odp_init_t Struct Reference

Global initialization parameters. More...

#include <init.h>

Collaboration diagram for odp_init_t:
[legend]

Data Fields

int num_worker
 Maximum number of worker threads the user will run concurrently. More...
 
int num_control
 Maximum number of control threads the user will run concurrently. More...
 
const odp_cpumask_tworker_cpus
 Pointer to bit mask mapping CPUs available to this ODP instance for running worker threads. More...
 
const odp_cpumask_tcontrol_cpus
 Pointer to bit mask mapping CPUs available to this ODP instance for running control threads. More...
 
odp_log_func_t log_fn
 Replacement for the default log fn.
 
odp_abort_func_t abort_fn
 Replacement for the default abort fn.
 
odp_feature_t not_used
 Unused features. More...
 
odp_mem_model_t mem_model
 Application memory model. More...
 
struct {
   uint64_t   max_memory
 Maximum memory usage in bytes. More...
 
shm
 Shared memory parameters.
 

Detailed Description

Global initialization parameters.

These parameters may be used at global initialization time to configure and optimize ODP implementation to match the intended usage. Application specifies maximum resource usage. Implementation may round up resource reservations as needed. Initialization function returns a failure if resource requirements are too high. Init parameters may be used also to override logging and abort functions.

Use odp_init_param_init() to initialize the parameters into their default values. Unused parameters are left to default values.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_atomic_perf.c, odp_bench_buffer.c, odp_bench_misc.c, odp_bench_packet.c, odp_bench_pktio_sp.c, odp_bench_timer.c, odp_classifier.c, odp_cli.c, odp_cpu_bench.c, odp_crc.c, odp_crypto.c, odp_dma_perf.c, odp_dmafwd.c, odp_icache_perf.c, odp_ipsec.c, odp_ipsecfwd.c, odp_l2fwd.c, odp_l2fwd_simple.c, odp_lock_perf.c, odp_mem_perf.c, odp_packet_gen.c, odp_pktio.c, odp_pktio_ordered.c, odp_pktio_perf.c, odp_pool_latency.c, odp_pool_perf.c, odp_queue_perf.c, odp_random.c, odp_sched_latency.c, odp_sched_perf.c, odp_sched_pktio.c, odp_simple_pipeline.c, odp_stash_perf.c, odp_stress.c, odp_switch.c, odp_timer_accuracy.c, odp_timer_perf.c, and odp_traffic_mgmt.c.

Definition at line 161 of file api/spec/init.h.

Field Documentation

◆ num_worker

int odp_init_t::num_worker

Maximum number of worker threads the user will run concurrently.

Valid range is from 0 to platform specific maximum. Set both num_worker and num_control to zero for default number of threads.

Definition at line 165 of file api/spec/init.h.

◆ num_control

int odp_init_t::num_control

Maximum number of control threads the user will run concurrently.

Valid range is from 0 to platform specific maximum. Set both num_worker and num_control to zero for default number of threads.

Definition at line 170 of file api/spec/init.h.

◆ worker_cpus

const odp_cpumask_t* odp_init_t::worker_cpus

Pointer to bit mask mapping CPUs available to this ODP instance for running worker threads.

Initialize to a NULL pointer to use default CPU mapping. When the mask is defined, odp_cpumask_default_worker() uses it instead of returning a default mask. Applications code should not access this cpumask directly. Valid range of CPUs and optimal CPU selection are platform specific, but generally it is recommended that: worker CPUs are dedicated to run only ODP worker threads (one thread per CPU) worker and control masks do not overlap different ODP instances do not specify overlapping worker masks

Definition at line 186 of file api/spec/init.h.

◆ control_cpus

const odp_cpumask_t* odp_init_t::control_cpus

Pointer to bit mask mapping CPUs available to this ODP instance for running control threads.

Initialize to a NULL pointer to use default CPU mapping. When the mask is defined, odp_cpumask_default_control() uses it instead of returning a default mask. Applications code should not access this cpumask directly. Valid range of CPUs and optimal CPU selection are platform specific, but generally it is recommended that worker and control masks do not overlap.

Definition at line 198 of file api/spec/init.h.

◆ not_used

odp_feature_t odp_init_t::not_used

Unused features.

These are hints to the ODP implementation that the application will not use any APIs associated with these features. Implementations may use this information to provide optimized behavior. Results are undefined if applications assert that a feature will not be used and it is used anyway.

Examples
odp_atomic_perf.c, odp_cpu_bench.c, odp_crc.c, odp_l2fwd.c, odp_lock_perf.c, odp_mem_perf.c, odp_packet_gen.c, odp_pool_perf.c, odp_queue_perf.c, odp_random.c, odp_sched_perf.c, odp_sched_pktio.c, odp_stash_perf.c, odp_timer_accuracy.c, and odp_timer_perf.c.

Definition at line 212 of file api/spec/init.h.

◆ mem_model

◆ max_memory

uint64_t odp_init_t::max_memory

Maximum memory usage in bytes.

This is the maximum amount of shared memory that application will reserve concurrently. Use 0 when not set. Default value is 0.

Definition at line 226 of file api/spec/init.h.


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