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

Typedefs | |
| typedef void(* | doca_task_completion_cb_t) (struct doca_task *task, union doca_data task_user_data, union doca_data ctx_user_data) |
| Function to execute on task completion. More... | |
Enumerations | |
| enum | doca_task_batch_max_tasks_number { DOCA_TASK_BATCH_MAX_TASKS_NUMBER_16 , DOCA_TASK_BATCH_MAX_TASKS_NUMBER_32 , DOCA_TASK_BATCH_MAX_TASKS_NUMBER_64 , DOCA_TASK_BATCH_MAX_TASKS_NUMBER_128 } |
| enum | doca_event_batch_events_number { DOCA_EVENT_BATCH_EVENTS_NUMBER_1 , DOCA_EVENT_BATCH_EVENTS_NUMBER_2 , DOCA_EVENT_BATCH_EVENTS_NUMBER_4 , DOCA_EVENT_BATCH_EVENTS_NUMBER_8 , DOCA_EVENT_BATCH_EVENTS_NUMBER_16 , DOCA_EVENT_BATCH_EVENTS_NUMBER_32 , DOCA_EVENT_BATCH_EVENTS_NUMBER_64 , DOCA_EVENT_BATCH_EVENTS_NUMBER_128 } |
| enum | doca_task_submit_flag { DOCA_TASK_SUBMIT_FLAG_NONE = 0U , DOCA_TASK_SUBMIT_FLAG_FLUSH = (1U << 0) , DOCA_TASK_SUBMIT_FLAG_OPTIMIZE_REPORTS = (1U << 1) } |
| Flags used when submitting a doca_task. More... | |
| enum | doca_pe_event_mode { DOCA_PE_EVENT_MODE_PROGRESS_SELECTIVE , DOCA_PE_EVENT_MODE_PROGRESS_ALL } |
| Progress engine event modes. More... | |
Functions | |
| DOCA_STABLE doca_error_t | doca_pe_create (struct doca_pe **pe) |
| Creates DOCA progress engine. More... | |
| DOCA_STABLE doca_error_t | doca_pe_destroy (struct doca_pe *pe) |
| Destroy doca progress engine. More... | |
| DOCA_STABLE uint8_t | doca_pe_progress (struct doca_pe *pe) |
| Run the progress engine. More... | |
| DOCA_STABLE doca_error_t | doca_pe_clear_notification (struct doca_pe *pe, doca_notification_handle_t handle) |
| Clear triggered completions after wait. More... | |
| DOCA_STABLE doca_error_t | doca_pe_request_notification (struct doca_pe *pe) |
| Arm the progress engine to wait for completion. More... | |
| DOCA_STABLE doca_error_t | doca_pe_get_num_inflight_tasks (const struct doca_pe *pe, size_t *num_inflight_tasks) |
| Get number of in flight tasks. More... | |
| DOCA_STABLE doca_error_t | doca_task_submit (struct doca_task *task) |
| Submit a task to a progress engine. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_task_submit_ex (struct doca_task *task, uint32_t flags) |
| Extended version of doca_task_submit. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_task_batch_submit (struct doca_task_batch *task_batch) |
| Submit a task_batch to a progress engine. More... | |
| DOCA_STABLE doca_error_t | doca_task_try_submit (struct doca_task *task) |
| Try to submit a task to a progress engine. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_task_batch_try_submit (struct doca_task_batch *task_batch) |
| Try to submit a task_batch to a progress engine. More... | |
| DOCA_STABLE void | doca_task_free (struct doca_task *task) |
| Free a task back to where it was allocated from. More... | |
| DOCA_EXPERIMENTAL void | doca_task_batch_free (struct doca_task_batch *task_batch) |
| Free a task_batch back to where it was allocated from. More... | |
| DOCA_STABLE doca_error_t | doca_task_get_status (const struct doca_task *task) |
| Get task status. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_task_batch_get_status (const struct doca_task_batch *task_batch) |
| Get task_batch status. More... | |
| DOCA_STABLE void | doca_task_set_user_data (struct doca_task *task, union doca_data user_data) |
| Set user data to a task. More... | |
| DOCA_EXPERIMENTAL void | doca_task_batch_set_user_data (struct doca_task_batch *task_batch, union doca_data user_data) |
| Set user data to a task_batch. More... | |
| DOCA_STABLE union doca_data | doca_task_get_user_data (const struct doca_task *task) |
| Get user data from a task. More... | |
| DOCA_EXPERIMENTAL union doca_data | doca_task_batch_get_user_data (const struct doca_task_batch *task_batch) |
| Get user data from a task_batch. More... | |
| DOCA_STABLE struct doca_ctx * | doca_task_get_ctx (const struct doca_task *task) |
| Get context from a doca task. More... | |
| DOCA_EXPERIMENTAL struct doca_ctx * | doca_task_batch_get_ctx (const struct doca_task_batch *task_batch) |
| Get context from a doca task_batch. More... | |
| DOCA_EXPERIMENTAL union doca_data | doca_task_batch_get_ctx_user_data (const struct doca_task_batch *task_batch) |
| Get context user data from a doca task_batch. More... | |
| DOCA_EXPERIMENTAL uint16_t | doca_task_batch_get_tasks_num (struct doca_task_batch *task_batch) |
| Get actual tasks number from a doca task_batch. More... | |
| DOCA_STABLE doca_error_t | doca_pe_connect_ctx (struct doca_pe *pe, struct doca_ctx *ctx) |
| This method connects a context to a progress engine. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_pe_set_event_mode (struct doca_pe *pe, enum doca_pe_event_mode event_mode) |
| Set event mode. More... | |
| typedef void(* doca_task_completion_cb_t) (struct doca_task *task, union doca_data task_user_data, union doca_data ctx_user_data) |
Function to execute on task completion.
This function is called by doca_pe_progress() when related task identified as completed successfully. When this function called the ownership of the task object passed from DOCA back to user. User may decide on the task object inside this callback:
Any failure/error inside this function should be handled internally or differed; due to the mode of nested in doca_pe_progress() execution this callback doesn't return error.
NOTE: this callback type utilizes successful & failed task completions.
| [in] | task | The successfully completed task. The implementation can assume this value is not NULL. |
| [in] | task_user_data | task user data |
| [in] | ctx_user_data | doca_ctx user data |
Supported batch sizes for event batches
| enum doca_pe_event_mode |
Flags used when submitting a doca_task.
These flags can be provided during task submission as part of doca_task_submit_ex
| DOCA_STABLE doca_error_t doca_pe_clear_notification | ( | struct doca_pe * | pe, |
| doca_notification_handle_t | handle | ||
| ) |
Clear triggered completions after wait.
Method used for clearing of events, this method should be called after an event has been received using the event handle. After this method is called, the events will no longer be triggered, and the handle can be armed again. See doca_pe_request_notification() for entire flow. Linux only: doca_pe_clear_notification does not have to be invoked when event mode is set to DOCA_PE_EVENT_MODE_PROGRESS_ALL. In such case doca_pe_request_notification will clear previous notifications.
| [in] | pe | The progress engine object that received the events. MUST NOT BE NULL. |
| [in] | handle | progress engine event handle. |
| DOCA_STABLE doca_error_t doca_pe_connect_ctx | ( | struct doca_pe * | pe, |
| struct doca_ctx * | ctx | ||
| ) |
This method connects a context to a progress engine.
: The connection can only be broken by destroying the context.
| [in] | pe | Progress engine to connect the context to |
| [in] | ctx | Context to connect |
| DOCA_STABLE doca_error_t doca_pe_create | ( | struct doca_pe ** | pe | ) |
Creates DOCA progress engine.
The progress engine is used to progress tasks and events. The progress engine is associated with one or more doca contexts. A doca context can only be associated with one progress engine.
| [out] | pe | progress engine to create |
| DOCA_STABLE doca_error_t doca_pe_destroy | ( | struct doca_pe * | pe | ) |
Destroy doca progress engine.
This function destroys a progress engine. Progress engine can be destroyed only after all connected contexts has been destroyed.
| DOCA_STABLE doca_error_t doca_pe_get_num_inflight_tasks | ( | const struct doca_pe * | pe, |
| size_t * | num_inflight_tasks | ||
| ) |
Get number of in flight tasks.
This method retrieves the number of in flight tasks in a progress engine
| [in] | pe | Progress engine to query |
| [out] | num_inflight_tasks | Total number of in flight tasks in the progress engine |
| DOCA_STABLE uint8_t doca_pe_progress | ( | struct doca_pe * | pe | ) |
Run the progress engine.
Polling method for progress of submitted tasks and handling of registered events. The method finds the next context with a completed task and invokes its completion callback.
| [in] | pe | The progress engine object to poll for completions. MUST NOT BE NULL. |
| DOCA_STABLE doca_error_t doca_pe_request_notification | ( | struct doca_pe * | pe | ) |
Arm the progress engine to wait for completion.
This method should be used before waiting on the completion handle. The expected flow is as follows:
| [in] | pe | The progress engine object to arm. MUST NOT BE NULL. |
| DOCA_EXPERIMENTAL doca_error_t doca_pe_set_event_mode | ( | struct doca_pe * | pe, |
| enum doca_pe_event_mode | event_mode | ||
| ) |
Set event mode.
Setting event mode affects doca_pe_progress behavior.
| [in] | pe | The progress engine to set |
| [in] | event_mode | The new event mode. |
| DOCA_EXPERIMENTAL void doca_task_batch_free | ( | struct doca_task_batch * | task_batch | ) |
Free a task_batch back to where it was allocated from.
This function frees a task_batch back to the where it was allocated from (usually a doca_ctx) Task Batch allocation is a per context API. All task_batches MUST be freed in order for a context to be stopped. A task_batch can be freed during completion / error callback or at any other place in the program as long as it is not submitted.
| [in] | task_batch | The task_batch to free |
| DOCA_EXPERIMENTAL struct doca_ctx* doca_task_batch_get_ctx | ( | const struct doca_task_batch * | task_batch | ) |
Get context from a doca task_batch.
This method retrieves the context from a doca task_batch
| [in] | task_batch | The task_batch to get the context from |
| DOCA_EXPERIMENTAL union doca_data doca_task_batch_get_ctx_user_data | ( | const struct doca_task_batch * | task_batch | ) |
Get context user data from a doca task_batch.
This method retrieves the context user data from a doca task_batch
| [in] | task_batch | The task_batch to get the context user data from |
| DOCA_EXPERIMENTAL doca_error_t doca_task_batch_get_status | ( | const struct doca_task_batch * | task_batch | ) |
Get task_batch status.
This method retrieves the status of a doca_task_batch
| [in] | task_batch | The task_batch to retrieve the status from |
| DOCA_EXPERIMENTAL uint16_t doca_task_batch_get_tasks_num | ( | struct doca_task_batch * | task_batch | ) |
Get actual tasks number from a doca task_batch.
This method retrieves the actual tasks number from a doca task_batch
| [in] | task_batch | The task_batch to get the tasks number from |
| DOCA_EXPERIMENTAL union doca_data doca_task_batch_get_user_data | ( | const struct doca_task_batch * | task_batch | ) |
Get user data from a task_batch.
This method retrieves user data from a doca_task_batch
| [in] | task_batch | doca_task_batch to get the user data from |
| DOCA_EXPERIMENTAL void doca_task_batch_set_user_data | ( | struct doca_task_batch * | task_batch, |
| union doca_data | user_data | ||
| ) |
Set user data to a task_batch.
This method sets a user data to a task_batch
| [in] | task_batch | doca_task_batch to set the user data to |
| [in] | user_data | doca_data to set |
| DOCA_EXPERIMENTAL doca_error_t doca_task_batch_submit | ( | struct doca_task_batch * | task_batch | ) |
Submit a task_batch to a progress engine.
This function submits a task_batch to a progress engine. The function DOES NOT validate the task_batch. The task batch is routed to the relevant context and will be executed asynchronously. See doca_pe_progress for task_batch completion details. The task_batch will be owned by DOCA upon a successful submission.
| [in] | task_batch | The task_batch to submit |
| DOCA_EXPERIMENTAL doca_error_t doca_task_batch_try_submit | ( | struct doca_task_batch * | task_batch | ) |
Try to submit a task_batch to a progress engine.
This function submits a task_batch to a progress engine. The function validates the task_batch (task_batch validation is different per task_batch type). If the task_batch is invalid it will not be submitted. The task_batch is routed to the relevant context and will be executed asynchronously. See doca_pe_progress for task_batch completion details. The task_batch will be owned by DOCA upon a successful submission.
| [in] | task_batch | The task_batch to submit |
| DOCA_STABLE void doca_task_free | ( | struct doca_task * | task | ) |
Free a task back to where it was allocated from.
This function frees a task back to the where it was allocated from (usually a doca_ctx) Task allocation is a per context API. All tasks MUST be freed in order for a context to be stopped. A task can be freed during completion / error callback or at any other place in the program as long as it is not submitted.
| [in] | task | to free |
| DOCA_STABLE struct doca_ctx* doca_task_get_ctx | ( | const struct doca_task * | task | ) |
Get context from a doca task.
This method retrieves the context from a doca task
| [in] | task | The task to get the context from |
| DOCA_STABLE doca_error_t doca_task_get_status | ( | const struct doca_task * | task | ) |
Get task status.
This method retrieves the status of a doca_task
| [in] | task | The task to retrieve the status from |
| DOCA_STABLE union doca_data doca_task_get_user_data | ( | const struct doca_task * | task | ) |
Get user data from a task.
This method retrieves user data from a doca_task
| [in] | task | doca_task to get the user data from |
| DOCA_STABLE void doca_task_set_user_data | ( | struct doca_task * | task, |
| union doca_data | user_data | ||
| ) |
Set user data to a task.
This method sets a user data to a task
| [in] | task | doca_task to set the user data to |
| [in] | user_data | doca_data to set |
| DOCA_STABLE doca_error_t doca_task_submit | ( | struct doca_task * | task | ) |
Submit a task to a progress engine.
This function submits a task to a progress engine. The function DOES NOT validate the task. The task is routed to the relevant context and will be executed asynchronously. See doca_pe_progress for task completion details. The task will be owned by DOCA upon a successful submission.
| [in] | task | The task to submit |
| DOCA_EXPERIMENTAL doca_error_t doca_task_submit_ex | ( | struct doca_task * | task, |
| uint32_t | flags | ||
| ) |
Extended version of doca_task_submit.
Same as doca_task_submit, but with ability to provide flags, see enum doca_task_submit_flag
| [in] | task | The task to submit |
| [in] | flags | Additional submit flags, bitwise or of enum doca_task_submit_flag |
| DOCA_STABLE doca_error_t doca_task_try_submit | ( | struct doca_task * | task | ) |
Try to submit a task to a progress engine.
This function submits a task to a progress engine. The function validates the task (task validation is different per task). If the task is invalid it will not be submitted. The task is routed to the relevant context and will be executed asynchronously. See doca_pe_progress for task completion details. The task will be owned by DOCA upon a successful submission.
| [in] | task | The task to submit |