NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
comch_utils.c File Reference
#include <doca_ctx.h>
#include <doca_error.h>
#include <doca_log.h>
#include <doca_pe.h>
#include <samples/common.h>
#include <time.h>
#include "comch_utils.h"
Include dependency graph for comch_utils.c:

Go to the source code of this file.

Data Structures

struct  comch_cfg
 

Macros

#define COMCH_NUM_TASKS   1024 /* Tasks for sending comch messages */
 
#define SLEEP_IN_NANOS   (10 * 1000)
 

Functions

 DOCA_LOG_REGISTER (COMCH_UTILS)
 
static void comch_send_completion (struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
 
static void comch_send_completion_err (struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
 
static void server_connection_cb (struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_successful)
 
static void server_disconnection_cb (struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_successful)
 
static struct comch_cfgget_comch_cfg_from_connection (struct doca_comch_connection *connection)
 
doca_error_t comch_utils_send (struct doca_comch_connection *connection, const void *msg, uint32_t len)
 
void * comch_utils_get_user_data (struct doca_comch_connection *connection)
 
doca_error_t comch_utils_progress_connection (struct doca_comch_connection *connection)
 
struct doca_comch_connection * comch_util_get_connection (struct comch_cfg *comch_cfg)
 
uint32_t comch_utils_get_max_buffer_size (struct comch_cfg *comch_cfg)
 
doca_error_t comch_utils_fast_path_init (const char *server_name, const char *pci_addr, const char *rep_pci_addr, void *user_data, doca_comch_event_msg_recv_cb_t client_recv_event_cb, doca_comch_event_msg_recv_cb_t server_recv_event_cb, doca_comch_event_consumer_cb_t new_consumer_event_cb, doca_comch_event_consumer_cb_t expired_consumer_event_cb, struct comch_cfg **comch_cfg)
 
doca_error_t comch_utils_init (const char *server_name, const char *pci_addr, const char *rep_pci_addr, void *user_data, doca_comch_event_msg_recv_cb_t client_recv_event_cb, doca_comch_event_msg_recv_cb_t server_recv_event_cb, struct comch_cfg **comch_cfg)
 
doca_error_t comch_utils_destroy (struct comch_cfg *comch_cfg)
 

Macro Definition Documentation

◆ COMCH_NUM_TASKS

#define COMCH_NUM_TASKS   1024 /* Tasks for sending comch messages */

Definition at line 39 of file comch_utils.c.

◆ SLEEP_IN_NANOS

#define SLEEP_IN_NANOS   (10 * 1000)

Definition at line 40 of file comch_utils.c.

Function Documentation

◆ comch_send_completion()

static void comch_send_completion ( struct doca_comch_task_send *  task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)
static

Definition at line 66 of file comch_utils.c.

◆ comch_send_completion_err()

static void comch_send_completion_err ( struct doca_comch_task_send *  task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)
static

Definition at line 86 of file comch_utils.c.

◆ comch_util_get_connection()

struct doca_comch_connection* comch_util_get_connection ( struct comch_cfg comch_cfg)

Definition at line 276 of file comch_utils.c.

◆ comch_utils_destroy()

doca_error_t comch_utils_destroy ( struct comch_cfg comch_cfg)

Definition at line 592 of file comch_utils.c.

◆ comch_utils_fast_path_init()

doca_error_t comch_utils_fast_path_init ( const char *  server_name,
const char *  pci_addr,
const char *  rep_pci_addr,
void *  user_data,
doca_comch_event_msg_recv_cb_t  client_recv_event_cb,
doca_comch_event_msg_recv_cb_t  server_recv_event_cb,
doca_comch_event_consumer_cb_t  new_consumer_event_cb,
doca_comch_event_consumer_cb_t  expired_consumer_event_cb,
struct comch_cfg **  comch_cfg 
)

Definition at line 296 of file comch_utils.c.

◆ comch_utils_get_max_buffer_size()

uint32_t comch_utils_get_max_buffer_size ( struct comch_cfg comch_cfg)

Definition at line 286 of file comch_utils.c.

◆ comch_utils_get_user_data()

void* comch_utils_get_user_data ( struct doca_comch_connection *  connection)

Definition at line 254 of file comch_utils.c.

◆ comch_utils_init()

doca_error_t comch_utils_init ( const char *  server_name,
const char *  pci_addr,
const char *  rep_pci_addr,
void *  user_data,
doca_comch_event_msg_recv_cb_t  client_recv_event_cb,
doca_comch_event_msg_recv_cb_t  server_recv_event_cb,
struct comch_cfg **  comch_cfg 
)

Definition at line 573 of file comch_utils.c.

◆ comch_utils_progress_connection()

doca_error_t comch_utils_progress_connection ( struct doca_comch_connection *  connection)

Definition at line 264 of file comch_utils.c.

◆ comch_utils_send()

doca_error_t comch_utils_send ( struct doca_comch_connection *  connection,
const void *  msg,
uint32_t  len 
)

Definition at line 212 of file comch_utils.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( COMCH_UTILS  )

◆ get_comch_cfg_from_connection()

static struct comch_cfg* get_comch_cfg_from_connection ( struct doca_comch_connection *  connection)
inlinestatic

Definition at line 193 of file comch_utils.c.

◆ server_connection_cb()

static void server_connection_cb ( struct doca_comch_event_connection_status_changed *  event,
struct doca_comch_connection *  comch_connection,
uint8_t  change_successful 
)
static

Definition at line 104 of file comch_utils.c.

◆ server_disconnection_cb()

static void server_disconnection_cb ( struct doca_comch_event_connection_status_changed *  event,
struct doca_comch_connection *  comch_connection,
uint8_t  change_successful 
)
static

Definition at line 158 of file comch_utils.c.