API Reference Manual 1.51.0
Loading...
Searching...
No Matches
api/spec/pool_types.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2021-2025 Nokia
3 */
4
11#ifndef ODP_API_SPEC_POOL_TYPES_H_
12#define ODP_API_SPEC_POOL_TYPES_H_
13#include <odp/visibility_begin.h>
14
15#include <odp/api/std_types.h>
16#include <odp/api/dma_types.h>
17#include <odp/api/ml_types.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
48#define ODP_POOL_MAX_SUBPARAMS 7
49
55typedef union odp_pool_stats_opt_t {
57 struct {
59 uint64_t available : 1;
60
62 uint64_t alloc_ops : 1;
63
65 uint64_t alloc_fails : 1;
66
68 uint64_t free_ops : 1;
69
71 uint64_t total_ops : 1;
72
74 uint64_t cache_available : 1;
75
77 uint64_t cache_alloc_ops : 1;
78
80 uint64_t cache_free_ops : 1;
81
84 } bit;
85
90 uint64_t all;
91
93
101typedef struct odp_pool_stats_t {
103 uint64_t available;
104
107 uint64_t alloc_ops;
108
110 uint64_t alloc_fails;
111
113 uint64_t free_ops;
114
117 uint64_t total_ops;
118
121
125
128
130 struct {
133 uint16_t first;
134
137 uint16_t last;
138
146
148
156 uint64_t available;
157
159 uint64_t alloc_ops;
160
162 uint64_t alloc_fails;
163
165 uint64_t free_ops;
166
168 uint64_t total_ops;
169
172
175
178
180
184typedef struct odp_pool_capability_t {
186 uint32_t max_pools;
187
189 struct {
191 uint32_t max_pools;
192
194 uint32_t max_align;
195
200 uint32_t max_size;
201
206 uint32_t max_num;
207
210
223
226
229
233
235 struct {
237 uint32_t max_pools;
238
247 uint32_t max_len;
248
253 uint32_t max_num;
254
259 uint32_t max_align;
260
266 uint32_t min_headroom;
267
273 uint32_t max_headroom;
274
280 uint32_t min_tailroom;
281
284
289 uint32_t min_seg_len;
290
298 uint32_t max_seg_len;
299
301 uint32_t max_uarea_size;
302
307
313
315 uint32_t min_cache_size;
316
318 uint32_t max_cache_size;
319
323
325 struct {
327 uint32_t max_pools;
328
333 uint32_t max_num;
334
336 uint32_t max_uarea_size;
337
342
344 uint32_t min_cache_size;
345
347 uint32_t max_cache_size;
348
352
354 struct {
356 uint32_t max_pools;
357
362 uint32_t max_num;
363
365 uint32_t max_size;
366
368 uint32_t max_uarea_size;
369
374
376 uint32_t min_cache_size;
377
379 uint32_t max_cache_size;
380
384
386 struct {
388 uint32_t max_pools;
389
394 uint32_t max_num;
395
397 uint32_t max_size;
398
400 uint32_t max_uarea_size;
401
406
408 uint32_t min_cache_size;
409
411 uint32_t max_cache_size;
412
416
418
430
434typedef enum odp_pool_type_t {
436 ODP_POOL_PACKET = ODP_EVENT_PACKET,
437
439 ODP_POOL_BUFFER = ODP_EVENT_BUFFER,
440
442 ODP_POOL_TIMEOUT = ODP_EVENT_TIMEOUT,
443
451
454
457
460
462
706
713#define ODP_POOL_POPULATE_DONE 0x1
714
726
730 uint32_t max_pools;
731
734
737
740
742 struct {
744 uint32_t max_num_buf;
745
747 uint32_t max_buf_size;
748
757
766
775
782
790
797 struct {
804 uint16_t buf_size_aligned : 1;
805
806 };
807
812 uint32_t max_headroom;
813
821
824
827
833
835
837
841typedef struct odp_pool_ext_param_t {
844
846 struct {
854 void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
855
858 void *args;
859
861
868 uint32_t cache_size;
869
877
879 struct {
885 uint32_t num_buf;
886
894 uint32_t buf_size;
895
904
912 uint32_t uarea_size;
913
922 uint32_t headroom;
923
925
927
992
997#ifdef __cplusplus
998}
999#endif
1000
1001#include <odp/visibility_end.h>
1002#endif
ODP DMA.
ODP Machine Learning (ML) types.
Standard C language types and definitions for ODP.
#define ODP_POOL_MAX_SUBPARAMS
Maximum number of packet pool subparameters.
#define ODP_POOL_MAX_THREAD_STATS
Maximum number of per thread statistics a single odp_pool_stats() call can read.
odp_pool_type_t
Pool types.
@ ODP_POOL_TIMEOUT
Timeout pool.
@ ODP_POOL_VECTOR
Vector event pool.
@ ODP_POOL_BUFFER
Buffer pool.
@ ODP_POOL_PACKET
Packet pool.
@ ODP_POOL_DMA_COMPL
DMA completion event pool.
@ ODP_POOL_ML_COMPL
ML completion event pool.
@ ODP_POOL_EVENT_VECTOR
Event vector pool.
bool odp_bool_t
Boolean type.
DMA completion event pool parameters.
ML completion event pool parameters.
uint32_t max_align
Maximum buffer data alignment in bytes.
uint32_t max_headroom
Maximum packet level headroom length in bytes.
uint32_t min_headroom
Minimum packet level headroom length in bytes.
uint32_t max_num
Maximum number of buffers of any size.
uint32_t min_cache_size
Minimum size of thread local cache.
struct odp_pool_capability_t::@133 buf
Buffer pool capabilities
struct odp_pool_capability_t::@135 tmo
Timeout pool capabilities
uint32_t max_segs_per_pkt
Maximum number of segments per packet.
odp_bool_t uarea_persistence
Pool user area persistence.
uint32_t max_uarea_size
Maximum user area size in bytes.
struct odp_pool_capability_t::@134 pkt
Packet pool capabilities
struct odp_pool_capability_t::@137 event_vector
Event vector pool capabilities.
uint32_t max_size
Maximum buffer data size in bytes.
struct odp_pool_capability_t::@136 vector
Vector pool capabilities.
uint8_t max_num_subparam
Maximum number of subparameters.
odp_pool_stats_opt_t stats
Supported statistics counters.
uint32_t max_cache_size
Maximum size of thread local cache.
uint32_t min_seg_len
Minimum packet segment data length in bytes.
uint32_t max_pools
Maximum number of pools of any type (odp_pool_type_t)
uint32_t min_tailroom
Minimum packet level tailroom length in bytes.
uint32_t max_seg_len
Maximum packet segment data length in bytes.
uint32_t max_len
Maximum packet data length in bytes.
External memory pool capabilities.
uint16_t buf_size_aligned
Packet buffers are size aligned.
uint32_t max_pools
Maximum number of pools.
uint32_t max_num_buf
Maximum number of packet buffers.
odp_bool_t uarea_persistence
Pool user area persistence.
uint32_t max_segs_per_pkt
Maximum number of segments per packet.
uint32_t max_headroom
Maximum headroom parameter value.
uint32_t odp_trailer_size
ODP trailer size in bytes.
uint32_t min_mem_align
Minimum packet pool memory area alignment in bytes.
uint32_t max_uarea_size
Maximum user area size in bytes.
uint32_t min_head_align
Minimum packet headroom alignment in bytes.
uint32_t min_cache_size
Minimum size of thread local cache.
odp_pool_type_t type
Requested pool type.
odp_pool_stats_opt_t stats
Supported statistics counters.
uint32_t max_headroom_size
Maximum headroom size in bytes.
struct odp_pool_ext_capability_t::@144 pkt
Packet pool capabilities
uint32_t max_cache_size
Maximum size of thread local cache.
uint32_t odp_header_size
ODP header size in bytes.
uint32_t max_buf_size
Maximum packet buffer size in bytes.
uint32_t min_buf_align
Minimum packet buffer pointer alignment in bytes.
External memory pool parameters.
struct odp_pool_ext_param_t::@148 pkt
Parameters for packet pools.
struct odp_pool_ext_param_t::@147 uarea_init
Parameters for user area initialization.
odp_pool_type_t type
Pool type.
void(* init_fn)(void *uarea, uint32_t size, void *args, uint32_t index)
See uarea_init.init_fn of odp_pool_param_t for details (odp_pool_param_t::init_fn).
uint32_t uarea_size
User area size.
uint32_t app_header_size
Application header size.
uint32_t headroom
Minimum headroom size.
uint32_t cache_size
Maximum thread local cache size for the pool.
void * args
See uarea_init.args of odp_pool_param_t for details (odp_pool_param_t::args).
odp_pool_stats_opt_t stats
Pool statistics configuration.
uint32_t buf_size
Packet buffer size.
uint32_t num_buf
Number of packet buffers.
Pool information struct Used to get information about a pool.
odp_dma_pool_param_t dma_pool_param
Copy of pool parameters when pool type is ODP_POOL_DMA_COMPL.
uint32_t max_num
Maximum number of packets of any length.
odp_pool_ext_param_t pool_ext_param
Copy of external memory pool parameters.
odp_ml_compl_pool_param_t ml_pool_param
Copy of pool parameters when pool type is ODP_POOL_ML_COMPL.
uintptr_t min_data_addr
Minimum data address.
const char * name
Pool name.
odp_pool_type_t type
Pool type.
odp_pool_param_t params
Copy of pool parameters.
odp_bool_t pool_ext
External memory pool.
struct odp_pool_info_t::@151 pkt
Additional info for packet pools.
uintptr_t max_data_addr
Maximum data address.
uint32_t uarea_size
Minimum user area size in bytes.
void * args
Pointer to application defined arguments to be passed to every call of init_fn.
uint32_t num
Number of buffers in the pool.
struct odp_pool_param_t::@139 pkt
Parameters for packet pools.
struct odp_pool_param_t::@142 event_vector
Parameters for event vector pools.
uint32_t max_len
Maximum packet length that will be allocated from the pool.
uint32_t align
Minimum buffer alignment in bytes.
uint32_t headroom
Minimum headroom size in bytes.
odp_pool_pkt_subparam_t sub[ODP_POOL_MAX_SUBPARAMS]
Subparameter table.
uint32_t cache_size
Maximum number of buffers cached locally per thread.
uint8_t num_subparam
Number of subparameters.
void(* init_fn)(void *uarea, uint32_t size, void *args, uint32_t index)
User area initialization function.
uint32_t size
Minimum buffer size in bytes.
uint32_t max_num
Maximum number of packets.
odp_pool_type_t type
Pool type.
uint32_t len
Minimum length of 'num' packets.
uint32_t max_size
Maximum number of handles (such as odp_packet_t) in a vector.
struct odp_pool_param_t::@138 buf
Parameters for buffer pools.
struct odp_pool_param_t::@140 tmo
Parameters for timeout pools.
uint32_t seg_len
Minimum number of packet data bytes that can be stored in the first segment of a newly allocated pack...
odp_pool_stats_opt_t stats
Configure statistics counters.
struct odp_pool_param_t::@141 vector
Parameters for vector pools.
struct odp_pool_param_t::@143 uarea_init
Parameters for user area initialization.
Packet pool subparameters.
uint32_t len
Packet length in bytes.
uint32_t num
Number of 'len' byte packets.
Pool statistics counters.
uint64_t cache_free_ops
See odp_pool_stats_t::cache_free_ops.
uint64_t cache_alloc_ops
See odp_pool_stats_t::cache_alloc_ops.
uint64_t cache_available
See odp_pool_stats_t::cache_available.
uint64_t free_ops
See odp_pool_stats_t::free_ops.
uint64_t available
See odp_pool_stats_t::available.
uint64_t total_ops
See odp_pool_stats_t::total_ops.
uint64_t alloc_ops
See odp_pool_stats_t::alloc_ops.
uint64_t alloc_fails
See odp_pool_stats_t::alloc_fails.
Pool statistics counters.
uint64_t alloc_ops
The number of alloc operations from the pool.
uint64_t available
The number of available events in the pool.
uint16_t first
First thread identifier to read counters from.
struct odp_pool_stats_t::@132 thread
Per thread counters.
uint64_t free_ops
The number of free operations to the pool.
uint64_t cache_free_ops
The number of free operations, which stored events to pool caches.
uint64_t alloc_fails
The number of failed alloc operations (pool empty)
uint64_t total_ops
The total number of alloc and free operations.
uint64_t cache_alloc_ops
The number of successful alloc operations from pool caches (returned at least one event).
uint64_t cache_available
The number of available events in the local caches of all threads.
uint16_t last
Last thread identifier to read counters from.
Pool statistics counters options.
uint64_t total_ops
See odp_pool_stats_t::total_ops.
uint64_t cache_free_ops
See odp_pool_stats_t::cache_free_ops.
uint64_t cache_available
See odp_pool_stats_t::cache_available.
uint64_t alloc_fails
See odp_pool_stats_t::alloc_fails.
uint64_t thread_cache_available
See odp_pool_stats_t::thread::cache_available.
uint64_t free_ops
See odp_pool_stats_t::free_ops.
uint64_t alloc_ops
See odp_pool_stats_t::alloc_ops.
uint64_t available
See odp_pool_stats_t::available.
uint64_t all
All bits of the bit field structure.
uint64_t cache_alloc_ops
See odp_pool_stats_t::cache_alloc_ops.
struct odp_pool_stats_opt_t::@131 bit
Option flags.