API Reference Manual 1.52.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-2026 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/deprecated.h>
16#include <odp/api/std_types.h>
17#include <odp/api/dma_types.h>
18#include <odp/api/ml_types.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
49#define ODP_POOL_MAX_SUBPARAMS 7
50
56typedef union odp_pool_stats_opt_t {
58 struct {
60 uint64_t available : 1;
61
63 uint64_t alloc_ops : 1;
64
66 uint64_t alloc_fails : 1;
67
69 uint64_t free_ops : 1;
70
72 uint64_t total_ops : 1;
73
75 uint64_t cache_available : 1;
76
78 uint64_t cache_alloc_ops : 1;
79
81 uint64_t cache_free_ops : 1;
82
85 } bit;
86
91 uint64_t all;
92
94
102typedef struct odp_pool_stats_t {
104 uint64_t available;
105
108 uint64_t alloc_ops;
109
111 uint64_t alloc_fails;
112
114 uint64_t free_ops;
115
118 uint64_t total_ops;
119
122
126
129
131 struct {
134 uint16_t first;
135
138 uint16_t last;
139
147
149
157 uint64_t available;
158
160 uint64_t alloc_ops;
161
163 uint64_t alloc_fails;
164
166 uint64_t free_ops;
167
169 uint64_t total_ops;
170
173
176
179
181
185typedef struct odp_pool_capability_t {
187 uint32_t max_pools;
188
190 struct {
192 uint32_t max_pools;
193
195 uint32_t max_align;
196
201 uint32_t max_size;
202
207 uint32_t max_num;
208
211
224
227
230
234
236 struct {
238 uint32_t max_pools;
239
248 uint32_t max_len;
249
254 uint32_t max_num;
255
260 uint32_t max_align;
261
267 uint32_t min_headroom;
268
274 uint32_t max_headroom;
275
281 uint32_t min_tailroom;
282
285
290 uint32_t min_seg_len;
291
299 uint32_t max_seg_len;
300
302 uint32_t max_uarea_size;
303
308
314
316 uint32_t min_cache_size;
317
319 uint32_t max_cache_size;
320
324
326 struct {
328 uint32_t max_pools;
329
334 uint32_t max_num;
335
337 uint32_t max_uarea_size;
338
343
345 uint32_t min_cache_size;
346
348 uint32_t max_cache_size;
349
353
357 struct {
359 uint32_t max_pools;
360
365 uint32_t max_num;
366
368 uint32_t max_size;
369
371 uint32_t max_uarea_size;
372
377
379 uint32_t min_cache_size;
380
382 uint32_t max_cache_size;
383
387
389 struct {
391 uint32_t max_pools;
392
397 uint32_t max_num;
398
400 uint32_t max_size;
401
403 uint32_t max_uarea_size;
404
409
411 uint32_t min_cache_size;
412
414 uint32_t max_cache_size;
415
419
421
433
467
713
720#define ODP_POOL_POPULATE_DONE 0x1
721
733
737 uint32_t max_pools;
738
741
744
747
749 struct {
751 uint32_t max_num_buf;
752
754 uint32_t max_buf_size;
755
764
773
782
789
797
804 struct {
812 uint16_t buf_size_aligned : 1;
813
814 };
815
818
825
827
829 struct {
831 uint32_t max_num_buf;
832
834 uint32_t max_buf_size;
835
843 uint32_t odp_header_size;
844
852 uint32_t odp_trailer_size;
853
861 uint32_t min_mem_align;
862
868 uint32_t min_buf_align;
869
877
884 struct {
891 uint16_t buf_size_aligned : 1;
892
893 };
894
899 uint32_t max_headroom;
900
908
911
913 uint32_t max_uarea_size;
914
920
922
924
928typedef struct odp_pool_ext_param_t {
931
933 struct {
941 void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
942
945 void *args;
946
948
955 uint32_t cache_size;
956
964
966 struct {
972 uint32_t num_buf;
973
981 uint32_t buf_size;
982
991
999 uint32_t uarea_size;
1000
1002
1004 struct {
1010 uint32_t num_buf;
1011
1019 uint32_t buf_size;
1020
1028 uint32_t app_header_size;
1029
1037 uint32_t uarea_size;
1038
1047 uint32_t headroom;
1048
1050
1052
1117
1122#ifdef __cplusplus
1123}
1124#endif
1125
1126#include <odp/visibility_end.h>
1127#endif
ODP DMA.
ODP Machine Learning (ML) types.
Standard C language types and definitions for ODP.
Control deprecated API definitions.
#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.
#define ODP_DEPRECATE(x)
Macro to deprecate API definitions.
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.
struct odp_pool_capability_t::@135 buf
Buffer pool capabilities
struct odp_pool_capability_t::@137 tmo
Timeout pool capabilities
uint32_t max_num
Maximum number of buffers of any size.
uint32_t min_cache_size
Minimum size of thread local cache.
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::@136 pkt
Packet pool capabilities
uint32_t max_size
Maximum buffer data size in bytes.
struct odp_pool_capability_t::@139 event_vector
Event vector pool capabilities.
struct odp_pool_capability_t::@138 vector
Packet 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
Buffers are size aligned.
uint32_t max_pools
Maximum number of pools.
uint32_t max_num_buf
Maximum number of buffers.
odp_bool_t uarea_persistence
Pool user area persistence.
struct odp_pool_ext_capability_t::@146 buf
Buffer pool capabilities
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 buffer 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.
uint32_t max_cache_size
Maximum size of thread local cache.
struct odp_pool_ext_capability_t::@147 pkt
Packet pool capabilities
uint32_t min_data_align
Minimum buffer data alignment in bytes.
uint32_t odp_header_size
ODP header size in bytes.
uint32_t max_buf_size
Maximum buffer size in bytes.
uint32_t min_buf_align
Minimum buffer pointer alignment in bytes.
External memory pool parameters.
struct odp_pool_ext_param_t::@153 buf
Parameters for buffer pools.
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).
struct odp_pool_ext_param_t::@154 pkt
Parameters for packet pools.
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
Buffer size.
struct odp_pool_ext_param_t::@152 uarea_init
Parameters for user area initialization.
uint32_t num_buf
Number of 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.
struct odp_pool_info_t::@157 pkt
Additional info for packet pools.
odp_pool_param_t params
Copy of pool parameters.
odp_bool_t pool_ext
External memory pool.
uintptr_t max_data_addr
Maximum data address.
uint32_t uarea_size
Minimum user area size in bytes.
struct odp_pool_param_t::@144 event_vector
Parameters for event vector pools.
struct odp_pool_param_t::@142 tmo
Parameters for timeout pools.
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.
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.
struct odp_pool_param_t::@140 buf
Parameters for buffer pools.
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.
struct odp_pool_param_t::@141 pkt
Parameters for packet pools.
uint32_t len
Minimum length of 'num' packets.
uint32_t max_size
Maximum number of handles (such as odp_packet_t) in a vector.
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::@145 uarea_init
Parameters for user area initialization.
struct odp_pool_param_t::@143 vector
Parameters for packet vector pools.
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::@134 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.
struct odp_pool_stats_opt_t::@133 bit
Option flags.
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.