NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Comch Producer
Collaboration diagram for DOCA Comch Producer:

Typedefs

typedef uint64_t doca_dpa_dev_comch_producer_t
 DPA handle for DPA producer. More...
 
typedef void(* doca_comch_producer_task_send_completion_cb_t) (struct doca_comch_producer_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
 

Functions

DOCA_STABLE doca_error_t doca_comch_producer_create (struct doca_comch_connection *comch_connection, struct doca_comch_producer **producer)
 
DOCA_STABLE doca_error_t doca_comch_producer_destroy (struct doca_comch_producer *producer)
 
DOCA_STABLE doca_error_t doca_comch_producer_cap_is_supported (const struct doca_devinfo *devinfo)
 
DOCA_STABLE doca_error_t doca_comch_producer_get_id (const struct doca_comch_producer *producer, uint32_t *id)
 
DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_num_tasks (const struct doca_devinfo *devinfo, uint32_t *max_num_tasks)
 
DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_buf_size (const struct doca_devinfo *devinfo, uint32_t *max_buf_size)
 
DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_buf_list_len (const struct doca_devinfo *devinfo, uint32_t *max_buf_list_len)
 
DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_producers (const struct doca_devinfo *devinfo, uint32_t *max_producers)
 
DOCA_STABLE struct doca_ctx * doca_comch_producer_as_ctx (struct doca_comch_producer *producer)
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_set_dev_max_num_send (struct doca_comch_producer *producer, uint32_t dev_num_send)
 Set the maximal number of send operations for a DPA producer. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_dpa_completion_attach (struct doca_comch_producer *producer, struct doca_dpa_completion *dpa_comp)
 Associate producer with DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_get_dpa_handle (struct doca_comch_producer *producer, doca_dpa_dev_comch_producer_t *dpa_producer)
 Retrieve the handle in the dpa memory space of a doca_comch_producer. More...
 
DOCA_STABLE doca_error_t doca_comch_producer_task_send_set_conf (struct doca_comch_producer *producer, doca_comch_producer_task_send_completion_cb_t task_completion_cb, doca_comch_producer_task_send_completion_cb_t task_error_cb, uint32_t num_send_tasks)
 
DOCA_STABLE doca_error_t doca_comch_producer_task_send_alloc_init (struct doca_comch_producer *producer, const struct doca_buf *buf, uint8_t *imm_data, uint32_t imm_data_len, uint32_t consumer_id, struct doca_comch_producer_task_send **task)
 
DOCA_STABLE const struct doca_buf * doca_comch_producer_task_send_get_buf (const struct doca_comch_producer_task_send *task)
 
DOCA_STABLE void doca_comch_producer_task_send_set_buf (struct doca_comch_producer_task_send *task, const struct doca_buf *buf)
 
DOCA_STABLE uint32_t doca_comch_producer_task_send_get_consumer_id (const struct doca_comch_producer_task_send *task)
 
DOCA_STABLE void doca_comch_producer_task_send_set_consumer_id (struct doca_comch_producer_task_send *task, const uint32_t consumer_id)
 
DOCA_STABLE uint8_t * doca_comch_producer_task_send_get_imm_data (const struct doca_comch_producer_task_send *task)
 
DOCA_STABLE uint32_t doca_comch_producer_task_send_get_imm_data_len (const struct doca_comch_producer_task_send *task)
 
DOCA_STABLE void doca_comch_producer_task_send_set_imm_data (struct doca_comch_producer_task_send *task, uint8_t *imm_data, uint32_t imm_data_len)
 
DOCA_STABLE struct doca_task * doca_comch_producer_task_send_as_task (struct doca_comch_producer_task_send *task)
 

Detailed Description

DOCA Communication Channel Producer offers an extension the doca_comch channel for accelerated data transfer between memory on the host and DPU in a FIFO format. An established doca_comch connection is required to negotiate the end points of the FIFO. A producer object can populate buffers advertised by any consumers associated with the same doca_comch connection. The inter-process communication runs over DMA/PCIe and does not affect network bandwidth.

Typedef Documentation

◆ doca_comch_producer_task_send_completion_cb_t

typedef void(* doca_comch_producer_task_send_completion_cb_t) (struct doca_comch_producer_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)

Function executed on doca_comch_producer send task completion. Used for both task success and failure.

Parameters
[in]taskDoca producer send task that has completed.
[in]task_user_dataThe task user data.
[in]ctx_user_dataDoca_comch context user data.

The implementation can assume this value is not NULL.

Definition at line 283 of file doca_comch_producer.h.

◆ doca_dpa_dev_comch_producer_t

DPA handle for DPA producer.

Definition at line 58 of file doca_comch_producer.h.

Function Documentation

◆ doca_comch_producer_as_ctx()

DOCA_STABLE struct doca_ctx* doca_comch_producer_as_ctx ( struct doca_comch_producer *  producer)

Convert doca_comch_producer instance into a generalized context for use with doca core objects.

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

◆ doca_comch_producer_cap_get_max_buf_list_len()

DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_buf_list_len ( const struct doca_devinfo *  devinfo,
uint32_t *  max_buf_list_len 
)

Get the max length of doca_buf list that can be sent by a doca_comch_producer instance.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_buf_list_lenMaximum sized buffer list that can be sent by the producer.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - if producer is not supported on device.

◆ doca_comch_producer_cap_get_max_buf_size()

DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_buf_size ( const struct doca_devinfo *  devinfo,
uint32_t *  max_buf_size 
)

Get the max size doca_buf that can be sent by a doca_comch_producer instance.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_buf_sizeMaximum sized buffer that can be sent by the producer.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - if producer is not supported on device.

◆ doca_comch_producer_cap_get_max_num_tasks()

DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_num_tasks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_num_tasks 
)

Get the max number of tasks supported by the device for a doca_comch_producer instance.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_num_tasksThe maximum number of tasks that can allocated by the instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_producer_cap_get_max_producers()

DOCA_STABLE doca_error_t doca_comch_producer_cap_get_max_producers ( const struct doca_devinfo *  devinfo,
uint32_t *  max_producers 
)

Get the max number of producers that can be associated with a doca_comch_connection.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_producersMaximum number of producers that can be added to a doca_comch_connection.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_producer_cap_is_supported()

DOCA_STABLE doca_error_t doca_comch_producer_cap_is_supported ( const struct doca_devinfo *  devinfo)

Check if given device is capable of running a producer.

Parameters
[in]devinfoThe DOCA device information.
Returns
DOCA_SUCCESS - in case device can implement a producer. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - provided devinfo can not implement a producer.

◆ doca_comch_producer_create()

DOCA_STABLE doca_error_t doca_comch_producer_create ( struct doca_comch_connection *  comch_connection,
struct doca_comch_producer **  producer 
)

Create a DOCA Comch producer instance.

Parameters
[in]comch_connectionAn established control channel connection to associate producer with.
[out]producerPointer to pointer to be set to created doca_comch_producer instance.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - input parameter is a NULL pointer.
  • DOCA_ERROR_NO_MEMORY - failed to alloc doca_comch_producer.
  • DOCA_ERROR_BAD_STATE - comch_connection is not established.
  • DOCA_ERROR_NOT_PERMITTED - incompatible version of comch_connection.

◆ doca_comch_producer_destroy()

DOCA_STABLE doca_error_t doca_comch_producer_destroy ( struct doca_comch_producer *  producer)

Destroy a DOCA Comch producer instance.

Parameters
[in]producerPointer to doca_comch_producer instance to destroy.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - producer argument is a NULL pointer.
  • DOCA_ERROR_INITIALIZATION - failed to initialize a mutex.

◆ doca_comch_producer_dpa_completion_attach()

DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_dpa_completion_attach ( struct doca_comch_producer *  producer,
struct doca_dpa_completion *  dpa_comp 
)

Associate producer with DPA completion context.

This will allow the completion context to send completions of this producer on the DPA

Parameters
[in]producerThe doca_comch_producer instance. Must call doca_ctx_set_datapath_on_dpa() prior to this call
[in]dpa_compThe DOCA DPA completion context to associate with producer.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_producer_get_dpa_handle()

DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_get_dpa_handle ( struct doca_comch_producer *  producer,
doca_dpa_dev_comch_producer_t dpa_producer 
)

Retrieve the handle in the dpa memory space of a doca_comch_producer.

Parameters
[in]producerdoca_comch_producer context to get the dpa handle from.
[out]dpa_producerA pointer to the handle in the dpa memory space.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if called before calling doca_ctx_start(), or if not assigned to dpa datapath.

◆ doca_comch_producer_get_id()

DOCA_STABLE doca_error_t doca_comch_producer_get_id ( const struct doca_comch_producer *  producer,
uint32_t *  id 
)

Get the id the doca_comch_producer instance.

Parameters
[in]producerThe doca_comch_producer instance.
[out]idPer comch_connection unique id associated with the producer instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_producer_set_dev_max_num_send()

DOCA_EXPERIMENTAL doca_error_t doca_comch_producer_set_dev_max_num_send ( struct doca_comch_producer *  producer,
uint32_t  dev_num_send 
)

Set the maximal number of send operations for a DPA producer.

Parameters
[in]producerThe doca_comch_producer instance.
[in]dev_num_sendThe maximal number of send that can be associated with the context. Will be rounded up to next power of 2
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_producer_task_send_alloc_init()

DOCA_STABLE doca_error_t doca_comch_producer_task_send_alloc_init ( struct doca_comch_producer *  producer,
const struct doca_buf *  buf,
uint8_t *  imm_data,
uint32_t  imm_data_len,
uint32_t  consumer_id,
struct doca_comch_producer_task_send **  task 
)

Allocate and initialize a doca_producer send task.

Parameters
[in]producerThe doca_comch_producer instance.
[in]bufDoca buffer to send to a consumer.
[in]imm_dataPointer to immediate data to include in the send.
[in]imm_data_lenLength of data in bytes pointed to by imm_data.
[in]consumer_idID of consumer to send the buffer to.
[out]taskPointer to a doca_comch_producer_task_send instance populated with input parameters.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_NO_MEMORY - no available tasks to allocate.

◆ doca_comch_producer_task_send_as_task()

DOCA_STABLE struct doca_task* doca_comch_producer_task_send_as_task ( struct doca_comch_producer_task_send *  task)

Convert doca_comch_producer_task_send instance into a generalized task for use with progress engine.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
Returns
Non NULL upon success, NULL otherwise.

◆ doca_comch_producer_task_send_get_buf()

DOCA_STABLE const struct doca_buf* doca_comch_producer_task_send_get_buf ( const struct doca_comch_producer_task_send *  task)

Get the doca_buf from the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
Returns
Non NULL upon success, NULL otherwise.

◆ doca_comch_producer_task_send_get_consumer_id()

DOCA_STABLE uint32_t doca_comch_producer_task_send_get_consumer_id ( const struct doca_comch_producer_task_send *  task)

Get the consumer id from the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
Returns
Consumer_id

◆ doca_comch_producer_task_send_get_imm_data()

DOCA_STABLE uint8_t* doca_comch_producer_task_send_get_imm_data ( const struct doca_comch_producer_task_send *  task)

Get any immediate data from the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
Returns
Immediate data pointer or nullptr if none exists

◆ doca_comch_producer_task_send_get_imm_data_len()

DOCA_STABLE uint32_t doca_comch_producer_task_send_get_imm_data_len ( const struct doca_comch_producer_task_send *  task)

Get any immediate data length from the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
Returns
Length of immediate data.

◆ doca_comch_producer_task_send_set_buf()

DOCA_STABLE void doca_comch_producer_task_send_set_buf ( struct doca_comch_producer_task_send *  task,
const struct doca_buf *  buf 
)

Set the doca_buf in a doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
[in]bufBuffer to set in the task.

◆ doca_comch_producer_task_send_set_conf()

DOCA_STABLE doca_error_t doca_comch_producer_task_send_set_conf ( struct doca_comch_producer *  producer,
doca_comch_producer_task_send_completion_cb_t  task_completion_cb,
doca_comch_producer_task_send_completion_cb_t  task_error_cb,
uint32_t  num_send_tasks 
)

Configure the doca_comch_producer send task callback and parameters.

Parameters
[in]producerThe doca_comch_producer instance.
[in]task_completion_cbSend task completion callback.
[in]task_error_cbSend task error callback.
[in]num_send_tasksNumber of send tasks a producer can allocate. Must not exceed value returned by doca_comch_producer_cap_get_max_num_tasks()
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_BAD_STATE - producer instance is already active.

◆ doca_comch_producer_task_send_set_consumer_id()

DOCA_STABLE void doca_comch_producer_task_send_set_consumer_id ( struct doca_comch_producer_task_send *  task,
const uint32_t  consumer_id 
)

Set the consumer id in the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
[in]consumer_idConsumer id to set in the task.

◆ doca_comch_producer_task_send_set_imm_data()

DOCA_STABLE void doca_comch_producer_task_send_set_imm_data ( struct doca_comch_producer_task_send *  task,
uint8_t *  imm_data,
uint32_t  imm_data_len 
)

Set immediate data in the doca_comch_producer_task_send instance.

Parameters
[in]taskThe doca_comch_producer_task_send instance.
[in]imm_dataPointer to immediate data to copy to task
[in]imm_data_lenLength of the immediate data in bytes