NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
Collaboration diagram for DOCA UROM Services:

Macros

#define DOCA_CPU_ZERO(_cpusetp)   UCS_CPU_ZERO(_cpusetp)
 Set DOCA CPU set to zero. More...
 
#define DOCA_CPU_SET(_cpu, _cpusetp)   UCS_CPU_SET(_cpu, _cpusetp)
 Set specific bit in DOCA CPU set. More...
 
#define doca_cpu_is_set(_cpu, _cpusetp)   ucs_cpu_is_set(_cpu, _cpusetp)
 Check if specific bit in DOCA CPU is set. More...
 

Typedefs

typedef ucs_cpu_set_t doca_cpu_set_t
 DOCA CPU set structure. More...
 
typedef void(* doca_urom_service_get_workers_by_gid_task_completion_cb_t) (struct doca_urom_service_get_workers_by_gid_task *task, union doca_data task_user_data, union doca_data ctx_user_data)
 Service get workers task completion callback type. More...
 

Functions

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_create (struct doca_urom_service **service_ctx)
 This method creates a UROM Service context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_destroy (struct doca_urom_service *service_ctx)
 This method destroys a UROM Service context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_max_comm_msg_size (struct doca_urom_service *service_ctx, size_t msg_size)
 Set the maximum message size for the UROM communication channel. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_max_workers (struct doca_urom_service *service_ctx, uint32_t max_workers)
 Set maximum number of UROM workers. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_dev (struct doca_urom_service *service_ctx, struct doca_dev *dev)
 This method attaches a DOCA Device to the UROM Service context. More...
 
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_service_as_ctx (struct doca_urom_service *service_ctx)
 Convert service_ctx instance into a generalized context for use with DOCA core objects. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_plugins_list (struct doca_urom_service *service_ctx, const struct doca_urom_service_plugin_info **plugins, size_t *plugins_count)
 This method gets the list of supported plugins on service's DPU side. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_cpuset (struct doca_urom_service *service_ctx, doca_cpu_set_t *cpuset)
 Get the allowed CPU set for the service. More...
 

Detailed Description

DOCA UROM Service interfaces and data structures.

The UROM Service manages Workers running on a DOCA device.

Macro Definition Documentation

◆ doca_cpu_is_set

#define doca_cpu_is_set (   _cpu,
  _cpusetp 
)    ucs_cpu_is_set(_cpu, _cpusetp)

Check if specific bit in DOCA CPU is set.

Definition at line 119 of file doca_urom.h.

◆ DOCA_CPU_SET

#define DOCA_CPU_SET (   _cpu,
  _cpusetp 
)    UCS_CPU_SET(_cpu, _cpusetp)

Set specific bit in DOCA CPU set.

Definition at line 112 of file doca_urom.h.

◆ DOCA_CPU_ZERO

#define DOCA_CPU_ZERO (   _cpusetp)    UCS_CPU_ZERO(_cpusetp)

Set DOCA CPU set to zero.

Definition at line 105 of file doca_urom.h.

Typedef Documentation

◆ doca_cpu_set_t

typedef ucs_cpu_set_t doca_cpu_set_t

DOCA CPU set structure.

Definition at line 98 of file doca_urom.h.

◆ doca_urom_service_get_workers_by_gid_task_completion_cb_t

typedef void(* doca_urom_service_get_workers_by_gid_task_completion_cb_t) (struct doca_urom_service_get_workers_by_gid_task *task, union doca_data task_user_data, union doca_data ctx_user_data)

Service get workers task completion callback type.

Definition at line 148 of file doca_urom.h.

Function Documentation

◆ doca_urom_service_as_ctx()

DOCA_EXPERIMENTAL struct doca_ctx* doca_urom_service_as_ctx ( struct doca_urom_service *  service_ctx)

Convert service_ctx instance into a generalized context for use with DOCA core objects.

Parameters
[in]service_ctxService context instance. This must remain valid until after the context is no longer required.
Returns
Non NULL upon success, NULL otherwise.

◆ doca_urom_service_create()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_create ( struct doca_urom_service **  service_ctx)

This method creates a UROM Service context.

The UROM Service runs on a DOCA Device. A Service manages UROM Workers which run on the Device. A Worker runs UROM Plugins which implement application logic which runs on the Device.

A Service is created in state DOCA_CTX_STATE_IDLE. After creation, a user may configure the Service using setter methods (e.g. doca_urom_service_set_dev()). Before use, a Service must be transitioned to state DOCA_CTX_STATE_RUNNING using the doca_ctx_start() interface. A typical invocation looks like:

doca_ctx_start(doca_urom_service_as_ctx(service_ctx))

Parameters
[out]service_ctxThe DOCA UROM Service
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - service_ctx argument is a NULL pointer.
  • DOCA_ERROR_NO_MEMORY - failed to alloc service_ctx.

◆ doca_urom_service_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_destroy ( struct doca_urom_service *  service_ctx)

This method destroys a UROM Service context.

Parameters
[in]service_ctxPointer to instance to be destroyed.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_NOT_PERMITTED - Service isn't in IDLE state.
  • DOCA_ERROR_IN_USE - One or more work queues are still attached. These must be detached first.

◆ doca_urom_service_get_cpuset()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_cpuset ( struct doca_urom_service *  service_ctx,
doca_cpu_set_t cpuset 
)

Get the allowed CPU set for the service.

Parameters
[in]service_ctxService context instance.
[out]cpusetSet of allowed CPUs.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - Any argument is a NULL pointer.
  • DOCA_ERROR_BAD_STATE - service_ctx is not started.

◆ doca_urom_service_get_plugins_list()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_plugins_list ( struct doca_urom_service *  service_ctx,
const struct doca_urom_service_plugin_info **  plugins,
size_t plugins_count 
)

This method gets the list of supported plugins on service's DPU side.

Parameters
[in]service_ctxService context instance.
[out]pluginsSet of supported plugins.
[out]plugins_countSet of plugins number.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - Any argument is a NULL pointer.
  • DOCA_ERROR_BAD_STATE - service_ctx is not running.
  • DOCA_ERROR_NOT_FOUND - No plugins were discovered on DPU side.

◆ doca_urom_service_set_dev()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_dev ( struct doca_urom_service *  service_ctx,
struct doca_dev *  dev 
)

This method attaches a DOCA Device to the UROM Service context.

Attaching to a DOCA Device is mandatory, network address will be extracted from services mapping that is defined in the user environment DOCA_UROM_SERVICE_FILE

Parameters
[in]service_ctxThe UROM Service context to attach the device to.
[in]devThe device to attach.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - Any argument is a NULL pointer.
  • DOCA_ERROR_NOT_SUPPORTED - UROM is not supported
  • DOCA_ERROR_BAD_STATE - service_ctx is not idle.

◆ doca_urom_service_set_max_comm_msg_size()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_max_comm_msg_size ( struct doca_urom_service *  service_ctx,
size_t  msg_size 
)

Set the maximum message size for the UROM communication channel.

This method sets the maximum size for message in UROM communication channel, default message size is 4096B. The communication channel message is composed of the UROM urom_worker_notify/urom_worker_cmd structures and the plugin payload (command/notification). It's important to ensure that the combined size of plugins' commands and notifications, along with the UROM structures size, does not exceed this maximum size.

Parameters
[in]service_ctxThe UROM Service context to set comm msg size
[in]msg_sizeThe maximum message size.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - service_ctx argument is a NULL pointer.
  • DOCA_ERROR_BAD_STATE - service_ctx is not idle.

◆ doca_urom_service_set_max_workers()

DOCA_EXPERIMENTAL doca_error_t doca_urom_service_set_max_workers ( struct doca_urom_service *  service_ctx,
uint32_t  max_workers 
)

Set maximum number of UROM workers.

This method sets the maximum number of spawned workers

Parameters
[in]service_ctxThe UROM Service context to set number of workers.
[in]max_workersThe maximum number of workers, Must be a power of 2.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - service_ctx argument is a NULL pointer.
  • DOCA_ERROR_BAD_STATE - service_ctx is not idle.