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

Typedefs

typedef uint64_t doca_dpa_dev_comch_consumer_completion_t
 DPA handle for DPA consumer completion context. More...
 
typedef uint64_t doca_dpa_dev_comch_consumer_t
 DPA handle for DPA consumer. More...
 
typedef void(* doca_comch_consumer_task_post_recv_completion_cb_t) (struct doca_comch_consumer_task_post_recv *task, union doca_data task_user_data, union doca_data ctx_user_data)
 

Functions

DOCA_STABLE doca_error_t doca_comch_consumer_create (struct doca_comch_connection *comch_connection, struct doca_mmap *buf_mmap, struct doca_comch_consumer **consumer)
 
DOCA_STABLE doca_error_t doca_comch_consumer_destroy (struct doca_comch_consumer *consumer)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_is_supported (const struct doca_devinfo *devinfo)
 
DOCA_STABLE doca_error_t doca_comch_consumer_get_id (const struct doca_comch_consumer *consumer, uint32_t *id)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_num_tasks (const struct doca_devinfo *devinfo, uint32_t *max_num_tasks)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_buf_size (const struct doca_devinfo *devinfo, uint32_t *max_buf_size)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_buf_list_len (const struct doca_devinfo *devinfo, uint32_t *max_buf_list_len)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_consumers (const struct doca_devinfo *devinfo, uint32_t *max_consumers)
 
DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_imm_data_len (const struct doca_devinfo *devinfo, uint32_t *max_imm_data_len)
 
DOCA_STABLE doca_error_t doca_comch_consumer_get_imm_data_len (const struct doca_comch_consumer *consumer, uint32_t *imm_data_len)
 
DOCA_STABLE doca_error_t doca_comch_consumer_set_imm_data_len (struct doca_comch_consumer *consumer, uint32_t imm_data_len)
 
DOCA_STABLE struct doca_ctx * doca_comch_consumer_as_ctx (struct doca_comch_consumer *consumer)
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_create (struct doca_comch_consumer_completion **consumer_comp)
 Allocate DOCA Comch consumer completion context on DPA. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_dpa_thread (struct doca_comch_consumer_completion *consumer_comp, struct doca_dpa_thread *dpa_thread)
 Set the DOCA DPA thread of the completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_destroy (struct doca_comch_consumer_completion *consumer_comp)
 Destroy the DOCA Comch consumer completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_start (struct doca_comch_consumer_completion *consumer_comp)
 Start DOCA Comch consumer completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_stop (struct doca_comch_consumer_completion *consumer_comp)
 Stop DOCA Comch consumer completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_dpa_handle (struct doca_comch_consumer_completion *consumer_comp, doca_dpa_dev_comch_consumer_completion_t *consumer_comp_handle)
 Get the DPA handle for the DOCA Comch consumer completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_max_num_consumers (struct doca_comch_consumer_completion *consumer_comp, uint32_t max_num_consumers)
 Set the maximal number of consumers that can be associated with the completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_max_num_consumers (const struct doca_comch_consumer_completion *consumer_comp, uint32_t *max_num_consumers)
 Get the maximal number of consumers that can be associated with the completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_max_num_recv (struct doca_comch_consumer_completion *consumer_comp, uint32_t max_num_recv)
 Set the maximal number of receive operations across all consumers associated with the completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_max_num_recv (const struct doca_comch_consumer_completion *consumer_comp, uint32_t *max_num_recv)
 Get the maximal number of receive operations across all consumers associated with the completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_imm_data_len (struct doca_comch_consumer_completion *consumer_comp, uint32_t imm_data_len)
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_imm_data_len (const struct doca_comch_consumer_completion *consumer_comp, uint32_t *imm_data_len)
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_set_dev_max_num_recv (struct doca_comch_consumer *consumer, uint32_t dev_num_recv)
 Set the maximal number of receive operations for a DPA consumer. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_set_completion (struct doca_comch_consumer *consumer, struct doca_comch_consumer_completion *consumer_comp, uint32_t user_data)
 Associate consumer with DPA completion context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_get_dpa_handle (struct doca_comch_consumer *consumer, doca_dpa_dev_comch_consumer_t *dpa_consumer)
 Retrieve the handle in the dpa memory space of a doca_comch_consumer. More...
 
DOCA_STABLE doca_error_t doca_comch_consumer_task_post_recv_set_conf (struct doca_comch_consumer *consumer, doca_comch_consumer_task_post_recv_completion_cb_t task_completion_cb, doca_comch_consumer_task_post_recv_completion_cb_t task_error_cb, uint32_t num_post_recv_tasks)
 
DOCA_STABLE doca_error_t doca_comch_consumer_task_post_recv_alloc_init (struct doca_comch_consumer *consumer, struct doca_buf *buf, struct doca_comch_consumer_task_post_recv **task)
 Allocate and initialize a doca_consumer post receive task. More...
 
DOCA_STABLE struct doca_buf * doca_comch_consumer_task_post_recv_get_buf (const struct doca_comch_consumer_task_post_recv *task)
 
DOCA_STABLE void doca_comch_consumer_task_post_recv_set_buf (struct doca_comch_consumer_task_post_recv *task, struct doca_buf *buf)
 
DOCA_STABLE uint32_t doca_comch_consumer_task_post_recv_get_producer_id (const struct doca_comch_consumer_task_post_recv *task)
 
DOCA_STABLE const uint8_t * doca_comch_consumer_task_post_recv_get_imm_data (const struct doca_comch_consumer_task_post_recv *task)
 
DOCA_STABLE uint32_t doca_comch_consumer_task_post_recv_get_imm_data_len (const struct doca_comch_consumer_task_post_recv *task)
 
DOCA_STABLE struct doca_task * doca_comch_consumer_task_post_recv_as_task (struct doca_comch_consumer_task_post_recv *task)
 

Detailed Description

DOCA Communication Channel Consumer 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 consumer object can then post buffers to a remote process that it wishes to receive data on. Completion of a consumer post receive message indicates that data has been populated from a remote producer. The inter-process communication runs over DMA/PCIe and does not affect network bandwidth.

Typedef Documentation

◆ doca_comch_consumer_task_post_recv_completion_cb_t

typedef void(* doca_comch_consumer_task_post_recv_completion_cb_t) (struct doca_comch_consumer_task_post_recv *task, union doca_data task_user_data, union doca_data ctx_user_data)

Function executed on doca_comch_consumer post receive completion. Used for both task success and failure.

Parameters
[in]taskDoca consumer post recv 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 557 of file doca_comch_consumer.h.

◆ doca_dpa_dev_comch_consumer_completion_t

DPA handle for DPA consumer completion context.

Definition at line 60 of file doca_comch_consumer.h.

◆ doca_dpa_dev_comch_consumer_t

DPA handle for DPA consumer.

Definition at line 65 of file doca_comch_consumer.h.

Function Documentation

◆ doca_comch_consumer_as_ctx()

DOCA_STABLE struct doca_ctx* doca_comch_consumer_as_ctx ( struct doca_comch_consumer *  consumer)

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

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

◆ doca_comch_consumer_cap_get_max_buf_list_len()

DOCA_STABLE doca_error_t doca_comch_consumer_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 received by a doca_comch_consumer instance.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_buf_list_lenMaximum sized buffer list that can be received by the consumer.
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 consumer is not supported on device.

◆ doca_comch_consumer_cap_get_max_buf_size()

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

Get the max size doca_buf that can be received by a doca_comch_consumer instance.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_buf_sizeMaximum sized buffer that can be received by the consumer.
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 consumer is not supported on device.

◆ doca_comch_consumer_cap_get_max_consumers()

DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_consumers ( const struct doca_devinfo *  devinfo,
uint32_t *  max_consumers 
)

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

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_consumersMaximum number of consumers 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_consumer_cap_get_max_imm_data_len()

DOCA_STABLE doca_error_t doca_comch_consumer_cap_get_max_imm_data_len ( const struct doca_devinfo *  devinfo,
uint32_t *  max_imm_data_len 
)

Get the max length of immediate data supported by consumers.

Parameters
[in]devinfoDevinfo to query the capability for.
[out]max_imm_data_lenMaximum length of immediate data consumers support.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_consumer_cap_get_max_num_tasks()

DOCA_STABLE doca_error_t doca_comch_consumer_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_consumer 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_consumer_cap_is_supported()

DOCA_STABLE doca_error_t doca_comch_consumer_cap_is_supported ( const struct doca_devinfo *  devinfo)

Check if given device is capable of running a consumer.

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

◆ doca_comch_consumer_completion_create()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_create ( struct doca_comch_consumer_completion **  consumer_comp)

Allocate DOCA Comch consumer completion context on DPA.

Parameters
[out]consumer_compThe newly created DOCA Comch consumer completion context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_destroy ( struct doca_comch_consumer_completion *  consumer_comp)

Destroy the DOCA Comch consumer completion context.

The associated dpa handle will be destroyed as well.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to destroy.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_get_dpa_handle()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_dpa_handle ( struct doca_comch_consumer_completion *  consumer_comp,
doca_dpa_dev_comch_consumer_completion_t consumer_comp_handle 
)

Get the DPA handle for the DOCA Comch consumer completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context previously created on DPA.
[out]consumer_comp_handleA pointer to the associated DPA handle in the dpa memory space.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_get_imm_data_len()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_imm_data_len ( const struct doca_comch_consumer_completion *  consumer_comp,
uint32_t *  imm_data_len 
)

Get the length of immediate data supported by a consumer completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to query.
[out]imm_data_lenLength of immediate data the consumer completion context is configured to support.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_consumer_completion_get_max_num_consumers()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_max_num_consumers ( const struct doca_comch_consumer_completion *  consumer_comp,
uint32_t *  max_num_consumers 
)

Get the maximal number of consumers that can be associated with the completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to query.
[out]max_num_consumersThe maximal number of consumers that can be associated with the context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_get_max_num_recv()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_get_max_num_recv ( const struct doca_comch_consumer_completion *  consumer_comp,
uint32_t *  max_num_recv 
)

Get the maximal number of receive operations across all consumers associated with the completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to query.
[out]max_num_recvThe maximal number of recv that can be associated with the context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_set_dpa_thread()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_dpa_thread ( struct doca_comch_consumer_completion *  consumer_comp,
struct doca_dpa_thread *  dpa_thread 
)

Set the DOCA DPA thread of the completion context.

This thread will receive notifications for completions.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context.
[in]dpa_threadThe DOCA dpa thread to be associated with the completion context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_set_imm_data_len()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_imm_data_len ( struct doca_comch_consumer_completion *  consumer_comp,
uint32_t  imm_data_len 
)

Set the length of immediate data supported by a consumer completion context.

The immediate data length of the consumer completion must be greater or equal to that of any associated consumer.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to modify.
[in]imm_data_lenLength of immediate data to configure in the consumer completion context.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_BAD_STATE - cc instance is already active.

◆ doca_comch_consumer_completion_set_max_num_consumers()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_max_num_consumers ( struct doca_comch_consumer_completion *  consumer_comp,
uint32_t  max_num_consumers 
)

Set the maximal number of consumers that can be associated with the completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to modify.
[in]max_num_consumersThe maximal number of consumers 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_consumer_completion_set_max_num_recv()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_set_max_num_recv ( struct doca_comch_consumer_completion *  consumer_comp,
uint32_t  max_num_recv 
)

Set the maximal number of receive operations across all consumers associated with the completion context.

Parameters
[in]consumer_compThe DOCA Comch consumer completion context to modify.
[in]max_num_recvThe maximal number of recv 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_consumer_completion_start()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_start ( struct doca_comch_consumer_completion *  consumer_comp)

Start DOCA Comch consumer completion context.

On start verifies and finalizes the completion context configuration.

The following is possible for started completion context:

  • Associating DOCA Comch consumers with the completion context.

The following is NOT possible while completion context is started:

  • Setting the properties of the completion context
Parameters
[in]consumer_compThe DOCA Comch consumer completion context to start.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_completion_stop()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_completion_stop ( struct doca_comch_consumer_completion *  consumer_comp)

Stop DOCA Comch consumer completion context.

On stop prevents execution of different operations and allows operations that were available before start. For details see doca_comch_consumer_completion_start(). Completion context can't be stopped while there are DOCA Comch consumers associated with it.

The following is possible for stopped completion context:

  • Setting the properties of the completion context

The following is NOT possible while completion context is stopped:

  • Associating DOCA Comch consumers with the completion context.
Parameters
[in]consumer_compThe DOCA Comch consumer completion context to stop.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_create()

DOCA_STABLE doca_error_t doca_comch_consumer_create ( struct doca_comch_connection *  comch_connection,
struct doca_mmap *  buf_mmap,
struct doca_comch_consumer **  consumer 
)

Create a DOCA Comch consumer instance.

Parameters
[in]comch_connectionAn established control channel connection to create consumer across.
[in]buf_mmapA registered mmap for the memory region the consumer allows buffer writes to.
[out]consumerPointer to pointer to be set to created doca_comch_consumer 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_consumer object or id.
  • DOCA_ERROR_BAD_STATE - comch_connection is not established.
  • DOCA_ERROR_NOT_PERMITTED - incompatible version of comch_connection.

◆ doca_comch_consumer_destroy()

DOCA_STABLE doca_error_t doca_comch_consumer_destroy ( struct doca_comch_consumer *  consumer)

Destroy a DOCA Comch consumer instance.

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

◆ doca_comch_consumer_get_dpa_handle()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_get_dpa_handle ( struct doca_comch_consumer *  consumer,
doca_dpa_dev_comch_consumer_t dpa_consumer 
)

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

Parameters
[in]consumerdoca_comch_consumer context to get the dpa handle from.
[out]dpa_consumerA 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_consumer_get_id()

DOCA_STABLE doca_error_t doca_comch_consumer_get_id ( const struct doca_comch_consumer *  consumer,
uint32_t *  id 
)

Get the id the doca_comch_consumer instance.

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

◆ doca_comch_consumer_get_imm_data_len()

DOCA_STABLE doca_error_t doca_comch_consumer_get_imm_data_len ( const struct doca_comch_consumer *  consumer,
uint32_t *  imm_data_len 
)

Get the length of immediate data supported by a consumer.

Parameters
[in]consumerConsumer to query.
[out]imm_data_lenLength of immediate data the consumer is configured to support.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_consumer_set_completion()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_set_completion ( struct doca_comch_consumer *  consumer,
struct doca_comch_consumer_completion *  consumer_comp,
uint32_t  user_data 
)

Associate consumer with DPA completion context.

This will allow the completion context to receive completions of this consumer on the DPA

Parameters
[in]consumerThe doca_comch_consumer instance. Must call doca_ctx_set_datapath_on_dpa() prior to this call
[in]consumer_compThe DOCA Comch consumer completion context to associate with consumer
[in]user_dataUser data that can be retrieved in DPA from completion elements returned by this consumer
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_comch_consumer_set_dev_max_num_recv()

DOCA_EXPERIMENTAL doca_error_t doca_comch_consumer_set_dev_max_num_recv ( struct doca_comch_consumer *  consumer,
uint32_t  dev_num_recv 
)

Set the maximal number of receive operations for a DPA consumer.

Parameters
[in]consumerThe doca_comch_consumer instance.
[in]dev_num_recvThe maximal number of recv 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_consumer_set_imm_data_len()

DOCA_STABLE doca_error_t doca_comch_consumer_set_imm_data_len ( struct doca_comch_consumer *  consumer,
uint32_t  imm_data_len 
)

Set the length of immediate data supported by a consumer.

Length must be less than or equal to that returned by doca_comch_consumer_cap_get_max_imm_data_len().

Parameters
[in]consumerConsumer to set length of.
[in]imm_data_lenLength of immediate data to configure in the consumer.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_BAD_STATE - cc instance is already active.

◆ doca_comch_consumer_task_post_recv_alloc_init()

DOCA_STABLE doca_error_t doca_comch_consumer_task_post_recv_alloc_init ( struct doca_comch_consumer *  consumer,
struct doca_buf *  buf,
struct doca_comch_consumer_task_post_recv **  task 
)

Allocate and initialize a doca_consumer post receive task.

Doca buffer should be located within the registered mmap associated with consumer instance. Completion callback will be triggered whenever the buffer has been populated by a consumer.

Parameters
[in]consumerThe doca_comch_consumer instance.
[in]bufDoca buffer available to be populated by producers.
[out]taskPointer to a doca_comch_consumer_task_post_recv 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_consumer_task_post_recv_as_task()

DOCA_STABLE struct doca_task* doca_comch_consumer_task_post_recv_as_task ( struct doca_comch_consumer_task_post_recv *  task)

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

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

◆ doca_comch_consumer_task_post_recv_get_buf()

DOCA_STABLE struct doca_buf* doca_comch_consumer_task_post_recv_get_buf ( const struct doca_comch_consumer_task_post_recv *  task)

Get the doca_buf from the doca_comch_consumer_task_post_recv instance.

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

◆ doca_comch_consumer_task_post_recv_get_imm_data()

DOCA_STABLE const uint8_t* doca_comch_consumer_task_post_recv_get_imm_data ( const struct doca_comch_consumer_task_post_recv *  task)

Get a pointer to any immediate data from the doca_comch_consumer_task_post_recv instance.

Immediate data will only be set on post recv completion. doca_comch_consumer_task_post_recv_get_imm_data_len() indicates the number of valid bits pointed to.

Parameters
[in]taskThe doca_comch_consumer_task_post_recv instance.
Returns
Pointer to immediate data or nullptr if none exists.

◆ doca_comch_consumer_task_post_recv_get_imm_data_len()

DOCA_STABLE uint32_t doca_comch_consumer_task_post_recv_get_imm_data_len ( const struct doca_comch_consumer_task_post_recv *  task)

Get the length of any immediate data from the doca_comch_consumer_task_post_recv instance.

Immediate data length will only be set on post recv completion. It indicates the valid number of bytes in the pointer return by doca_comch_consumer_task_post_recv_get_imm_data().

Parameters
[in]taskThe doca_comch_consumer_task_post_recv instance.
Returns
The immediate data length on post receive completion.

◆ doca_comch_consumer_task_post_recv_get_producer_id()

DOCA_STABLE uint32_t doca_comch_consumer_task_post_recv_get_producer_id ( const struct doca_comch_consumer_task_post_recv *  task)

Get the producer id from the doca_comch_consumer_task_post_recv instance.

Producer id will only be set on post recv completion and indicates the remote producer that has written data to the associated doca_buf.

Parameters
[in]taskThe doca_comch_consumer_task_post_recv instance.
Returns
Producer id upon success, 0 otherwise.

◆ doca_comch_consumer_task_post_recv_set_buf()

DOCA_STABLE void doca_comch_consumer_task_post_recv_set_buf ( struct doca_comch_consumer_task_post_recv *  task,
struct doca_buf *  buf 
)

Set the doca_buf in a doca_comch_consumer_task_post_recv instance.

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

◆ doca_comch_consumer_task_post_recv_set_conf()

DOCA_STABLE doca_error_t doca_comch_consumer_task_post_recv_set_conf ( struct doca_comch_consumer *  consumer,
doca_comch_consumer_task_post_recv_completion_cb_t  task_completion_cb,
doca_comch_consumer_task_post_recv_completion_cb_t  task_error_cb,
uint32_t  num_post_recv_tasks 
)

Configure the doca_comch_consumer post receive task callback and parameters.

Parameters
[in]consumerThe doca_comch_consumer instance.
[in]task_completion_cbPost receive task completion callback.
[in]task_error_cbPost receive task error callback.
[in]num_post_recv_tasksNumber of post_recv tasks a consumer can allocate. Must not exceed value returned by doca_comch_consumer_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 - consumer instance is already active.