API Reference Manual  1.45.1
api/spec/dma_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2021-2023 Nokia
3  */
4 
11 #ifndef ODP_API_SPEC_DMA_TYPES_H_
12 #define ODP_API_SPEC_DMA_TYPES_H_
13 #include <odp/visibility_begin.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <odp/api/event_types.h>
20 #include <odp/api/packet_types.h>
21 #include <odp/api/queue_types.h>
22 #include <odp/api/std_types.h>
23 
69 typedef struct odp_dma_pool_capability_t {
73  uint32_t max_pools;
74 
76  uint32_t max_num;
77 
79  uint32_t max_uarea_size;
80 
86 
88  uint32_t min_cache_size;
89 
91  uint32_t max_cache_size;
92 
94 
98 typedef struct odp_dma_pool_param_t {
102  uint32_t num;
103 
109  uint32_t uarea_size;
110 
112  struct {
116  void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
117 
120  void *args;
121 
123 
130  uint32_t cache_size;
131 
133 
134 /* Includes pool_types.h, which depends on odp_dma_pool_param_t. */
135 #include <odp/api/queue_types.h>
136 
145 typedef uint32_t odp_dma_direction_t;
146 
148 #define ODP_DMA_MAIN_TO_MAIN 0x1u
149 
157 typedef uint32_t odp_dma_transfer_type_t;
158 
168 #define ODP_DMA_TYPE_COPY 0x1u
169 
181 typedef uint32_t odp_dma_compl_mode_t;
182 
190 #define ODP_DMA_COMPL_NONE 0x1u
191 
197 #define ODP_DMA_COMPL_SYNC 0x2u
198 
204 #define ODP_DMA_COMPL_EVENT 0x4u
205 
211 #define ODP_DMA_COMPL_POLL 0x8u
212 
216 typedef enum {
219 
222 
224 
238 typedef enum {
244 
251 
258 
260 
264 typedef enum {
270 
279 
281 
285 typedef struct odp_dma_capability_t {
290  uint32_t max_sessions;
291 
297  uint32_t max_transfers;
298 
300  uint32_t max_src_segs;
301 
303  uint32_t max_dst_segs;
304 
306  uint32_t max_segs;
307 
311  uint32_t max_seg_len;
312 
319 
327 
335 
338 
340 
344 typedef struct odp_dma_param_t {
350 
356 
366 
372 
378 
380 
384 typedef struct odp_dma_seg_t {
386  union {
392  void *addr;
393 
399 
400  };
401 
408  uint32_t len;
409 
416  uint32_t offset;
417 
423  union {
425  struct {
431  uint16_t full_lines : 1;
432  };
433 
439  uint16_t all_hints;
440  };
441 
443 
458 typedef struct odp_dma_transfer_param_t {
464 
470 
475  uint32_t num_src;
476 
481  uint32_t num_dst;
482 
488 
494 
496 
500 typedef struct odp_dma_compl_param_t {
512 
521 
530 
536 
544  void *user_ptr;
545 
547 
549 typedef struct odp_dma_result_t {
556 
562  void *user_ptr;
563 
565 
570 #ifdef __cplusplus
571 }
572 #endif
573 
574 #include <odp/visibility_end.h>
575 #endif
576 
ODP event API type definitions.
ODP packet.
ODP queue.
Standard C language types and definitions for ODP.
uint32_t odp_dma_compl_mode_t
DMA transfer completion mode.
uint32_t odp_dma_transfer_type_t
DMA transfer type.
struct odp_dma_pool_capability_t odp_dma_pool_capability_t
DMA completion event pool capabilities.
odp_dma_mt_mode_t
DMA transfer multi-thread safeness.
struct odp_dma_param_t odp_dma_param_t
DMA session parameters.
odp_dma_data_format_t
DMA transfer data format.
struct odp_dma_seg_t odp_dma_seg_t
DMA segment.
uint32_t odp_dma_direction_t
DMA transfer direction.
struct odp_dma_pool_param_t odp_dma_pool_param_t
DMA completion event pool parameters.
uint64_t odp_dma_transfer_id_t
DMA transfer identifier.
struct odp_dma_result_t odp_dma_result_t
DMA transfer results.
struct odp_dma_capability_t odp_dma_capability_t
DMA capabilities.
struct odp_dma_transfer_param_t odp_dma_transfer_param_t
DMA transfer parameters.
odp_dma_transfer_order_t
DMA transfer ordering.
struct odp_dma_compl_param_t odp_dma_compl_param_t
DMA transfer completion parameters.
@ ODP_DMA_MT_SAFE
Multi-thread safe operation.
@ ODP_DMA_MT_SERIAL
Application serializes operations.
@ ODP_DMA_FORMAT_PACKET
Data format is odp_packet_t.
@ ODP_DMA_FORMAT_ADDR
Data format is raw memory address.
@ ODP_DMA_ORDER_ALL
Perform all transfers in order.
@ ODP_DMA_ORDER_COMPL
Report transfer completions in order.
@ ODP_DMA_ORDER_NONE
No specific ordering between transfers.
bool odp_bool_t
Boolean type.
uint32_t max_sessions
Maximum number of DMA sessions.
uint32_t max_transfers
Maximum number of transfers per DMA session.
odp_dma_pool_capability_t pool
DMA completion event pool capabilities.
uint32_t max_segs
Maximum number of destination and source segments combined in a single transfer.
uint32_t max_dst_segs
Maximum number of destination segments in a single transfer.
uint32_t max_src_segs
Maximum number of source segments in a single transfer.
odp_bool_t queue_type_sched
Scheduled queue support.
odp_dma_compl_mode_t compl_mode_mask
Supported completion modes.
uint32_t max_seg_len
Maximum segment length in bytes.
odp_bool_t queue_type_plain
Plain queue support.
DMA transfer completion parameters.
odp_dma_transfer_id_t transfer_id
Transfer identifier.
void * user_ptr
User context pointer.
odp_event_t event
Completion event.
odp_dma_compl_mode_t compl_mode
Completion mode.
odp_queue_t queue
Completion queue.
DMA session parameters.
odp_dma_compl_mode_t compl_mode_mask
Transfer completion modes.
odp_dma_direction_t direction
Transfer direction.
odp_dma_transfer_order_t order
Transfer ordering.
odp_dma_mt_mode_t mt_mode
Transfer operation multi-thread safeness.
odp_dma_transfer_type_t type
Transfer type.
DMA completion event pool capabilities.
odp_bool_t uarea_persistence
Pool user area persistence.
uint32_t min_cache_size
Minimum size of thread local cache.
uint32_t max_cache_size
Maximum size of thread local cache.
uint32_t max_uarea_size
Maximum user area size in bytes.
uint32_t max_pools
Maximum number of DMA completion event pools.
uint32_t max_num
Maximum number of DMA completion events in a pool.
DMA completion event pool parameters.
void * args
See uarea_init.args of odp_pool_param_t for details (odp_pool_param_t::args).
uint32_t cache_size
Maximum number of events cached locally per thread.
uint32_t uarea_size
User area size in bytes.
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 num
Number of DMA completion events in the pool.
struct odp_dma_pool_param_t::@30 uarea_init
Parameters for user area initialization.
DMA transfer results.
void * user_ptr
User context pointer.
odp_bool_t success
DMA transfer success.
odp_packet_t packet
Packet handle.
uint32_t len
Segment length in bytes.
uint32_t offset
Segment start offset into the packet.
void * addr
Segment start address in memory.
uint16_t all_hints
All bits of the bit field structure.
uint16_t full_lines
Allow full cache line access.
DMA transfer parameters.
odp_dma_seg_t * dst_seg
Table of destination segments.
odp_dma_data_format_t dst_format
Destination data format.
uint32_t num_dst
Number of destination segments.
uint32_t num_src
Number of source segments.
odp_dma_seg_t * src_seg
Table of source segments.
odp_dma_data_format_t src_format
Source data format.