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

Modules

 DOCA Comch Consumer
 
 DOCA Comch MsgQ
 
 DOCA Comch Producer
 

Typedefs

typedef void(* doca_comch_task_send_completion_cb_t) (struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
 
typedef void(* doca_comch_event_msg_recv_cb_t) (struct doca_comch_event_msg_recv *event, uint8_t *recv_buffer, uint32_t msg_len, struct doca_comch_connection *comch_connection)
 
typedef void(* doca_comch_event_connection_status_changed_cb_t) (struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_successful)
 
typedef void(* doca_comch_event_consumer_cb_t) (struct doca_comch_event_consumer *event, struct doca_comch_connection *comch_connection, uint32_t id)
 

Enumerations

enum  doca_comch_counter { DOCA_COMCH_COUNTER_SENT_MESSAGES = 1 , DOCA_COMCH_COUNTER_SENT_BYTES = 2 , DOCA_COMCH_COUNTER_RECV_MESSAGES = 3 , DOCA_COMCH_COUNTER_RECV_BYTES = 4 }
 

Functions

DOCA_STABLE doca_error_t doca_comch_connection_set_user_data (struct doca_comch_connection *connection, union doca_data user_data)
 
DOCA_STABLE union doca_data doca_comch_connection_get_user_data (const struct doca_comch_connection *connection)
 
DOCA_STABLE struct doca_comch_server * doca_comch_server_get_server_ctx (const struct doca_comch_connection *connection)
 
DOCA_STABLE struct doca_comch_client * doca_comch_client_get_client_ctx (const struct doca_comch_connection *connection)
 
DOCA_STABLE doca_error_t doca_comch_cap_get_max_name_len (const struct doca_devinfo *devinfo, uint32_t *max_name_len)
 
DOCA_STABLE doca_error_t doca_comch_cap_get_max_msg_size (const struct doca_devinfo *devinfo, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_cap_get_max_recv_queue_size (const struct doca_devinfo *devinfo, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_cap_get_max_clients (const struct doca_devinfo *devinfo, uint32_t *num_clients)
 
DOCA_STABLE doca_error_t doca_comch_server_create (struct doca_dev *dev, struct doca_dev_rep *repr, const char *name, struct doca_comch_server **comch_server)
 
DOCA_STABLE doca_error_t doca_comch_server_destroy (struct doca_comch_server *comch_server)
 
DOCA_STABLE doca_error_t doca_comch_cap_server_is_supported (const struct doca_devinfo *devinfo)
 
DOCA_STABLE doca_error_t doca_comch_server_set_max_msg_size (struct doca_comch_server *comch_server, uint32_t size)
 
DOCA_STABLE doca_error_t doca_comch_server_get_max_msg_size (const struct doca_comch_server *comch_server, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_server_set_recv_queue_size (struct doca_comch_server *comch_server, uint32_t size)
 
DOCA_STABLE doca_error_t doca_comch_server_get_recv_queue_size (const struct doca_comch_server *comch_server, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_server_get_device (const struct doca_comch_server *comch_server, struct doca_dev **dev)
 
DOCA_STABLE doca_error_t doca_comch_server_get_device_rep (const struct doca_comch_server *comch_server, struct doca_dev_rep **rep)
 
DOCA_STABLE struct doca_ctx * doca_comch_server_as_ctx (struct doca_comch_server *comch_server)
 
DOCA_STABLE doca_error_t doca_comch_server_disconnect (struct doca_comch_server *comch_server, struct doca_comch_connection *connection)
 
DOCA_STABLE doca_error_t doca_comch_client_create (struct doca_dev *dev, const char *name, struct doca_comch_client **comch_client)
 
DOCA_STABLE doca_error_t doca_comch_client_destroy (struct doca_comch_client *comch_client)
 
DOCA_STABLE doca_error_t doca_comch_cap_client_is_supported (const struct doca_devinfo *devinfo)
 
DOCA_STABLE doca_error_t doca_comch_client_set_max_msg_size (struct doca_comch_client *comch_client, uint32_t size)
 
DOCA_STABLE doca_error_t doca_comch_client_get_max_msg_size (const struct doca_comch_client *comch_client, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_client_set_recv_queue_size (struct doca_comch_client *comch_client, uint32_t size)
 
DOCA_STABLE doca_error_t doca_comch_client_get_recv_queue_size (const struct doca_comch_client *comch_client, uint32_t *size)
 
DOCA_STABLE doca_error_t doca_comch_client_get_device (const struct doca_comch_client *comch_client, struct doca_dev **dev)
 
DOCA_STABLE struct doca_ctx * doca_comch_client_as_ctx (struct doca_comch_client *comch_client)
 
DOCA_STABLE doca_error_t doca_comch_client_get_connection (const struct doca_comch_client *comch_client, struct doca_comch_connection **connection)
 
DOCA_STABLE doca_error_t doca_comch_cap_get_max_send_tasks (const struct doca_devinfo *devinfo, uint32_t *max_send_tasks)
 
DOCA_STABLE doca_error_t doca_comch_server_task_send_set_conf (struct doca_comch_server *comch_server, doca_comch_task_send_completion_cb_t task_completion_cb, doca_comch_task_send_completion_cb_t task_error_cb, uint32_t num_send_tasks)
 
DOCA_STABLE doca_error_t doca_comch_client_task_send_set_conf (struct doca_comch_client *comch_client, doca_comch_task_send_completion_cb_t task_completion_cb, doca_comch_task_send_completion_cb_t task_error_cb, uint32_t num_send_tasks)
 
DOCA_STABLE doca_error_t doca_comch_server_task_send_alloc_init (struct doca_comch_server *comch_server, struct doca_comch_connection *peer, const void *msg, uint32_t len, struct doca_comch_task_send **task)
 
DOCA_STABLE doca_error_t doca_comch_client_task_send_alloc_init (struct doca_comch_client *comch_client, struct doca_comch_connection *peer, const void *msg, uint32_t len, struct doca_comch_task_send **task)
 
DOCA_STABLE struct doca_task * doca_comch_task_send_as_task (struct doca_comch_task_send *task)
 
DOCA_STABLE doca_error_t doca_comch_server_event_msg_recv_register (struct doca_comch_server *comch_server, doca_comch_event_msg_recv_cb_t recv_event_cb)
 Configure the doca_comch recv event callback for server context. More...
 
DOCA_STABLE doca_error_t doca_comch_client_event_msg_recv_register (struct doca_comch_client *comch_client, doca_comch_event_msg_recv_cb_t recv_event_cb)
 Configure the doca_comch recv event callback for client context. More...
 
DOCA_STABLE doca_error_t doca_comch_server_event_connection_status_changed_register (struct doca_comch_server *comch_server, doca_comch_event_connection_status_changed_cb_t connect_event_cb, doca_comch_event_connection_status_changed_cb_t disconnect_event_cb)
 Configure the doca_comch recv event callback for server context. More...
 
DOCA_STABLE doca_error_t doca_comch_connection_update_info (struct doca_comch_connection *comch_connection)
 update statistics for given comch_connection More...
 
DOCA_STABLE doca_error_t doca_comch_connection_get_counter (const struct doca_comch_connection *comch_connection, enum doca_comch_counter counter_type, uint64_t *counter_value)
 get statistics counter for a given comch_connection More...
 
DOCA_STABLE doca_error_t doca_comch_server_event_consumer_register (struct doca_comch_server *comch_server, doca_comch_event_consumer_cb_t new_consumer_event_cb, doca_comch_event_consumer_cb_t expired_consumer_event_cb)
 Configure the doca_comch callback for for receiving consumer events on server context. More...
 
DOCA_STABLE doca_error_t doca_comch_client_event_consumer_register (struct doca_comch_client *comch_client, doca_comch_event_consumer_cb_t new_consumer_event_cb, doca_comch_event_consumer_cb_t expired_consumer_event_cb)
 Configure the doca_comch callback for for receiving consumer events on client context. More...
 

Detailed Description

DOCA Communication Channel library let you set a direct communication channel between the host and the DPU. The channel is run over RoCE/IB protocol and is not part of the TCP/IP stack. Please follow the programmer guide for usage instructions.

Typedef Documentation

◆ doca_comch_event_connection_status_changed_cb_t

typedef void(* doca_comch_event_connection_status_changed_cb_t) (struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_successful)

Function executed on a doca_comch connection event.

Parameters
[in]eventDoca_comch connection event that has triggered.
[in]comch_connectionPointer to the peer which triggered the connection event.
[in]change_successful1 if the action (connect/disconnect) was successful, 0 otherwise.

The implementation can assume these values are not NULL.

Definition at line 778 of file doca_comch.h.

◆ doca_comch_event_consumer_cb_t

typedef void(* doca_comch_event_consumer_cb_t) (struct doca_comch_event_consumer *event, struct doca_comch_connection *comch_connection, uint32_t id)

Function executed on a doca_comch consumer event.

Parameters
[in]eventDoca_comch consumer event that has triggered.
[in]comch_connectionPointer to the comch_connection which triggered that has generated the consumer event.
[in]idThe ID of the newly created or destroyed consumer.

The implementation can assume these values are not NULL.

Definition at line 874 of file doca_comch.h.

◆ doca_comch_event_msg_recv_cb_t

typedef void(* doca_comch_event_msg_recv_cb_t) (struct doca_comch_event_msg_recv *event, uint8_t *recv_buffer, uint32_t msg_len, struct doca_comch_connection *comch_connection)

Function executed on a doca_comch receive message event.

Parameters
[in]eventDoca_comch recv message event that has triggered.
[in]recv_bufferPointer to the message data associated with the event.
[in]msg_lenLength of the message data associated with the event.
[in]comch_connectionPointer to the connection instance that generated the message event.

The implementation can assume these values are not NULL.

Definition at line 718 of file doca_comch.h.

◆ doca_comch_task_send_completion_cb_t

typedef void(* doca_comch_task_send_completion_cb_t) (struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)

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

Parameters
[in]taskDOCA Comch 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 563 of file doca_comch.h.

Enumeration Type Documentation

◆ doca_comch_counter

Available counters for connection statistics query

Enumerator
DOCA_COMCH_COUNTER_SENT_MESSAGES 
DOCA_COMCH_COUNTER_SENT_BYTES 
DOCA_COMCH_COUNTER_RECV_MESSAGES 
DOCA_COMCH_COUNTER_RECV_BYTES 

Definition at line 809 of file doca_comch.h.

Function Documentation

◆ doca_comch_cap_client_is_supported()

DOCA_STABLE doca_error_t doca_comch_cap_client_is_supported ( const struct doca_devinfo *  devinfo)

Check if given device is capable of running a comm channel client.

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

◆ doca_comch_cap_get_max_clients()

DOCA_STABLE doca_error_t doca_comch_cap_get_max_clients ( const struct doca_devinfo *  devinfo,
uint32_t *  num_clients 
)

Get the maximal number of clients that can be connected to a single doca_comch server.

Parameters
[in]devinfodevinfo to query the capability for.
[out]num_clientsThe number of clients that can be connected to a single doca_comch server.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_cap_get_max_msg_size()

DOCA_STABLE doca_error_t doca_comch_cap_get_max_msg_size ( const struct doca_devinfo *  devinfo,
uint32_t *  size 
)

Get the maximum message size that can be used on any comm channel instance.

Parameters
[in]devinfodevinfo to query the capability for.
[out]sizeThe maximum size of a message available on any cc instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_cap_get_max_name_len()

DOCA_STABLE doca_error_t doca_comch_cap_get_max_name_len ( const struct doca_devinfo *  devinfo,
uint32_t *  max_name_len 
)

Get the maximum name length that can be used in a cc instance.

Parameters
[in]devinfodevinfo to query the capability for.
[out]max_name_lenThe cc max name length, including the terminating null byte ('\0').
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_cap_get_max_recv_queue_size()

DOCA_STABLE doca_error_t doca_comch_cap_get_max_recv_queue_size ( const struct doca_devinfo *  devinfo,
uint32_t *  size 
)

Get the maximal recv queue size that can be used on any comm channel instance.

Parameters
[in]devinfodevinfo to query the capability for.
[out]sizeThe maximal recv queue size supported on any cc instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_cap_get_max_send_tasks()

DOCA_STABLE doca_error_t doca_comch_cap_get_max_send_tasks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_send_tasks 
)

Get the maximal send tasks num that can be used on any cc instance.

Parameters
[in]devinfodevinfo to query the capability for.
[out]max_send_tasksThe maximal supported number of send tasks for any cc instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_cap_server_is_supported()

DOCA_STABLE doca_error_t doca_comch_cap_server_is_supported ( const struct doca_devinfo *  devinfo)

Check if given device is capable of running a comm channel server.

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

◆ doca_comch_client_as_ctx()

DOCA_STABLE struct doca_ctx* doca_comch_client_as_ctx ( struct doca_comch_client *  comch_client)

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

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

◆ doca_comch_client_create()

DOCA_STABLE doca_error_t doca_comch_client_create ( struct doca_dev *  dev,
const char *  name,
struct doca_comch_client **  comch_client 
)

Create a DOCA Comch client instance.

Parameters
[in]devDevice to use in DOCA Comch client instance.
[in]nameIdentifier for the server the client will connect to. Max length, including terminating '\0', is obtained by doca_comch_cap_get_max_name_len().
[out]comch_clientPointer to pointer to be set to created doca_comch client instance.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - one or more of the arguments is null.
  • DOCA_ERROR_NO_MEMORY - failed to alloc doca_comch.
  • DOCA_ERROR_INITIALIZATION - failed to initialize a mutex.

◆ doca_comch_client_destroy()

DOCA_STABLE doca_error_t doca_comch_client_destroy ( struct doca_comch_client *  comch_client)

Destroy a DOCA Comch client instance.

Parameters
[in]comch_clientDOCA Comch client instance to be destroyed.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - cc argument is a NULL pointer.
  • DOCA_ERROR_IN_USE - Unable to gain exclusive access to the cc instance.

◆ doca_comch_client_event_consumer_register()

DOCA_STABLE doca_error_t doca_comch_client_event_consumer_register ( struct doca_comch_client *  comch_client,
doca_comch_event_consumer_cb_t  new_consumer_event_cb,
doca_comch_event_consumer_cb_t  expired_consumer_event_cb 
)

Configure the doca_comch callback for for receiving consumer events on client context.

Parameters
[in]comch_clientPointer to doca_comch_client instance.
[in]new_consumer_event_cbConsumer event callback on creation of a new consumer.
[in]expired_consumer_event_cbConsumer event callback on when a consumer has expired.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case one of the arguments is NULL.
  • DOCA_ERROR_BAD_STATE - doca_comch_servcie context state is not idle.

◆ doca_comch_client_event_msg_recv_register()

DOCA_STABLE doca_error_t doca_comch_client_event_msg_recv_register ( struct doca_comch_client *  comch_client,
doca_comch_event_msg_recv_cb_t  recv_event_cb 
)

Configure the doca_comch recv event callback for client context.

Parameters
[in]comch_clientPointer to doca_comch_client instance.
[in]recv_event_cbRecv event callback.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case one of the arguments is NULL.
  • DOCA_ERROR_BAD_STATE - doca_comch context state is not idle.

◆ doca_comch_client_get_client_ctx()

DOCA_STABLE struct doca_comch_client* doca_comch_client_get_client_ctx ( const struct doca_comch_connection *  connection)

Get the doca_comch_client context from a given connection.

Parameters
[in]connectionDOCA Comch connection instance.
Returns
doca_comch_client object on success. NULL if the connection is related to a server context.

◆ doca_comch_client_get_connection()

DOCA_STABLE doca_error_t doca_comch_client_get_connection ( const struct doca_comch_client *  comch_client,
struct doca_comch_connection **  connection 
)

Get the connection object associated with the client ctx. Can only be called after starting the ctx.

Parameters
[in]comch_clientDOCA Comch client instance.
[out]connectionThe connection object associated with the client.
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 not started.

◆ doca_comch_client_get_device()

DOCA_STABLE doca_error_t doca_comch_client_get_device ( const struct doca_comch_client *  comch_client,
struct doca_dev **  dev 
)

Get the doca device property of the associated doca_comch instance.

Parameters
[in]comch_clientDOCA Comch client instance.
[out]devCurrent device used in the doca_comch instance.
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_client_get_max_msg_size()

DOCA_STABLE doca_error_t doca_comch_client_get_max_msg_size ( const struct doca_comch_client *  comch_client,
uint32_t *  size 
)

Get the maximum message size that can be sent on the comm channel instance.

Parameters
[in]comch_clientDOCA Comch client instance.
[out]sizeThe maximum size of a message for the instance.
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_client_get_recv_queue_size()

DOCA_STABLE doca_error_t doca_comch_client_get_recv_queue_size ( const struct doca_comch_client *  comch_client,
uint32_t *  size 
)

Get the recv queue size property set on the doca_comch instance.

Parameters
[in]comch_clientDOCA Comch client instance.
[out]sizeThe recv queue size for the instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_client_set_max_msg_size()

DOCA_STABLE doca_error_t doca_comch_client_set_max_msg_size ( struct doca_comch_client *  comch_client,
uint32_t  size 
)

Set the maximum message size property for the doca_comch instance. If not called, a default value will be used and can be queried using doca_comch_client_get_max_msg_size().

Parameters
[in]comch_clientDOCA Comch client instance.
[in]sizeThe maximum size of a message to set for the instance. Can be queried with doca_comch_cap_get_max_msg_size().
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_client_set_recv_queue_size()

DOCA_STABLE doca_error_t doca_comch_client_set_recv_queue_size ( struct doca_comch_client *  comch_client,
uint32_t  size 
)

Set the recv queue size property for the doca_comch instance. If not called, a default value will be used and can be queried using doca_comch_client_get_recv_queue_size().

Parameters
[in]comch_clientDOCA Comch client instance.
[in]sizeThe recv queue size to set for the instance. Limit can be queried with doca_comch_cap_get_max_recv_queue_size().
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_client_task_send_alloc_init()

DOCA_STABLE doca_error_t doca_comch_client_task_send_alloc_init ( struct doca_comch_client *  comch_client,
struct doca_comch_connection *  peer,
const void *  msg,
uint32_t  len,
struct doca_comch_task_send **  task 
)

Allocate and initialize a doca_comch_client send task.

Parameters
[in]comch_clientThe doca_comch_client instance.
[in]peerConnected endpoint to send the message to.
[in]msgMessage or data to sent to associated peer.
[in]lenLength of the message to send.
[out]taskPointer to a doca_comch_send_task 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_client_task_send_set_conf()

DOCA_STABLE doca_error_t doca_comch_client_task_send_set_conf ( struct doca_comch_client *  comch_client,
doca_comch_task_send_completion_cb_t  task_completion_cb,
doca_comch_task_send_completion_cb_t  task_error_cb,
uint32_t  num_send_tasks 
)

Configure the doca_comch_client send task callback and parameters.

Parameters
[in]comch_clientThe doca_comch_client instance.
[in]task_completion_cbSend task completion callback.
[in]task_error_cbSend task error callback.
[in]num_send_tasksNumber of send tasks to create.
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_connection_get_counter()

DOCA_STABLE doca_error_t doca_comch_connection_get_counter ( const struct doca_comch_connection *  comch_connection,
enum doca_comch_counter  counter_type,
uint64_t *  counter_value 
)

get statistics counter for a given comch_connection

This function will return statistics for a given comch_connection, updated to the last time doca_comch_connection_update_info() was called.

Parameters
[in]comch_connectionPointer to comch_connection to query statistics for.
[in]counter_typeWhich statistics counter should be queried.
[out]counter_valueWill contain the value for the counter on the given comch_connection.
Returns
DOCA_SUCCESS on success. DOCA_ERROR_INVALID_VALUE if any of the arguments are NULL or if the counter is not valid.

◆ doca_comch_connection_get_user_data()

DOCA_STABLE union doca_data doca_comch_connection_get_user_data ( const struct doca_comch_connection *  connection)

Get the user data from a given connection.

Parameters
[in]connectionDOCA Comch connection instance.
Returns
User data for the given connection.

◆ doca_comch_connection_set_user_data()

DOCA_STABLE doca_error_t doca_comch_connection_set_user_data ( struct doca_comch_connection *  connection,
union doca_data  user_data 
)

Set the user data for a given connection.

Parameters
[in]connectionDOCA Comch connection instance.
[in]user_dataUser data for the given connection.
Returns
DOCA_SUCCESS on success.

◆ doca_comch_connection_update_info()

DOCA_STABLE doca_error_t doca_comch_connection_update_info ( struct doca_comch_connection *  comch_connection)

update statistics for given comch_connection

Should be used before calling to any connection information function to update the saved statistics.

Parameters
[in]comch_connectionPointer to comch_connection to update statistics in.
Returns
DOCA_SUCCESS on success. DOCA_ERROR_INVALID_VALUE if comch_connection is NULL. DOCA_ERROR_CONNECTION_INPROGRESS if connection is not yet established. DOCA_ERROR_CONNECTION_ABORTED if the connection failed.

◆ doca_comch_server_as_ctx()

DOCA_STABLE struct doca_ctx* doca_comch_server_as_ctx ( struct doca_comch_server *  comch_server)

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

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

◆ doca_comch_server_create()

DOCA_STABLE doca_error_t doca_comch_server_create ( struct doca_dev *  dev,
struct doca_dev_rep *  repr,
const char *  name,
struct doca_comch_server **  comch_server 
)

Create a DOCA Comch server instance.

Parameters
[in]devDevice to use in DOCA Comch server instance.
[in]reprRepresentor device to use in CC server instance.
[in]nameIdentifier for server associated with instance. Must be NULL terminated. Max length, including terminating '\0', is obtained by doca_comch_cap_get_max_name_len().
[out]comch_serverPointer to pointer to be set to created doca_comch server instance.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - one or more of the arguments is null.
  • DOCA_ERROR_NO_MEMORY - failed to alloc doca_comch.
  • DOCA_ERROR_INITIALIZATION - failed to initialize a mutex.

◆ doca_comch_server_destroy()

DOCA_STABLE doca_error_t doca_comch_server_destroy ( struct doca_comch_server *  comch_server)

Destroy a DOCA Comch server instance.

Parameters
[in]comch_serverDOCA Comch server instance to be destroyed.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - cc argument is a NULL pointer.
  • DOCA_ERROR_IN_USE - Unable to gain exclusive access to the cc instance.

◆ doca_comch_server_disconnect()

DOCA_STABLE doca_error_t doca_comch_server_disconnect ( struct doca_comch_server *  comch_server,
struct doca_comch_connection *  connection 
)

Disconnect specific connection on doca_comch_server.

This function will notify the peer of the disconnection.

Parameters
[in]comch_serverDOCA Comch server instance.
[out]connectionConnection representing the remote peer to disconnect.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_IN_USE - if there are active consumers/producers for the connection.
  • DOCA_ERROR_AGAIN - cannot send disconnection message due to full queue. Requires the app to call disconnect again later.

◆ doca_comch_server_event_connection_status_changed_register()

DOCA_STABLE doca_error_t doca_comch_server_event_connection_status_changed_register ( struct doca_comch_server *  comch_server,
doca_comch_event_connection_status_changed_cb_t  connect_event_cb,
doca_comch_event_connection_status_changed_cb_t  disconnect_event_cb 
)

Configure the doca_comch recv event callback for server context.

Parameters
[in]comch_serverPointer to doca_comch_server instance.
[in]connect_event_cbCallback for connect event.
[in]disconnect_event_cbCallback for disconnect event.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case one of the arguments is NULL.
  • DOCA_ERROR_BAD_STATE - doca_comch context state is not idle.

◆ doca_comch_server_event_consumer_register()

DOCA_STABLE doca_error_t doca_comch_server_event_consumer_register ( struct doca_comch_server *  comch_server,
doca_comch_event_consumer_cb_t  new_consumer_event_cb,
doca_comch_event_consumer_cb_t  expired_consumer_event_cb 
)

Configure the doca_comch callback for for receiving consumer events on server context.

Parameters
[in]comch_serverPointer to doca_comch_server instance.
[in]new_consumer_event_cbConsumer event callback on creation of a new consumer.
[in]expired_consumer_event_cbConsumer event callback on when a consumer has expired.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case one of the arguments is NULL.
  • DOCA_ERROR_BAD_STATE - doca_comch_servcie context state is not idle.

◆ doca_comch_server_event_msg_recv_register()

DOCA_STABLE doca_error_t doca_comch_server_event_msg_recv_register ( struct doca_comch_server *  comch_server,
doca_comch_event_msg_recv_cb_t  recv_event_cb 
)

Configure the doca_comch recv event callback for server context.

Parameters
[in]comch_serverPointer to doca_comch_server instance.
[in]recv_event_cbRecv event callback.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case one of the arguments is NULL.
  • DOCA_ERROR_BAD_STATE - doca_comch context state is not idle.

◆ doca_comch_server_get_device()

DOCA_STABLE doca_error_t doca_comch_server_get_device ( const struct doca_comch_server *  comch_server,
struct doca_dev **  dev 
)

Get the doca device property of the associated doca_comch instance.

Parameters
[in]comch_serverDOCA Comch server instance.
[out]devCurrent device used in the doca_comch instance.
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_server_get_device_rep()

DOCA_STABLE doca_error_t doca_comch_server_get_device_rep ( const struct doca_comch_server *  comch_server,
struct doca_dev_rep **  rep 
)

Get the device representor property of the associated doca_comch server instance.

Parameters
[in]comch_serverDOCA Comch server instance.
[out]repCurrent device representor used in the doca_comch server instance.
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_server_get_max_msg_size()

DOCA_STABLE doca_error_t doca_comch_server_get_max_msg_size ( const struct doca_comch_server *  comch_server,
uint32_t *  size 
)

Get the maximum message size that can be sent on the comm channel instance.

Parameters
[in]comch_serverDOCA Comch server instance.
[out]sizeThe maximum size of a message for the instance.
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_server_get_recv_queue_size()

DOCA_STABLE doca_error_t doca_comch_server_get_recv_queue_size ( const struct doca_comch_server *  comch_server,
uint32_t *  size 
)

Get the recv queue size property set on the doca_comch instance.

Parameters
[in]comch_serverDOCA Comch server instance.
[out]sizeThe recv queue size set for the instance.
Returns
DOCA_SUCCESS on success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.

◆ doca_comch_server_get_server_ctx()

DOCA_STABLE struct doca_comch_server* doca_comch_server_get_server_ctx ( const struct doca_comch_connection *  connection)

Get the doca_comch_server context from a given connection.

Parameters
[in]connectionDOCA Comch connection instance.
Returns
doca_comch_server object on success. NULL if the connection is related to a client context.

◆ doca_comch_server_set_max_msg_size()

DOCA_STABLE doca_error_t doca_comch_server_set_max_msg_size ( struct doca_comch_server *  comch_server,
uint32_t  size 
)

Set the maximum message size property for the doca_comch instance. If not called, a default value will be used and can be queried using doca_comch_server_get_max_msg_size().

Parameters
[in]comch_serverDOCA Comch server instance.
[in]sizeThe maximum size of a message to set for the instance. Can be queried with doca_comch_cap_get_max_msg_size().
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_server_set_recv_queue_size()

DOCA_STABLE doca_error_t doca_comch_server_set_recv_queue_size ( struct doca_comch_server *  comch_server,
uint32_t  size 
)

Set the recv queue size property for the doca_comch instance. If not called, a default value will be used and can be queried using doca_comch_server_get_recv_queue_size().

Parameters
[in]comch_serverDOCA Comch server instance.
[in]sizeThe recv queue size set for the instance. Can be queried with doca_comch_cap_get_max_recv_queue_size().
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_server_task_send_alloc_init()

DOCA_STABLE doca_error_t doca_comch_server_task_send_alloc_init ( struct doca_comch_server *  comch_server,
struct doca_comch_connection *  peer,
const void *  msg,
uint32_t  len,
struct doca_comch_task_send **  task 
)

Allocate and initialize a doca_comch_server send task.

Parameters
[in]comch_serverThe doca_comch_server instance.
[in]peerConnected endpoint to send the message to.
[in]msgMessage or data to sent to associated peer.
[in]lenLength of the message to send.
[out]taskPointer to a doca_comch_send_task 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_server_task_send_set_conf()

DOCA_STABLE doca_error_t doca_comch_server_task_send_set_conf ( struct doca_comch_server *  comch_server,
doca_comch_task_send_completion_cb_t  task_completion_cb,
doca_comch_task_send_completion_cb_t  task_error_cb,
uint32_t  num_send_tasks 
)

Configure the doca_comch_server send task callback and parameters.

Parameters
[in]comch_serverThe doca_comch_server instance.
[in]task_completion_cbSend task completion callback.
[in]task_error_cbSend task error callback.
[in]num_send_tasksNumber of send tasks to create.
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_task_send_as_task()

DOCA_STABLE struct doca_task* doca_comch_task_send_as_task ( struct doca_comch_task_send *  task)

Convert a doca_comch_send_task task to doca_task.

Parameters
[in]taskDoca_comch_send_task task to convert.
Returns
Non NULL upon success, NULL otherwise.