DOCA UROM Worker Task interfaces and data structures.
There is one main type of Worker task called a Command task. A Command task defines a plugin and a payload. The Command payload is passed to the plugin running on the associated UROM Worker. Individual plugins define the payload format and behavior of each Command. Optionally, a Command task may return some plugin-defined response data upon completion.
As an example, an RDMA plugin may define a Command to perform an offloaded RDMA Send. The plugin defines the arguments required to offload the Send to the Worker. In order to perform this operation, a Command task is created and formatted to describe the Send. The user then submits the Task to initiate the operation.
◆ doca_urom_worker_cmd_task_allocate()
| DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_cmd_task_allocate |
( |
struct doca_urom_worker * |
worker_ctx, |
|
|
struct doca_urom_worker_cmd_task ** |
task |
|
) |
| |
Allocate Worker Command task.
- Parameters
-
| [in] | worker_ctx | The Worker used for the task. |
| [out] | task | The new task. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_NO_MEMORY - Failed to allocate task.
◆ doca_urom_worker_cmd_task_allocate_init()
| DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_cmd_task_allocate_init |
( |
struct doca_urom_worker * |
worker_ctx, |
|
|
uint64_t |
plugin, |
|
|
struct doca_urom_worker_cmd_task ** |
task |
|
) |
| |
Allocate and initialize Worker Command task.
- Parameters
-
| [in] | worker_ctx | The Worker used for the task. |
| [in] | plugin | The plugin to use for the task. |
| [out] | task | The new task. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_NO_MEMORY - Failed to allocate task.
◆ doca_urom_worker_cmd_task_get_payload()
| DOCA_EXPERIMENTAL struct doca_buf* doca_urom_worker_cmd_task_get_payload |
( |
struct doca_urom_worker_cmd_task * |
task | ) |
|
Get Worker Command task payload.
- Parameters
-
| [in] | task | The task to return a payload from. |
- Returns
- The payload buffer to return
◆ doca_urom_worker_cmd_task_get_response()
| DOCA_EXPERIMENTAL struct doca_buf* doca_urom_worker_cmd_task_get_response |
( |
struct doca_urom_worker_cmd_task * |
task | ) |
|
Get Worker Command task response.
- Parameters
-
| [in] | task | The task to return a response from. |
- Returns
- The response buffer to return
◆ doca_urom_worker_cmd_task_get_user_data()
| DOCA_EXPERIMENTAL void* doca_urom_worker_cmd_task_get_user_data |
( |
struct doca_urom_worker_cmd_task * |
task | ) |
|
Get Worker Command user data to populate.
- Parameters
-
| [in] | task | The task to return a user data |
- Returns
- The user data buffer (Maximum data size is 32 Bytes)
◆ doca_urom_worker_cmd_task_release()
Release Worker Command task.
- Parameters
-
| [in] | task | The task to release |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_NOT_PERMITTED - Task resources still in use.
◆ doca_urom_worker_cmd_task_set_cb()
Set Worker Command task callback.
- Parameters
-
| [in] | task | The task used to set the callback on. |
| [in] | cb | The task callback to set. |
◆ doca_urom_worker_cmd_task_set_plugin()
| DOCA_EXPERIMENTAL void doca_urom_worker_cmd_task_set_plugin |
( |
struct doca_urom_worker_cmd_task * |
task, |
|
|
uint64_t |
plugin |
|
) |
| |
Set Worker Command task plugin.
- Parameters
-
| [in] | task | The task used to set the plugin on. |
| [in] | plugin | The task plugin to set. |