NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_dpa_dev_buf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
23 #ifndef DOCA_DPA_DEV_BUF_H_
24 #define DOCA_DPA_DEV_BUF_H_
25 
26 #include <doca_dpa_dev.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 
41 
46 
54  uint64_t len;
56  unsigned char reserved[12];
57 } __attribute__((__packed__));
66  unsigned char reserved[20];
67 } __attribute__((__packed__, aligned(64)));
80 {
81  struct doca_dpa_dev_buf_arr *dev_buf_arr = (struct doca_dpa_dev_buf_arr *)(buf_arr);
82  doca_dpa_dev_buf_t dev_buf = (doca_dpa_dev_buf_t) & (dev_buf_arr->bufs[buf_idx]);
83 
84  return dev_buf;
85 }
86 
97 {
98  ((struct doca_dpa_dev_buf *)buf)->addr = addr;
99 }
100 
111 {
112  ((struct doca_dpa_dev_buf *)buf)->len = len;
113 }
114 
125 {
126  ((struct doca_dpa_dev_buf *)buf)->mmap = mmap;
127 }
128 
139 {
140  return ((struct doca_dpa_dev_buf *)buf)->addr;
141 }
142 
153 {
154  return ((struct doca_dpa_dev_buf *)buf)->len;
155 }
156 
168 {
169  return ((struct doca_dpa_dev_buf *)buf)->mmap;
170 }
171 
191 
210  doca_dpa_dev_buf_t dst_buf_handle,
211  doca_dpa_dev_buf_t src_buf_handle,
212  uint32_t flags);
213 
236  doca_dpa_dev_mmap_t dst_mmap_handle,
237  uint64_t dst_addr,
238  doca_dpa_dev_mmap_t src_mmap_handle,
239  uint64_t src_addr,
240  size_t length,
241  uint32_t flags);
242 
264 
265 #ifdef __cplusplus
266 }
267 #endif
268 
271 #endif /* DOCA_DPA_DEV_BUF_H_ */
uintptr_t addr
doca_dpa_dev_mmap_t mmap
uint64_t len
struct dpa_thread_arg __dpa_global__
uint64_t doca_dpa_dev_buf_arr_t
Type representing a doca_buf_arr handle on the DPA.
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
DOCA_EXPERIMENTAL void doca_dpa_dev_post_memcpy(doca_dpa_dev_async_ops_t async_ops_handle, doca_dpa_dev_mmap_t dst_mmap_handle, uint64_t dst_addr, doca_dpa_dev_mmap_t src_mmap_handle, uint64_t src_addr, size_t length, uint32_t flags)
Initiate a copy data between two DOCA Mmaps.
DOCA_EXPERIMENTAL __forceinline uintptr_t doca_dpa_dev_buf_get_addr(doca_dpa_dev_buf_t buf)
Get address from a DPA buffer handle.
DOCA_EXPERIMENTAL doca_dpa_dev_uintptr_t doca_dpa_dev_buf_get_external_ptr(doca_dpa_dev_buf_t buf)
Obtain a pointer to externally allocated memory.
__dpa_global__ typedef uint64_t doca_dpa_dev_buf_arr_t
DPA buffer array handle type definition.
__dpa_global__ typedef uint64_t doca_dpa_dev_buf_t
DPA buffer handle type definition.
struct doca_dpa_dev_buf __attribute__((__packed__))
Definition: doca_flow.h:267
__dpa_global__ typedef uint32_t doca_dpa_dev_mmap_t
DPA mmap handle type definition.
DOCA_EXPERIMENTAL void doca_dpa_dev_post_buf_memcpy(doca_dpa_dev_async_ops_t async_ops_handle, doca_dpa_dev_buf_t dst_buf_handle, doca_dpa_dev_buf_t src_buf_handle, uint32_t flags)
Initiate a copy data between two DOCA buffers.
DOCA_EXPERIMENTAL __forceinline uint64_t doca_dpa_dev_buf_get_len(doca_dpa_dev_buf_t buf)
Get length from a DPA buffer handle.
DOCA_EXPERIMENTAL doca_dpa_dev_uintptr_t doca_dpa_dev_mmap_get_external_ptr(doca_dpa_dev_mmap_t mmap_handle, uint64_t addr)
Obtain a pointer to externally allocated memory.
DOCA_EXPERIMENTAL __forceinline void doca_dpa_dev_buf_set_len(doca_dpa_dev_buf_t buf, size_t len)
Set the length of a DPA buffer handle.
DOCA_EXPERIMENTAL __forceinline doca_dpa_dev_mmap_t doca_dpa_dev_buf_get_mmap(doca_dpa_dev_buf_t buf)
Get the DOCA Mmap associated with a DPA buffer handle.
DOCA_EXPERIMENTAL __forceinline void doca_dpa_dev_buf_set_mmap(doca_dpa_dev_buf_t buf, doca_dpa_dev_mmap_t mmap)
Set the DOCA Mmap associated with a DPA buffer handle.
DOCA_EXPERIMENTAL __forceinline void doca_dpa_dev_buf_set_addr(doca_dpa_dev_buf_t buf, uintptr_t addr)
Set the address of a DPA buffer handle.
DOCA_EXPERIMENTAL __forceinline doca_dpa_dev_buf_t doca_dpa_dev_buf_array_get_buf(doca_dpa_dev_buf_arr_t buf_arr, const uint64_t buf_idx)
Get DPA buffer handle from a DPA buffer array handle.
#define __forceinline
static inline wrapper
Definition: doca_dpa_dev.h:130
uint64_t doca_dpa_dev_uintptr_t
DPA pointer type definition.
Definition: doca_dpa.h:78
uint64_t doca_dpa_dev_async_ops_t
DPA asynchronous ops handle type definition.
Definition: doca_dpa.h:93
uint32_t doca_dpa_dev_mmap_t
Handle on the DPA for a doca_mmap instance.
Definition: doca_mmap.h:74
uint32_t src_addr
Definition: packets.h:8
uint32_t dst_addr
Definition: packets.h:9
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:298
doca dpa device buf array declaration
unsigned char reserved[20]
struct doca_dpa_dev_buf * bufs
doca dpa device buf declaration
doca_dpa_dev_mmap_t mmap
unsigned char reserved[12]