NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA DPA Device - Buffer
Collaboration diagram for DOCA DPA Device - Buffer:

Data Structures

struct  doca_dpa_dev_buf
 doca dpa device buf declaration More...
 
struct  doca_dpa_dev_buf_arr
 doca dpa device buf array declaration More...
 

Functions

struct doca_dpa_dev_buf __attribute__ ((__packed__))
 
struct doca_dpa_dev_buf_arr __attribute__ ((__packed__, aligned(64)))
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
DOCA_EXPERIMENTAL __forceinline uintptr_t doca_dpa_dev_buf_get_addr (doca_dpa_dev_buf_t buf)
 Get address from a DPA buffer handle. More...
 
DOCA_EXPERIMENTAL __forceinline uint64_t doca_dpa_dev_buf_get_len (doca_dpa_dev_buf_t buf)
 Get length from a DPA buffer handle. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Variables

__dpa_global__ typedef uint32_t doca_dpa_dev_mmap_t
 DPA mmap handle type definition. More...
 
__dpa_global__ typedef uint64_t doca_dpa_dev_buf_t
 DPA buffer handle type definition. More...
 
__dpa_global__ typedef uint64_t doca_dpa_dev_buf_arr_t
 DPA buffer array handle type definition. More...
 

Detailed Description

DOCA DPA Device - Buffer

Function Documentation

◆ __attribute__() [1/2]

struct doca_dpa_dev_buf __attribute__ ( (__packed__)  )

packed

< Meter marking packet color as red

< Meter marking packet color as yellow

< Meter marking packet color as green

Definition at line 213 of file doca_flow.h.

◆ __attribute__() [2/2]

struct doca_dpa_dev_buf_arr __attribute__ ( (__packed__, aligned(64))  )

packed and aligned

◆ doca_dpa_dev_buf_array_get_buf()

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.

Parameters
[in]buf_arr- DOCA DPA device buf array handle
[in]buf_idx- DOCA DPA buffer index
Returns
Handle to DPA buffer

Definition at line 79 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_get_addr()

DOCA_EXPERIMENTAL __forceinline uintptr_t doca_dpa_dev_buf_get_addr ( doca_dpa_dev_buf_t  buf)

Get address from a DPA buffer handle.

Parameters
[in]buf- DOCA DPA device buf handle
Returns
Address held by DPA buffer

Definition at line 138 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_get_external_ptr()

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.

This function allows the DPA process to obtain a pointer to external memory that is held by a DPA handle. The obtained pointer can be used to load/store data directly from the DPA kernel. The memory being accessed through the returned device pointer is subject to 64B alignment restriction

Note
'buf' must be created with a PF DOCA device and PF DOCA DPA context (not an extended DOCA DPA context). Otherwise updating the returned pointer will not work. In addition, please note __dpa_thread_window_writeback() API must be used after store operation to the obtained pointer, otherwise the external memory might not be updated and might lead to undefined behavior.
Parameters
[in]buf- DOCA DPA device buf handle
Returns
Device address pointing to external address

◆ doca_dpa_dev_buf_get_len()

DOCA_EXPERIMENTAL __forceinline uint64_t doca_dpa_dev_buf_get_len ( doca_dpa_dev_buf_t  buf)

Get length from a DPA buffer handle.

Parameters
[in]buf- DOCA DPA device buf handle
Returns
Length of DPA buffer

Definition at line 152 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_get_mmap()

Get the DOCA Mmap associated with a DPA buffer handle.

Parameters
[in]buf- DOCA DPA device buf handle
Returns
The Mmap DPA handle of DPA buffer

Definition at line 167 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_set_addr()

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.

Parameters
[in]buf- DOCA DPA device buf handle
[in]addr- The address to set

Definition at line 96 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_set_len()

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.

Parameters
[in]buf- DOCA DPA device buf handle
[in]len- The length to set

Definition at line 110 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_set_mmap()

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.

Parameters
[in]buf- DOCA DPA device buf handle
[in]mmap- The Mmap DPA handle to set

Definition at line 124 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_mmap_get_external_ptr()

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.

This function allows the DPA process to obtain a pointer to external memory that is held by a DOCA Mmap handle and given address. The obtained pointer can be used to load/store data directly from the DPA kernel. The memory being accessed through the returned device pointer is subject to 64B alignment restriction

Note
'mmap_handle' & 'addr' must be created with a PF DOCA device and PF DOCA DPA context (not an extended DOCA DPA context). Otherwise updating the returned pointer will not work. In addition, please note __dpa_thread_window_writeback() API must be used after store operation to the obtained pointer, otherwise the external memory might not be updated and might lead to undefined behavior.
Parameters
[in]mmap_handle- DOCA Mmap handle
[in]addr- external address to be accessed
Returns
Device address pointing to external address

◆ doca_dpa_dev_post_buf_memcpy()

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.

This function copies data between two DOCA buffers. The destination buffer, specified by dst_buf_handle will contain the copied data after the memory copy is complete. This is a non-blocking routine

Note
This API is relevant only for a kernel used for DPA thread ('doca_dpa_thread'), which was set previously using host API doca_dpa_thread_set_func_arg(). This API is not relevant for a kernel used in host kernel launch APIs.
Parameters
[in]async_ops_handle- DOCA DPA device asynchronous ops handle
[in]dst_buf_handle- destination DOCA buffer to copy into
[in]src_buf_handle- source DOCA buffer to read from
[in]flags- bitwise or of enum doca_dpa_dev_submit_flag (see enum doca_dpa_dev_submit_flag for more details)

◆ doca_dpa_dev_post_memcpy()

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.

This function copies data between two DOCA Mmaps. The destination DOCA Mmap, specified by dst_mmap_handle, dst_addr will contain the copied data in source DOCA Mmap specified by src_mmap_handle, src_addr and length after the memory copy is complete. This is a non-blocking routine

Note
This API is relevant only for a kernel used for DPA thread ('doca_dpa_thread'), which was set previously using host API doca_dpa_thread_set_func_arg(). This API is not relevant for a kernel used in host kernel launch APIs.
Parameters
[in]async_ops_handle- DOCA DPA device asynchronous ops handle
[in]dst_mmap_handle- destination DOCA Mmap handle to copy into
[in]dst_addr- address of destination buffer
[in]src_mmap_handle- source DOCA Mmap handle to read from
[in]src_addr- address of source buffer
[in]length- size of buffer
[in]flags- bitwise or of enum doca_dpa_dev_submit_flag (see enum doca_dpa_dev_submit_flag for more details)

Variable Documentation

◆ doca_dpa_dev_buf_arr_t

DPA buffer array handle type definition.

Definition at line 45 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_buf_t

__dpa_global__ typedef uint64_t doca_dpa_dev_buf_t

DPA buffer handle type definition.

Definition at line 40 of file doca_dpa_dev_buf.h.

◆ doca_dpa_dev_mmap_t

DPA mmap handle type definition.

Definition at line 35 of file doca_dpa_dev_buf.h.