API Reference Manual  1.45.0
odp_pool_param_t Struct Reference

Pool parameters. More...

#include <pool_types.h>

Collaboration diagram for odp_pool_param_t:
[legend]

Data Fields

odp_pool_type_t type
 Pool type.
 
struct {
   uint32_t   num
 Number of buffers in the pool.
 
   uint32_t   size
 Minimum buffer size in bytes. More...
 
   uint32_t   align
 Minimum buffer alignment in bytes. More...
 
   uint32_t   uarea_size
 Minimum user area size in bytes. More...
 
   uint32_t   cache_size
 Maximum number of buffers cached locally per thread. More...
 
buf
 Parameters for buffer pools.
 
struct {
   uint32_t   num
 Minimum number of 'len' byte packets. More...
 
   uint32_t   max_num
 Maximum number of packets. More...
 
   uint32_t   len
 Minimum length of 'num' packets. More...
 
   uint32_t   max_len
 Maximum packet length that will be allocated from the pool. More...
 
   uint32_t   align
 Minimum packet data alignment in bytes. More...
 
   uint32_t   seg_len
 Minimum number of packet data bytes that can be stored in the first segment of a newly allocated packet (starting from odp_packet_data()). More...
 
   uint32_t   uarea_size
 Minimum user area size in bytes. More...
 
   uint32_t   headroom
 Minimum headroom size in bytes. More...
 
   uint8_t   num_subparam
 Number of subparameters. More...
 
   odp_pool_pkt_subparam_t   sub [ODP_POOL_MAX_SUBPARAMS]
 Subparameter table. More...
 
   uint32_t   cache_size
 Maximum number of packets cached locally per thread. More...
 
pkt
 Parameters for packet pools.
 
struct {
   uint32_t   num
 Number of timeouts in the pool.
 
   uint32_t   uarea_size
 Minimum user area size in bytes. More...
 
   uint32_t   cache_size
 Maximum number of timeouts cached locally per thread. More...
 
tmo
 Parameters for timeout pools.
 
struct {
   uint32_t   num
 Number of vectors in the pool.
 
   uint32_t   max_size
 Maximum number of handles (such as odp_packet_t) in a vector.
 
   uint32_t   uarea_size
 Minimum user area size in bytes. More...
 
   uint32_t   cache_size
 Maximum number of vectors cached locally per thread. More...
 
vector
 Parameters for vector pools.
 
struct {
   void(*   init_fn )(void *uarea, uint32_t size,
      void *args, uint32_t index)
 User area initialization function. More...
 
   void *   args
 Pointer to application defined arguments to be passed to every call of init_fn. More...
 
uarea_init
 Parameters for user area initialization.
 
odp_pool_stats_opt_t stats
 Configure statistics counters. More...
 

Detailed Description

Field Documentation

◆ num

uint32_t odp_pool_param_t::num

Number of buffers in the pool.

Number of vectors in the pool.

Number of timeouts in the pool.

Minimum number of 'len' byte packets.

The pool must contain at least this many packets that are 'len' bytes or smaller. An implementation may round up the value, as long as the 'max_num' parameter below is not violated. The maximum value for this field is defined by pool capability pkt.max_num.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_bench_buffer.c, odp_bench_packet.c, odp_bench_pktio_sp.c, odp_bench_timer.c, odp_classifier.c, odp_cpu_bench.c, odp_crypto.c, odp_debug.c, odp_dma_perf.c, odp_dmafwd.c, odp_ipfragreass.c, odp_ipsec.c, odp_ipsecfwd.c, odp_l2fwd.c, odp_l2fwd_simple.c, odp_l3fwd.c, odp_packet_dump.c, odp_packet_gen.c, odp_ping.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_sched_latency.c, odp_sched_perf.c, odp_sched_pktio.c, odp_simple_pipeline.c, odp_stress.c, odp_switch.c, odp_sysinfo.c, odp_timer_accuracy.c, odp_timer_perf.c, odp_timer_simple.c, and odp_traffic_mgmt.c.

Definition at line 438 of file api/spec/pool_types.h.

◆ size

uint32_t odp_pool_param_t::size

Minimum buffer size in bytes.

An implementation may round up the given value. The maximum value is defined by buf.max_size pool capability.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_bench_buffer.c, odp_debug.c, odp_dmafwd.c, odp_pool_latency.c, odp_pool_perf.c, odp_sched_latency.c, and odp_sched_perf.c.

Definition at line 445 of file api/spec/pool_types.h.

◆ align

uint32_t odp_pool_param_t::align

Minimum buffer alignment in bytes.

Minimum packet data alignment in bytes.

Valid values are powers of two. Use 0 for default alignment. Default will always be a multiple of 8.

Valid values are powers of two. User allocated packets have start of data (see odp_packet_data()) aligned to this or a higher alignment (power of two value). This parameter does not apply to packets that ODP allocates internally (e.g. packets from packet input).

The maximum value is defined by pool capability pkt.max_align. Use 0 for default alignment.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_sched_latency.c, and odp_sched_perf.c.

Definition at line 451 of file api/spec/pool_types.h.

◆ uarea_size

uint32_t odp_pool_param_t::uarea_size

Minimum user area size in bytes.

The maximum value is defined by pool capability buf.max_uarea_size. Specify as 0 if no user area is needed. The default value is 0.

The maximum value is defined by pool capability pkt.max_uarea_size. Specify as 0 if no user area is needed. The default value is 0.

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.

The maximum value is defined by pool capability vector.max_uarea_size. Specify as 0 if no user area is needed. The default value is 0.

Examples
odp_bench_buffer.c, odp_bench_packet.c, odp_bench_timer.c, odp_cpu_bench.c, odp_ipfragreass.c, odp_pktio_ordered.c, odp_pool_latency.c, odp_sched_perf.c, and odp_traffic_mgmt.c.

Definition at line 457 of file api/spec/pool_types.h.

◆ cache_size

uint32_t odp_pool_param_t::cache_size

Maximum number of buffers cached locally per thread.

Maximum number of vectors cached locally per thread.

Maximum number of timeouts cached locally per thread.

Maximum number of packets cached locally per thread.

A non-zero value allows implementation to cache buffers locally per each thread. Thread local caching may improve performance, but requires application to take account that some buffers may be stored locally per thread and thus are not available for allocation from other threads.

This is the maximum number of buffers to be cached per thread. The actual cache size is implementation specific. The value must not be less than 'min_cache_size' or exceed 'max_cache_size' capability. The default value is implementation specific and set by odp_pool_param_init().

See buf.cache_size documentation for details.

Examples
odp_bench_buffer.c, odp_bench_packet.c, odp_dma_perf.c, odp_dmafwd.c, odp_pool_latency.c, and odp_pool_perf.c.

Definition at line 473 of file api/spec/pool_types.h.

◆ max_num

uint32_t odp_pool_param_t::max_num

Maximum number of packets.

This is the maximum number of packets of any length that can be allocated from the pool. The maximum value is defined by pool capability pkt.max_num. Use 0 when there's no requirement for the maximum number of packets. The default value is 0.

Examples
odp_cpu_bench.c, and odp_pool_perf.c.

Definition at line 496 of file api/spec/pool_types.h.

◆ len

uint32_t odp_pool_param_t::len

Minimum length of 'num' packets.

The pool must contain at least 'num' packets up to this packet length (1 ... 'len' bytes). The maximum value for this field is defined by pool capability pkt.max_len. Use 0 for default.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_bench_packet.c, odp_bench_pktio_sp.c, odp_classifier.c, odp_cpu_bench.c, odp_crypto.c, odp_debug.c, odp_dma_perf.c, odp_dmafwd.c, odp_ipfragreass.c, odp_ipsec.c, odp_ipsecfwd.c, odp_l2fwd.c, odp_l2fwd_simple.c, odp_l3fwd.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_sched_perf.c, odp_sched_pktio.c, odp_simple_pipeline.c, odp_switch.c, and odp_traffic_mgmt.c.

Definition at line 505 of file api/spec/pool_types.h.

◆ max_len

uint32_t odp_pool_param_t::max_len

Maximum packet length that will be allocated from the pool.

The maximum value is defined by pool capability pkt.max_len. Use 0 for default.

Examples
odp_cpu_bench.c, odp_debug.c, and odp_pool_perf.c.

Definition at line 511 of file api/spec/pool_types.h.

◆ seg_len

uint32_t odp_pool_param_t::seg_len

Minimum number of packet data bytes that can be stored in the first segment of a newly allocated packet (starting from odp_packet_data()).

The maximum value is defined by pool capability pkt.max_seg_len. Use 0 for default.

Examples
ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_bench_packet.c, odp_classifier.c, odp_cpu_bench.c, odp_crypto.c, odp_dma_perf.c, odp_dmafwd.c, odp_ipfragreass.c, odp_ipsec.c, odp_ipsecfwd.c, odp_l2fwd.c, odp_l2fwd_simple.c, odp_l3fwd.c, odp_packet_gen.c, odp_pktio.c, odp_pktio_ordered.c, odp_pktio_perf.c, odp_pool_latency.c, odp_sched_perf.c, odp_sched_pktio.c, odp_simple_pipeline.c, odp_switch.c, and odp_traffic_mgmt.c.

Definition at line 531 of file api/spec/pool_types.h.

◆ headroom

uint32_t odp_pool_param_t::headroom

Minimum headroom size in bytes.

Each newly allocated packet from the pool must have at least this much headroom. The maximum value is defined by pool capability pkt.max_headroom. Use zero if headroom is not needed.

Definition at line 544 of file api/spec/pool_types.h.

◆ num_subparam

uint8_t odp_pool_param_t::num_subparam

Number of subparameters.

The number of subparameter table entries used. The maximum value is defined by pool capability pkt.max_num_subparam. The default value is 0.

Definition at line 552 of file api/spec/pool_types.h.

◆ sub

Subparameter table.

Subparameters continue pool configuration with additional packet length requirements. The first table entry follows the num/len specification above. So that, sub[0].len > 'len' and sub[0].num refers to packet lengths between 'len' + 1 and sub[0].len. Similarly, sub[1] follows sub[0] specification, and so on.

Each requirement is supported separately and may be rounded up, as long as the 'max_num' parameter is not violated. It's implementation specific if some requirements are supported simultaneously (e.g. due to subpool design).

Definition at line 568 of file api/spec/pool_types.h.

◆ init_fn

void(* odp_pool_param_t::init_fn) (void *uarea, uint32_t size, void *args, uint32_t index)

User area initialization function.

Application defined user area initialization function to be called for each event of the pool during odp_pool_create(). Ignored if user area persistence is not supported (odp_pool_capability_t::uarea_persistence) or pool will not have any user area. The default value is NULL.

Parameters
uareaPointer to the user area of an event
sizeUser area size
argsPointer to application defined arguments
indexIndex of the event (0..num events in pool - 1), not necessarily in order

Definition at line 632 of file api/spec/pool_types.h.

◆ args

void* odp_pool_param_t::args

Pointer to application defined arguments to be passed to every call of init_fn.

The default value is NULL.

Definition at line 637 of file api/spec/pool_types.h.

◆ stats

odp_pool_stats_opt_t odp_pool_param_t::stats

Configure statistics counters.

An application can read the enabled statistics counters using odp_pool_stats(). For optimal performance an application should enable only the required counters.

Examples
odp_pool_perf.c.

Definition at line 647 of file api/spec/pool_types.h.


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