NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_dpa.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdbool.h>
#include <doca_compat.h>
#include <doca_error.h>
Include dependency graph for doca_dpa.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DOCA_DPA_COMPLETION_LOG_MAX_USER_DATA   (24)
 DPA completion Log max user data type definition. More...
 

Typedefs

typedef enum doca_dpa_dev_log_level doca_dpa_dev_log_level_t
 DOCA DPA device log levels, sorted by verbosity from high to low. More...
 
typedef uint64_t doca_dpa_dev_t
 DPA context handle type definition. More...
 
typedef uint64_t doca_dpa_dev_uintptr_t
 DPA pointer type definition. More...
 
typedef uint64_t doca_dpa_dev_hash_table_t
 DPA hash table handle type definition. More...
 
typedef uint64_t doca_dpa_dev_completion_t
 DPA completion handle type definition. More...
 
typedef uint64_t doca_dpa_dev_async_ops_t
 DPA asynchronous ops handle type definition. More...
 
typedef uint64_t doca_dpa_dev_notification_completion_t
 DPA notification completion handle type definition. More...
 
typedef void() doca_dpa_func_t(void)
 Generic function pointer type. More...
 

Enumerations

enum  doca_dpa_dev_log_level {
  DOCA_DPA_DEV_LOG_LEVEL_DISABLE = 10 , DOCA_DPA_DEV_LOG_LEVEL_ERROR = 30 , DOCA_DPA_DEV_LOG_LEVEL_WARNING = 40 , DOCA_DPA_DEV_LOG_LEVEL_INFO = 50 ,
  DOCA_DPA_DEV_LOG_LEVEL_DEBUG = 60 , DOCA_DPA_DEV_LOG_LEVEL_DISABLE = 10 , DOCA_DPA_DEV_LOG_LEVEL_ERROR = 30 , DOCA_DPA_DEV_LOG_LEVEL_WARNING = 40 ,
  DOCA_DPA_DEV_LOG_LEVEL_INFO = 50 , DOCA_DPA_DEV_LOG_LEVEL_DEBUG = 60
}
 DOCA DPA device log levels, sorted by verbosity from high to low. More...
 

Functions

DOCA_EXPERIMENTAL doca_error_t doca_dpa_cap_is_supported (const struct doca_devinfo *devinfo)
 Get whether the DOCA device supports DPA. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_create (struct doca_dev *dev, struct doca_dpa **dpa)
 Create a DOCA DPA Context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_destroy (struct doca_dpa *dpa)
 Destroy a DOCA DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_start (struct doca_dpa *dpa)
 Start a DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_stop (struct doca_dpa *dpa)
 Stop a DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_set_app (struct doca_dpa *dpa, struct doca_dpa_app *app)
 Set program app for DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_app (struct doca_dpa *dpa, struct doca_dpa_app **app)
 Get program app that was set for DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_app_get_name (struct doca_dpa_app *app, char *app_name, uint32_t *app_name_len)
 Get DPA application name. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_set_log_level (struct doca_dpa *dpa, doca_dpa_dev_log_level_t log_level)
 Set device logs verbosity level. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_log_level (struct doca_dpa *dpa, doca_dpa_dev_log_level_t *log_level)
 Get device logs verbosity level that was set for DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_log_file_set_path (struct doca_dpa *dpa, const char *file_path)
 Set log file path to write device logs into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_log_file_get_path (struct doca_dpa *dpa, char *file_path, uint32_t *file_path_len)
 Get log file path to write device logs into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_trace_file_set_path (struct doca_dpa *dpa, const char *file_path)
 Set trace file path to write device traces into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_trace_file_get_path (struct doca_dpa *dpa, char *file_path, uint32_t *file_path_len)
 Get trace file path to write device traces into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_max_threads_per_kernel (const struct doca_dpa *dpa, unsigned int *value)
 Get maximum number of DPA threads to run a single kernel launch operation. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_kernel_max_run_time (const struct doca_dpa *dpa, unsigned long long *value)
 Get maximum allowable time in seconds that a kernel may remain scheduled on the DPA. A kernel that remains scheduled beyond this limit may be terminated by the runtime and cause fatal behavior. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_device_extend (struct doca_dpa *dpa, struct doca_dev *other_dev, struct doca_dpa **extended_dpa)
 Create an extended DPA context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_dpa_handle (struct doca_dpa *dpa, doca_dpa_dev_t *handle)
 Get DPA context handle. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_uar_id (const struct doca_dpa *dpa, uint32_t *uar_id)
 Get DPA UAR ID. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_kernel_launch_update_set (struct doca_dpa *dpa, struct doca_sync_event *wait_event, uint64_t wait_threshold, struct doca_sync_event *comp_event, uint64_t comp_count, unsigned int num_threads, doca_dpa_func_t *func,...)
 Submit a kernel to DPA that sets completion event. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_kernel_launch_update_add (struct doca_dpa *dpa, struct doca_sync_event *wait_event, uint64_t wait_threshold, struct doca_sync_event *comp_event, uint64_t comp_count, unsigned int num_threads, doca_dpa_func_t *func,...)
 Submit a kernel to DPA. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_rpc (struct doca_dpa *dpa, doca_dpa_func_t *func, uint64_t *retval,...)
 RPC to run DPA kernel. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_peek_at_last_error (const struct doca_dpa *dpa)
 Return the last error generated on the DPA. Check if an error occurred on the device side runtime. This call does not reset the error state. If an error occurred, the DPA context enters a fatal state and must be destroyed by the user. In the case of a fatal error core dump and crash data will be written to the file path /tmp/doca_dpa_fatal or to the file path set by the API doca_dpa_log_file_set_path(), with the suffixes .PID.core and .PID.crash respectively, where PID is the process id. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_mem_alloc (struct doca_dpa *dpa, size_t size, doca_dpa_dev_uintptr_t *dev_ptr)
 Allocate DPA heap memory. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_mem_free (struct doca_dpa *dpa, doca_dpa_dev_uintptr_t dev_ptr)
 Free the previously allocated DPA memory. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_h2d_memcpy (struct doca_dpa *dpa, doca_dpa_dev_uintptr_t dst_ptr, void *src_ptr, size_t size)
 Copy from host memory to DPA Heap. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_h2d_buf_memcpy (struct doca_dpa *dpa, doca_dpa_dev_uintptr_t dst_ptr, struct doca_buf *buf, size_t size)
 Copy from DOCA Buf to DPA Heap. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_d2h_memcpy (struct doca_dpa *dpa, void *dst_ptr, doca_dpa_dev_uintptr_t src_ptr, size_t size)
 Copy from DPA Heap to host memory. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_d2h_buf_memcpy (struct doca_dpa *dpa, struct doca_buf *buf, doca_dpa_dev_uintptr_t src_ptr, size_t size)
 Copy from DPA Heap to DOCA Buf. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_memset (struct doca_dpa *dpa, doca_dpa_dev_uintptr_t dev_ptr, int value, size_t size)
 Set DPA Heap memory to a value. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_hash_table_create (struct doca_dpa *dpa, unsigned int num_entries, struct doca_dpa_hash_table **ht)
 Create a hash table on DPA. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_hash_table_destroy (struct doca_dpa_hash_table *ht)
 Destroy DPA hash table. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_hash_table_get_dpa_handle (struct doca_dpa_hash_table *ht, doca_dpa_dev_hash_table_t *ht_handle)
 Get DPA hash table handle. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_core_num (struct doca_dpa *dpa, unsigned int *num_cores)
 Retrieve the number of available DPA cores. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_num_eus_per_core (struct doca_dpa *dpa, unsigned int *eus_per_core)
 Retrieve the number of EUs available per DPA core. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_get_total_num_eus_available (struct doca_dpa *dpa, unsigned int *total_num_eus)
 Retrieve the total number of EUs available to the application. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_eu_affinity_create (struct doca_dpa *dpa, struct doca_dpa_eu_affinity **affinity)
 Create DPA EU affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_eu_affinity_destroy (struct doca_dpa_eu_affinity *affinity)
 Destroy DPA EU affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_eu_affinity_set (struct doca_dpa_eu_affinity *affinity, unsigned int eu_id)
 Set EU ID in DPA EU affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_eu_affinity_clear (struct doca_dpa_eu_affinity *affinity)
 Clear DPA EU affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_eu_affinity_get (struct doca_dpa_eu_affinity *affinity, unsigned int *eu_id)
 Get EU ID from DPA EU affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_create (struct doca_dpa *dpa, struct doca_dpa_thread **dpa_thread)
 Create DPA thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_destroy (struct doca_dpa_thread *dpa_thread)
 Destroy DPA thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_set_func_arg (struct doca_dpa_thread *dpa_thread, doca_dpa_func_t *func, uint64_t arg)
 Set DPA thread entry point and its argument. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_get_func_arg (struct doca_dpa_thread *dpa_thread, doca_dpa_func_t **func, uint64_t *arg)
 Get DPA thread entry point and its argument. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_set_local_storage (struct doca_dpa_thread *dpa_thread, doca_dpa_dev_uintptr_t dev_ptr)
 Set DPA thread local storage. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_get_local_storage (struct doca_dpa_thread *dpa_thread, doca_dpa_dev_uintptr_t *dev_ptr)
 Get DPA thread local storage. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_set_affinity (struct doca_dpa_thread *dpa_thread, const struct doca_dpa_eu_affinity *affinity)
 Set DPA thread affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_get_affinity (struct doca_dpa_thread *dpa_thread, const struct doca_dpa_eu_affinity **affinity)
 Get DPA thread affinity. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_start (struct doca_dpa_thread *dpa_thread)
 Start DPA thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_stop (struct doca_dpa_thread *dpa_thread)
 Stop DPA thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_run (struct doca_dpa_thread *dpa_thread)
 Run DPA thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_get_id (struct doca_dpa_thread *dpa_thread, uint32_t *dpa_thread_id)
 Get DPA thread ID. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_create (struct doca_dpa *dpa, unsigned int num_threads, struct doca_dpa_tg **tg)
 Create DPA thread group. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_destroy (struct doca_dpa_tg *tg)
 Destroy DPA thread group. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_get_num_threads (struct doca_dpa_tg *tg, unsigned int *num_threads)
 Get DPA thread group number of threads. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_set_thread (struct doca_dpa_tg *tg, struct doca_dpa_thread *thread, unsigned int rank)
 Set DPA thread at 'rank' in DPA thread group. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_start (struct doca_dpa_tg *tg)
 Start DPA thread group. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_thread_group_stop (struct doca_dpa_tg *tg)
 Stop DPA thread group. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_create (struct doca_dpa *dpa, unsigned int queue_size, struct doca_dpa_completion **dpa_comp)
 Create DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_destroy (struct doca_dpa_completion *dpa_comp)
 Destroy DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_get_queue_size (struct doca_dpa_completion *dpa_comp, unsigned int *queue_size)
 Get DPA completion context queue size. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_set_thread (struct doca_dpa_completion *dpa_comp, struct doca_dpa_thread *dpa_thread)
 Set DPA completion context thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_get_thread (struct doca_dpa_completion *dpa_comp, struct doca_dpa_thread **dpa_thread)
 Get DPA completion context attached thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_start (struct doca_dpa_completion *dpa_comp)
 Start DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_stop (struct doca_dpa_completion *dpa_comp)
 Stop DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_completion_get_dpa_handle (struct doca_dpa_completion *dpa_comp, doca_dpa_dev_completion_t *handle)
 Get DPA completion context handle. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_create (struct doca_dpa *dpa, unsigned int queue_size, uint64_t user_data, struct doca_dpa_async_ops **async_ops)
 Create DPA asynchronous ops context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_destroy (struct doca_dpa_async_ops *async_ops)
 Destroy DPA asynchronous ops context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_get_queue_size (struct doca_dpa_async_ops *async_ops, unsigned int *queue_size)
 Get DPA asynchronous ops queue size. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_get_user_data (struct doca_dpa_async_ops *async_ops, uint64_t *user_data)
 Get DPA asynchronous ops context user data. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_attach (struct doca_dpa_async_ops *async_ops, struct doca_dpa_completion *dpa_comp)
 Attach DPA asynchronous ops context to DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_start (struct doca_dpa_async_ops *async_ops)
 Start DPA asynchronous ops context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_stop (struct doca_dpa_async_ops *async_ops)
 Stop DPA asynchronous ops context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_async_ops_get_dpa_handle (struct doca_dpa_async_ops *async_ops, doca_dpa_dev_async_ops_t *handle)
 Get DPA asynchronous ops context handle. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_create (struct doca_dpa *dpa, struct doca_dpa_thread *dpa_thread, struct doca_dpa_notification_completion **notify_comp)
 Create DPA notification completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_destroy (struct doca_dpa_notification_completion *notify_comp)
 Destroy DPA notification completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_get_thread (struct doca_dpa_notification_completion *notify_comp, struct doca_dpa_thread **dpa_thread)
 Get DPA notification completion context attached thread. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_start (struct doca_dpa_notification_completion *notify_comp)
 Start DPA notification completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_stop (struct doca_dpa_notification_completion *notify_comp)
 Stop DPA notification completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_dpa_notification_completion_get_dpa_handle (struct doca_dpa_notification_completion *notify_comp, doca_dpa_dev_notification_completion_t *handle)
 Get DPA notification completion context handle. More...