30 #include <arpa/inet.h>
60 DOCA_LOG_ERR(
"Entered IB device name exceeding the maximum size of %d",
72 struct doca_argp_param *device_param;
98 struct doca_urom_service **service)
101 struct doca_urom_service *inst;
111 goto service_cleanup;
115 goto service_cleanup;
119 goto service_cleanup;
123 goto service_cleanup;
149 struct doca_urom_service *service,
157 struct doca_urom_worker **worker)
160 struct doca_urom_worker *inst;
199 if (cpuset !=
NULL) {
245 uint64_t *worker_ids,
246 struct doca_urom_worker **workers,
250 struct doca_urom_domain **
domain)
255 struct doca_urom_domain *inst;
275 if (nb_workers != 0 && buffers !=
NULL) {
280 for (i = 0; i < nb_buffers; i++) {
287 buffers[i].mkey_len);
static enum doca_flow_pipe_domain domain
static struct doca_pe * pe
DOCA_EXPERIMENTAL void doca_argp_param_set_description(struct doca_argp_param *param, const char *description)
Set the description of the program param, used during program usage.
DOCA_EXPERIMENTAL void doca_argp_param_set_long_name(struct doca_argp_param *param, const char *name)
Set the long name of the program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_arguments(struct doca_argp_param *param, const char *arguments)
Set the description of the expected arguments of the program param, used during program usage.
DOCA_EXPERIMENTAL void doca_argp_param_set_callback(struct doca_argp_param *param, doca_argp_param_cb_t callback)
Set the callback function of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_param_create(struct doca_argp_param **param)
Create new program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_type(struct doca_argp_param *param, enum doca_argp_type type)
Set the type of the param arguments.
DOCA_EXPERIMENTAL void doca_argp_param_set_short_name(struct doca_argp_param *param, const char *name)
Set the short name of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_register_param(struct doca_argp_param *input_param)
Register a program flag.
DOCA_STABLE doca_error_t doca_ctx_start(struct doca_ctx *ctx)
Finalizes all configurations, and starts the DOCA CTX.
DOCA_STABLE doca_error_t doca_ctx_get_state(const struct doca_ctx *ctx, enum doca_ctx_states *state)
Get context state.
DOCA_STABLE doca_error_t doca_ctx_stop(struct doca_ctx *ctx)
Stops the context allowing reconfiguration.
doca_ctx_states
This enum defines the states of a context.
@ DOCA_CTX_STATE_STARTING
#define DOCA_DEVINFO_IBDEV_NAME_SIZE
Buffer size to hold Infiniband/RoCE device name. Including a null terminator.
#define DOCA_ERROR_PROPAGATE(r, t)
Save the first encountered doca_error_t.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
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.
DOCA_STABLE uint8_t doca_pe_progress(struct doca_pe *pe)
Run the progress engine.
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_domain_as_ctx(struct doca_urom_domain *domain_ctx)
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_destroy(struct doca_urom_domain *domain_ctx)
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_set_oob(struct doca_urom_domain *domain_ctx, struct doca_urom_domain_oob_coll *oob)
Set OOB communication info to be used for Domain initialization.
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_create(struct doca_urom_domain **domain_ctx)
This method creates a UROM Domain context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_add_buffer(struct doca_urom_domain *domain_ctx, void *buffer, size_t buf_len, void *memh, size_t memh_len, void *mkey, size_t mkey_len)
This method attaches local buffer attributes to the Domain. Should be called after calling doca_urom_...
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_set_workers(struct doca_urom_domain *domain_ctx, uint64_t *domain_worker_ids, struct doca_urom_worker **workers, size_t workers_cnt)
Set the list of Workers in the domain.
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_set_buffers_count(struct doca_urom_domain *domain_ctx, size_t buffers_cnt)
This method attaches the number of local buffers that will be added to the Domain.
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.
ucs_cpu_set_t doca_cpu_set_t
DOCA CPU set structure.
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.
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_destroy(struct doca_urom_service *service_ctx)
This method destroys a UROM Service context.
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.
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_create(struct doca_urom_service **service_ctx)
This method creates a UROM Service context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_service(struct doca_urom_worker *worker_ctx, struct doca_urom_service *service_ctx)
This method attaches a UROM Service to the Worker context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_cpuset(struct doca_urom_worker *worker_ctx, doca_cpu_set_t cpuset)
Set the allowed CPUs for the Worker. The cpuset must be a subset of the service's allowed CPUs.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_destroy(struct doca_urom_worker *worker_ctx)
This method destroys a UROM Worker context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_env(struct doca_urom_worker *worker_ctx, char *const env[], size_t count)
Set worker env variables when spawning worker on DPU side.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_create(struct doca_urom_worker **worker_ctx)
This method creates a UROM Worker context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_gid(struct doca_urom_worker *worker_ctx, uint32_t gid)
Set worker group ID, must be set before starting the worker context.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_max_inflight_tasks(struct doca_urom_worker *worker_ctx, uint32_t max_tasks)
Set Worker maximum in-flight tasks.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_id(struct doca_urom_worker *worker_ctx, uint64_t worker_id)
This method sets the Worker context ID to be used to identify the Worker. Worker IDs enable an applic...
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_set_plugins(struct doca_urom_worker *worker_ctx, uint64_t plugins)
This method adds plugins mask for the supported plugins by the UROM Worker on the DPU.
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_worker_as_ctx(struct doca_urom_worker *worker_ctx)
Out-of-band communication descriptor for Domain creation.
char device_name[DOCA_DEVINFO_IBDEV_NAME_SIZE]
doca_error_t start_urom_service(struct doca_pe *pe, struct doca_dev *dev, uint64_t nb_workers, struct doca_urom_service **service)
doca_error_t register_urom_common_params(void)
doca_error_t start_urom_worker(struct doca_pe *pe, struct doca_urom_service *service, uint64_t worker_id, uint32_t *gid, uint64_t nb_tasks, doca_cpu_set_t *cpuset, char **env, size_t env_count, uint64_t plugins, struct doca_urom_worker **worker)
static doca_error_t device_address_callback(void *param, void *config)
doca_error_t start_urom_domain(struct doca_pe *pe, struct doca_urom_domain_oob_coll *oob, uint64_t *worker_ids, struct doca_urom_worker **workers, size_t nb_workers, struct urom_domain_buffer_attrs *buffers, size_t nb_buffers, struct doca_urom_domain **domain)
DOCA_LOG_REGISTER(UROM::SAMPLES :COMMON)