115 uint8_t *recv_buffer,
117 struct doca_comch_connection *comch_connection)
120 struct doca_comch_client *comch_client;
126 DOCA_LOG_INFO(
"Message received: '%.*s'", (
int)msg_len, recv_buffer);
160 struct doca_comch_task_send *task;
191 struct doca_ctx *
ctx,
200 switch (next_state) {
210 DOCA_LOG_INFO(
"CC client context entered into starting state. Waiting for connection establishment");
218 DOCA_LOG_ERR(
"Failed to get connection from cc client with error = %s",
222 DOCA_LOG_INFO(
"CC client context is running. Get a connection from server");
230 DOCA_LOG_INFO(
"CC client context entered into stopping state. Waiting for connection termination");
245 struct doca_comch_connection *comch_connection,
249 struct doca_comch_client *comch_client;
266 DOCA_LOG_INFO(
"Got a new remote consumer with ID = [%d]",
id);
277 struct doca_comch_connection *comch_connection,
282 (void)comch_connection;
294 struct timespec ts = {
299 if (sample_objects ==
NULL)
308 DOCA_LOG_ERR(
"Failed to submit send task with error = %s",
324 sample_objects->
pe =
NULL;
345 const char *dev_pci_addr,
354 .data_path_mode =
true,
357 .ctx_user_data = sample_objects,
359 struct timespec ts = {
369 DOCA_LOG_ERR(
"Failed to open Comm Channel DOCA device based on PCI address");
378 &(sample_objects->
client),
379 &(sample_objects->
pe));
403 DOCA_LOG_ERR(
"Failed to submit send task with error = %s",
doca_error_t init_comch_ctrl_path_client(const char *server_name, struct doca_dev *hw_dev, struct comch_ctrl_path_client_cb_config *cb_cfg, struct doca_comch_client **client, struct doca_pe **pe)
void clean_comch_ctrl_path_client(struct doca_comch_client *client, struct doca_pe *pe)
DOCA_LOG_REGISTER(COMCH_DATA_PATH_HIGH_SPEED_CLIENT)
static void client_state_changed_callback(const union doca_data user_data, struct doca_ctx *ctx, enum doca_ctx_states prev_state, enum doca_ctx_states next_state)
static void new_consumer_callback(struct doca_comch_event_consumer *event, struct doca_comch_connection *comch_connection, uint32_t id)
void expired_consumer_callback(struct doca_comch_event_consumer *event, struct doca_comch_connection *comch_connection, uint32_t id)
static void client_send_task_completion_err_callback(struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
static void clean_comch_data_path_client_objects(struct comch_data_path_client_objects *sample_objects)
static doca_error_t client_send_msg(struct comch_data_path_client_objects *sample_objects, const char *msg, size_t len)
static void client_message_recv_callback(struct doca_comch_event_msg_recv *event, uint8_t *recv_buffer, uint32_t msg_len, struct doca_comch_connection *comch_connection)
static void client_send_task_completion_callback(struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
doca_error_t start_comch_data_path_client_sample(const char *server_name, const char *dev_pci_addr, const char *text)
static doca_error_t init_comch_data_path_client_objects(const char *server_name, const char *dev_pci_addr, const char *text, struct comch_data_path_client_objects *sample_objects)
doca_error_t comch_data_path_send_msg(struct comch_data_path_objects *data_path)
doca_error_t comch_data_path_recv_msg(struct comch_data_path_objects *data_path)
#define STR_STOP_DATA_PATH_TEST
#define INVALID_CONSUMER_ID
#define STR_START_DATA_PATH_TEST
static doca_error_t open_doca_device_with_pci(const char *pcie_value, struct doca_dev **retval)
DOCA_STABLE doca_error_t doca_comch_client_get_connection(const struct doca_comch_client *comch_client, struct doca_comch_connection **connection)
DOCA_STABLE struct doca_ctx * doca_comch_client_as_ctx(struct doca_comch_client *comch_client)
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 struct doca_comch_client * doca_comch_client_get_client_ctx(const struct doca_comch_connection *connection)
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_STABLE doca_error_t doca_ctx_get_user_data(const struct doca_ctx *ctx, union doca_data *user_data)
get user data from context
@ DOCA_CTX_STATE_STARTING
@ DOCA_CTX_STATE_STOPPING
DOCA_STABLE doca_error_t doca_dev_close(struct doca_dev *dev)
Destroy allocated local device instance.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_name(doca_error_t error)
Returns the string representation of an error code name.
@ DOCA_ERROR_INITIALIZATION
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
DOCA_STABLE doca_error_t doca_task_get_status(const struct doca_task *task)
Get task status.
DOCA_STABLE doca_error_t doca_task_submit(struct doca_task *task)
Submit a task to a progress engine.
DOCA_STABLE uint8_t doca_pe_progress(struct doca_pe *pe)
Run the progress engine.
DOCA_STABLE void doca_task_free(struct doca_task *task)
Free a task back to where it was allocated from.
doca_comch_task_send_completion_cb_t send_task_comp_cb
struct doca_comch_client * client
bool data_path_test_started
bool data_path_test_stopped
struct comch_data_path_objects * data_path
struct doca_comch_connection * connection
doca_error_t client_result
uint32_t remote_consumer_id
struct doca_comch_connection * connection
Convenience type for representing opaque data.
struct upf_accel_ctx * ctx