| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |
#include <doca_dpa_dev.h>#include <doca_dpa_dev_rdma.h>#include <doca_dpa_dev_buf.h>#include "../common/dpa_initiator_target_common_defs.h"
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... | |
| __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
Definition at line 160 of file dpa_initiator_target_kernels_dev.c.
| __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
Definition at line 193 of file dpa_initiator_target_kernels_dev.c.
| __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.
Definition at line 56 of file dpa_initiator_target_kernels_dev.c.
| __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
Definition at line 134 of file dpa_initiator_target_kernels_dev.c.
|
static |
Number of current receive completions.
Definition at line 43 of file dpa_initiator_target_kernels_dev.c.
|
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.