NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
dpa_initiator_target_kernels_dev.c File Reference
Include dependency graph for dpa_initiator_target_kernels_dev.c:

Go to the source code of this file.

Functions

__dpa_global__ void thread1_kernel (uint64_t arg)
 Kernel function for DPA thread #1. More...
 
__dpa_global__ void thread2_kernel (uint64_t arg)
 Kernel function for DPA thread #2. More...
 
__dpa_rpc__ uint64_t rdma_post_receive_rpc (doca_dpa_dev_t rdma_dpa_ctx_handle, doca_dpa_dev_rdma_t target_rdma, doca_dpa_dev_uintptr_t local_buf_addr, doca_dpa_dev_mmap_t dpa_mmap_handle, size_t length)
 RPC function to post first RDMA receive operation on target RDMA. More...
 
__dpa_rpc__ uint64_t rdma_post_send_imm_rpc (doca_dpa_dev_t rdma_dpa_ctx_handle, doca_dpa_dev_rdma_t rdma, uint32_t connection_id, uintptr_t local_buf_addr, doca_dpa_dev_mmap_t dpa_mmap_handle, size_t length, uint32_t immediate)
 RPC function to post RDMA send with immediate operation. More...
 

Variables

static uint32_t received_values [EXPECTED_NUM_RECEIVES] = {0}
 Array used to mark received data when completion is received. More...
 
static uint32_t num_receive = 0
 Number of current receive completions. More...
 

Function Documentation

◆ rdma_post_receive_rpc()

__dpa_rpc__ uint64_t rdma_post_receive_rpc ( doca_dpa_dev_t  rdma_dpa_ctx_handle,
doca_dpa_dev_rdma_t  target_rdma,
doca_dpa_dev_uintptr_t  local_buf_addr,
doca_dpa_dev_mmap_t  dpa_mmap_handle,
size_t  length 
)

RPC function to post first RDMA receive operation on target RDMA.

This RPC is used by target host application to post the first RDMA receive operation on DPA local buffer. This buffer will be reused again after each completion

@rdma_dpa_ctx_handle [in]: DPA context handle used for RDMA DOCA device. Needed when running from DPU @target_rdma [in]: Target RDMA DPA handle @local_buf_addr [in]: address of received buffer used for Target RDMA @dpa_mmap_handle [in]: DOCA Mmap handle for local_buf_addr @length [in]: length of received buffer

Returns
: RPC function always succeed and returns 0

Definition at line 160 of file dpa_initiator_target_kernels_dev.c.

◆ rdma_post_send_imm_rpc()

__dpa_rpc__ uint64_t rdma_post_send_imm_rpc ( doca_dpa_dev_t  rdma_dpa_ctx_handle,
doca_dpa_dev_rdma_t  rdma,
uint32_t  connection_id,
uintptr_t  local_buf_addr,
doca_dpa_dev_mmap_t  dpa_mmap_handle,
size_t  length,
uint32_t  immediate 
)

RPC function to post RDMA send with immediate operation.

This RPC is used by initiator host application to post RDMA send with immediate operation on host local buffer

@rdma_dpa_ctx_handle [in]: DPA context handle used for RDMA DOCA device. Needed when running from DPU @rdma [in]: RDMA DPA handle @connection_id [in]: RDMA connection ID @local_buf_addr [in]: address of send buffer @dpa_mmap_handle [in]: send DOCA Mmap handle @length [in]: length of send buffer @immediate [in]: immediate data

Returns
: RPC function always succeed and returns 0

Definition at line 193 of file dpa_initiator_target_kernels_dev.c.

◆ thread1_kernel()

__dpa_global__ void thread1_kernel ( uint64_t  arg)

Kernel function for DPA thread #1.

This kernel is triggered when a completion is received on attached RDMA context. This kernel is triggered four times, on each, it receives data on DPA buffer with values 1, 2, 3 and 4. On each completion, it gets and dumps completion info. When number of received completions is 4, it verifies all data values (1, 2, 3, 4) were received. if checker passed, DPA Thread #1 notifies DPA Thread #2 and finish, otherwise it errors and finish.

  • [in]: Kernel argument

Definition at line 56 of file dpa_initiator_target_kernels_dev.c.

◆ thread2_kernel()

__dpa_global__ void thread2_kernel ( uint64_t  arg)

Kernel function for DPA thread #2.

This kernel is triggered when DPA thread #1 notifies DPA thread #2. This kernel sets host sync event to let host application start destroying all resources and ending the application

  • [in]: Kernel argument

Definition at line 134 of file dpa_initiator_target_kernels_dev.c.

Variable Documentation

◆ num_receive

uint32_t num_receive = 0
static

Number of current receive completions.

Definition at line 43 of file dpa_initiator_target_kernels_dev.c.

◆ received_values

uint32_t received_values[EXPECTED_NUM_RECEIVES] = {0}
static

Array used to mark received data when completion is received.

Expected received data are 1, 2, 3, 4. When completion is received with data i, then received_values[i - 1] = 1. At the end, this array should be [1, 1, 1, 1]

Definition at line 38 of file dpa_initiator_target_kernels_dev.c.