| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |
#include "dpa_common.h"#include "doca_dpa.h"#include "libflexio/flexio_ver.h"#include "libflexio/flexio.h"
Go to the source code of this file.
Macros | |
| #define | DPA_BASIC_INITIATOR_TARGET_FLEXIO_MAJOR_VERSION (25) |
| #define | DPA_BASIC_INITIATOR_TARGET_FLEXIO_MINOR_VERSION (4) |
| #define | DPA_BASIC_INITIATOR_TARGET_FLEXIO_PATCH_VERSION (0) |
| #define | FLEXIO_VER_USED |
| #define | DPA_THREADS_MAX 256 |
Functions | |
| DOCA_LOG_REGISTER (DPA_COMMON) | |
| static doca_error_t | pf_device_name_param_callback (void *param, void *config) |
| static doca_error_t | dpa_resources_file_param_callback (void *param, void *config) |
| static doca_error_t | dpa_app_key_param_callback (void *param, void *config) |
| doca_error_t | register_dpa_params (void) |
| Register the command line parameters for the sample. More... | |
| static doca_error_t | open_dpa_device (const char *pf_device_name, const char *rdma_device_name, struct doca_dev **pf_doca_device, struct doca_dev **rdma_doca_device) |
| doca_error_t | create_doca_dpa_wait_sync_event (struct doca_dpa *doca_dpa, struct doca_dev *doca_device, struct doca_sync_event **wait_event) |
| Create DOCA sync event to be published by the CPU and subscribed by the DPA. More... | |
| doca_error_t | create_doca_dpa_completion_sync_event (struct doca_dpa *doca_dpa, struct doca_dev *doca_device, struct doca_sync_event **comp_event, doca_dpa_dev_sync_event_t *handle) |
| Create DOCA sync event to be published by the DPA and subscribed by the CPU. More... | |
| doca_error_t | create_doca_dpa_kernel_sync_event (struct doca_dpa *doca_dpa, struct doca_sync_event **kernel_event) |
| Create DOCA sync event to be published and subscribed by the DPA. More... | |
| doca_error_t | create_doca_remote_net_sync_event (struct doca_dev *doca_device, struct doca_sync_event **remote_net_event) |
| Create DOCA sync event to be published by a remote net and subscribed by the CPU. More... | |
| doca_error_t | export_doca_remote_net_sync_event_to_dpa (struct doca_dev *doca_device, struct doca_dpa *doca_dpa, struct doca_sync_event *remote_net_event, struct doca_sync_event_remote_net **remote_net_exported_event, doca_dpa_dev_sync_event_remote_net_t *remote_net_event_dpa_handle) |
| Create DOCA sync event to be published by a remote net and subscribed by the CPU. More... | |
| static doca_error_t | get_file_size (const char *path, size_t *file_size) |
| Get the size of a file. More... | |
| static doca_error_t | read_file_into_buffer (const char *path, char *buffer, size_t *bytes_read) |
| Read file content into a pre-allocated buffer. More... | |
| static doca_error_t | get_eu_ids_from_resources_file (struct dpa_config *cfg, uint32_t *threads_list, uint32_t *threads_num) |
| Get execution unit IDs from FlexIO resources. More... | |
| doca_error_t | allocate_dpa_resources (struct dpa_config *cfg, struct dpa_resources *resources) |
| Allocate DOCA DPA resources. More... | |
| doca_error_t | destroy_dpa_resources (struct dpa_resources *resources) |
| Destroy DOCA DPA resources. More... | |
| doca_error_t | dpa_thread_obj_init (struct dpa_thread_obj *dpa_thread_obj) |
| Initialize DPA thread. More... | |
| doca_error_t | dpa_thread_obj_destroy (struct dpa_thread_obj *dpa_thread_obj) |
| Destroy DPA thread. More... | |
| doca_error_t | dpa_completion_obj_init (struct dpa_completion_obj *dpa_completion_obj) |
| Initialize DPA completion. More... | |
| doca_error_t | dpa_completion_obj_destroy (struct dpa_completion_obj *dpa_completion_obj) |
| Destroy DPA completion. More... | |
| doca_error_t | dpa_notification_completion_obj_init (struct dpa_notification_completion_obj *notification_completion_obj) |
| Initialize DPA notification completion. More... | |
| doca_error_t | dpa_notification_completion_obj_destroy (struct dpa_notification_completion_obj *notification_completion_obj) |
| Destroy DPA notification completion. More... | |
| doca_error_t | dpa_rdma_obj_init (struct dpa_rdma_obj *dpa_rdma_obj) |
| Initialize DPA RDMA without starting it. More... | |
| doca_error_t | dpa_rdma_obj_start (struct dpa_rdma_obj *dpa_rdma_obj) |
| Start DPA RDMA. More... | |
| doca_error_t | dpa_rdma_obj_destroy (struct dpa_rdma_obj *dpa_rdma_obj) |
| Destroy DPA RDMA. More... | |
| doca_error_t | doca_mmap_obj_init (struct doca_mmap_obj *doca_mmap_obj) |
| Initialize DOCA Mmap. More... | |
| doca_error_t | doca_mmap_obj_destroy (struct doca_mmap_obj *doca_mmap_obj) |
| Destroy DOCA Mmap. More... | |
Variables | |
| struct doca_dpa_app * | dpa_sample_app |
| #define DPA_BASIC_INITIATOR_TARGET_FLEXIO_MAJOR_VERSION (25) |
Definition at line 30 of file dpa_common.c.
| #define DPA_BASIC_INITIATOR_TARGET_FLEXIO_MINOR_VERSION (4) |
Definition at line 31 of file dpa_common.c.
| #define DPA_BASIC_INITIATOR_TARGET_FLEXIO_PATCH_VERSION (0) |
Definition at line 32 of file dpa_common.c.
| #define DPA_THREADS_MAX 256 |
Definition at line 42 of file dpa_common.c.
| #define FLEXIO_VER_USED |
Definition at line 34 of file dpa_common.c.
| doca_error_t allocate_dpa_resources | ( | struct dpa_config * | cfg, |
| struct dpa_resources * | resources | ||
| ) |
Allocate DOCA DPA resources.
@cfg [in]: DOCA DPA configurations @resources [out]: DOCA DPA resources to allocate
Definition at line 660 of file dpa_common.c.
| doca_error_t create_doca_dpa_completion_sync_event | ( | struct doca_dpa * | doca_dpa, |
| struct doca_dev * | doca_device, | ||
| struct doca_sync_event ** | comp_event, | ||
| doca_dpa_dev_sync_event_t * | handle | ||
| ) |
Create DOCA sync event to be published by the DPA and subscribed by the CPU.
@doca_dpa [in]: DOCA DPA context @doca_device [in]: DOCA device @comp_event [out]: Created DOCA sync event that is published by the DPA and subscribed by the CPU @handle [out]: Created DOCA sync event handle
Definition at line 354 of file dpa_common.c.
| doca_error_t create_doca_dpa_kernel_sync_event | ( | struct doca_dpa * | doca_dpa, |
| struct doca_sync_event ** | kernel_event | ||
| ) |
Create DOCA sync event to be published and subscribed by the DPA.
@doca_dpa [in]: DOCA DPA context @kernel_event [out]: Created DOCA sync event that is published and subscribed by the DPA
Definition at line 404 of file dpa_common.c.
| doca_error_t create_doca_dpa_wait_sync_event | ( | struct doca_dpa * | doca_dpa, |
| struct doca_dev * | doca_device, | ||
| struct doca_sync_event ** | wait_event | ||
| ) |
Create DOCA sync event to be published by the CPU and subscribed by the DPA.
@doca_dpa [in]: DOCA DPA context @doca_device [in]: DOCA device @wait_event [out]: Created DOCA sync event that is published by the CPU and subscribed by the DPA
Definition at line 313 of file dpa_common.c.
| doca_error_t create_doca_remote_net_sync_event | ( | struct doca_dev * | doca_device, |
| struct doca_sync_event ** | remote_net_event | ||
| ) |
Create DOCA sync event to be published by a remote net and subscribed by the CPU.
@doca_device [in]: DOCA device @remote_net_event [out]: Created DOCA sync event that is published by a remote net and subscribed by the CPU
Definition at line 443 of file dpa_common.c.
| doca_error_t destroy_dpa_resources | ( | struct dpa_resources * | resources | ) |
Destroy DOCA DPA resources.
@resources [in]: DOCA DPA resources to destroy
Definition at line 769 of file dpa_common.c.
| DOCA_LOG_REGISTER | ( | DPA_COMMON | ) |
| doca_error_t doca_mmap_obj_destroy | ( | struct doca_mmap_obj * | doca_mmap_obj | ) |
Destroy DOCA Mmap.
@doca_mmap_obj [in]: DOCA Mmap object
Definition at line 1209 of file dpa_common.c.
| doca_error_t doca_mmap_obj_init | ( | struct doca_mmap_obj * | doca_mmap_obj | ) |
Initialize DOCA Mmap.
@doca_mmap_obj [in/out]: DOCA Mmap object
Definition at line 1126 of file dpa_common.c.
|
static |
Definition at line 88 of file dpa_common.c.
| doca_error_t dpa_completion_obj_destroy | ( | struct dpa_completion_obj * | dpa_completion_obj | ) |
Destroy DPA completion.
@dpa_completion_obj [in]: DPA completion object
Definition at line 916 of file dpa_common.c.
| doca_error_t dpa_completion_obj_init | ( | struct dpa_completion_obj * | dpa_completion_obj | ) |
Initialize DPA completion.
@dpa_completion_obj [in/out]: DPA completion object
Definition at line 877 of file dpa_common.c.
| doca_error_t dpa_notification_completion_obj_destroy | ( | struct dpa_notification_completion_obj * | notification_completion_obj | ) |
Destroy DPA notification completion.
@notification_completion_obj [in]: DPA notification completion object
Definition at line 962 of file dpa_common.c.
| doca_error_t dpa_notification_completion_obj_init | ( | struct dpa_notification_completion_obj * | notification_completion_obj | ) |
Initialize DPA notification completion.
@notification_completion_obj [in/out]: DPA notification completion object
Definition at line 929 of file dpa_common.c.
| doca_error_t dpa_rdma_obj_destroy | ( | struct dpa_rdma_obj * | dpa_rdma_obj | ) |
Destroy DPA RDMA.
@dpa_rdma_obj [in]: DPA RDMA object
Definition at line 1107 of file dpa_common.c.
| doca_error_t dpa_rdma_obj_init | ( | struct dpa_rdma_obj * | dpa_rdma_obj | ) |
Initialize DPA RDMA without starting it.
This function creates DPA RDMA object. Please note that this function doesn't start the created DPA RDMA object, this need to be done using dpa_rdma_obj_start() API
@dpa_rdma_obj [in/out]: DPA RDMA object
Definition at line 976 of file dpa_common.c.
| doca_error_t dpa_rdma_obj_start | ( | struct dpa_rdma_obj * | dpa_rdma_obj | ) |
Start DPA RDMA.
@dpa_rdma_obj [in]: DPA RDMA object
Definition at line 1058 of file dpa_common.c.
|
static |
Definition at line 72 of file dpa_common.c.
| doca_error_t dpa_thread_obj_destroy | ( | struct dpa_thread_obj * | dpa_thread_obj | ) |
Destroy DPA thread.
@dpa_thread_obj [in]: DPA thread object
Definition at line 864 of file dpa_common.c.
| doca_error_t dpa_thread_obj_init | ( | struct dpa_thread_obj * | dpa_thread_obj | ) |
Initialize DPA thread.
@dpa_thread_obj [in/out]: DPA thread object
Definition at line 817 of file dpa_common.c.
| doca_error_t export_doca_remote_net_sync_event_to_dpa | ( | struct doca_dev * | doca_device, |
| struct doca_dpa * | doca_dpa, | ||
| struct doca_sync_event * | remote_net_event, | ||
| struct doca_sync_event_remote_net ** | remote_net_exported_event, | ||
| doca_dpa_dev_sync_event_remote_net_t * | remote_net_event_dpa_handle | ||
| ) |
Create DOCA sync event to be published by a remote net and subscribed by the CPU.
@doca_device [in]: DOCA device @doca_dpa [in]: DOCA DPA context @remote_net_event [in]: remote net DOCA sync event @remote_net_exported_event [out]: Created from export remote net DOCA sync event @remote_net_event_dpa_handle [out]: DPA handle of the created from export remote net DOCA sync event
Definition at line 483 of file dpa_common.c.
|
static |
Get execution unit IDs from FlexIO resources.
This function reads the DPA resources file and extracts the execution unit IDs for the specified application key.
@cfg [in]: DPA configuration @threads_list [out]: List of execution unit IDs @threads_num [out]: Number of execution units
Definition at line 601 of file dpa_common.c.
|
static |
Get the size of a file.
| [in] | path | - Path to the file |
| [out] | file_size | - Size of the file in bytes |
Definition at line 536 of file dpa_common.c.
|
static |
Definition at line 222 of file dpa_common.c.
|
static |
Definition at line 57 of file dpa_common.c.
|
static |
Read file content into a pre-allocated buffer.
| [in] | path | - Path to the file |
| [out] | buffer | - Pre-allocated buffer to store file content |
| [out] | bytes_read | - Number of bytes read from the file |
Definition at line 571 of file dpa_common.c.
| doca_error_t register_dpa_params | ( | void | ) |
Register the command line parameters for the sample.
Definition at line 126 of file dpa_common.c.
|
extern |