| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |


Go to the source code of this file.
Data Structures | |
| struct | pe_sample_state_base |
| doca_error_t allocate_buffer | ( | struct pe_sample_state_base * | state | ) |
Allocates a buffer that will be used for the source and destination buffers.
@state [in]: sample state
Definition at line 131 of file pe_common.c.
| doca_error_t allocate_dma_tasks | ( | struct pe_sample_state_base * | state, |
| struct doca_dma * | dma, | ||
| uint32_t | num_tasks, | ||
| size_t | dma_buffer_size, | ||
| struct doca_dma_task_memcpy ** | tasks | ||
| ) |
This method allocate the DMA tasks but does not submit them. This is a sample choice. A task can be submitted immediately after it is allocated.
@state [in]: sample state @dma [in]: DMA context to allocate the tasks from @num_tasks [in]: Number of tasks per group @dma_buffer_size [in]: Size of DMA buffer @tasks [in]: tasks to allocate
This method allocate the DMA tasks but does not submit them. This is a sample choice. A task can be submitted immediately after it is allocated.
@state [in]: sample state @dma [in] DMA context to allocate the tasks from. @num_tasks [in]: Number of tasks per group @dma_buffer_size [in]: Size of DMA buffer @tasks [in]: tasks to allocate
Using doca_buf_inventory_buf_get_by_addr leaves the buffer head uninitialized. The DMA context will set the head and length at the task completion.
Definition at line 155 of file pe_common.c.
| doca_error_t create_buf_inventory | ( | struct pe_sample_state_base * | state | ) |
Create buffer inventory, initialize and start it.
@state [in]: sample state
Definition at line 294 of file pe_common.c.
| doca_error_t create_mmap | ( | struct pe_sample_state_base * | state | ) |
Create MMAP, initialize and start it.
@state [in]: sample state
Definition at line 275 of file pe_common.c.
| doca_error_t create_pe | ( | struct pe_sample_state_base * | state | ) |
Creates a progress engine
@state [in]: sample state
Definition at line 260 of file pe_common.c.
| doca_error_t dma_task_free | ( | struct doca_dma_task_memcpy * | dma_task | ) |
A DOCA task should be freed once it is no longer used. It can be freed during a completion or error callback, during the progress one loop (e.g. if the program stores it in the state), at the end of the program, etc., as long as it is not required anymore. The sample also releases the buffers during this call, but only for simplicity. Buffers don't have to be released when a task is released.
Definition at line 108 of file pe_common.c.
| doca_error_t free_dma_memcpy_task_buffers | ( | struct doca_dma_task_memcpy * | dma_task | ) |
Removing the const is fine in this case because the sample owns the buffer and the task is about to be freed. However, in other cases this action may not be valid.
Definition at line 93 of file pe_common.c.
| doca_error_t open_device | ( | struct pe_sample_state_base * | state | ) |
Opens a device that supports SHA and DMA
@state [in]: sample state
Definition at line 245 of file pe_common.c.
| void pe_sample_base_cleanup | ( | struct pe_sample_state_base * | state | ) |
This method cleans up the sample resources in reverse order of their creation. This method does not check for destroy return values for simplify. Real code should check the return value and act accordingly (e.g. if doca_ctx_stop failed with DOCA_ERROR_IN_PROGRESS it means that some contexts are still added or even that there are still in flight tasks in the progress engine).
@state [in]: sample state
Definition at line 311 of file pe_common.c.
| doca_error_t poll_for_completion | ( | struct pe_sample_state_base * | state, |
| uint32_t | num_tasks | ||
| ) |
Poll the PE until all tasks are completed.
@state [in]: sample state @num_tasks [in]: number of expected tasks
Poll the PE until all tasks are completed.
@state [in]: sample state @num_tasks [in] number of expected tasks
doca_pe_progress shall return 1 if a task was completed and 0 if not. In this case the sample does not have anything to do with the return value because it is a polling sample.
Definition at line 340 of file pe_common.c.
| doca_error_t process_completed_dma_memcpy_task | ( | struct doca_dma_task_memcpy * | dma_task, |
| uint8_t | expected_value | ||
| ) |
Definition at line 66 of file pe_common.c.
| doca_error_t submit_dma_tasks | ( | uint32_t | num_tasks, |
| struct doca_dma_task_memcpy ** | tasks | ||
| ) |
This method submits all the tasks (
@num_tasks [in]: Number of tasks per group @tasks [in]: tasks to submit
This method submits all the tasks (
@num_tasks [in]: Number of tasks per group @dma_buffer_size [in]: Size of DMA buffer @tasks [in]: tasks to submit
Definition at line 211 of file pe_common.c.