118 struct doca_comch_task_send *task;
149 uint8_t *recv_buffer,
151 struct doca_comch_connection *comch_connection)
154 struct doca_comch_server *comch_server;
160 DOCA_LOG_INFO(
"Message received: '%.*s'", (
int)msg_len, recv_buffer);
171 sample_objects->
connection = comch_connection;
204 struct doca_comch_connection *comch_connection,
205 uint8_t change_success)
208 struct doca_comch_server *comch_server;
212 if (change_success == 0) {
228 sample_objects->
connection = comch_connection;
239 struct doca_comch_connection *comch_connection,
240 uint8_t change_success)
243 (void)comch_connection;
245 if (change_success == 0)
258 struct doca_ctx *
ctx,
267 switch (next_state) {
277 DOCA_LOG_ERR(
"CC server context entered into starting state. Unexpected transition");
280 DOCA_LOG_INFO(
"CC server context is running. Waiting for clients to connect");
287 DOCA_LOG_INFO(
"CC server context entered into stopping state. Terminating connections with clients");
302 struct doca_comch_connection *comch_connection,
306 struct doca_comch_server *comch_server;
324 DOCA_LOG_INFO(
"Got a new remote consumer with ID = [%d]",
id);
335 struct doca_comch_connection *comch_connection,
340 (void)comch_connection;
352 struct timespec ts = {
357 if (sample_objects ==
NULL)
372 sample_objects->
pe =
NULL;
377 DOCA_LOG_ERR(
"Failed to close rep device properly with error = %s",
403 const char *dev_pci_addr,
404 const char *dev_rep_pci_addr,
415 .data_path_mode =
true,
418 .ctx_user_data = sample_objects,
420 struct timespec ts = {
430 DOCA_LOG_ERR(
"Failed to open DOCA device based on PCI address");
441 DOCA_LOG_ERR(
"Failed to open DOCA device representor based on PCI address");
450 &(sample_objects->
server),
451 &(sample_objects->
pe));
507 const char *dev_pci_addr,
508 const char *rep_pci_addr,
void clean_comch_ctrl_path_server(struct doca_comch_server *server, struct doca_pe *pe)
doca_error_t init_comch_ctrl_path_server(const char *server_name, struct doca_dev *hw_dev, struct doca_dev_rep *rep_dev, struct comch_ctrl_path_server_cb_config *cb_cfg, struct doca_comch_server **server, struct doca_pe **pe)
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 void server_send_task_completion_callback(struct doca_comch_task_send *task, union doca_data task_user_data, union doca_data ctx_user_data)
static void server_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 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)
DOCA_LOG_REGISTER(COMCH_DATA_PATH_HIGH_SPEED_SERVER)
static void handle_error_state(struct comch_data_path_server_objects *sample_objects)
static void server_connection_event_callback(struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_success)
static void clean_comch_data_path_server_objects(struct comch_data_path_server_objects *sample_objects)
static void server_message_recv_callback(struct doca_comch_event_msg_recv *event, uint8_t *recv_buffer, uint32_t msg_len, struct doca_comch_connection *comch_connection)
doca_error_t start_comch_data_path_server_sample(const char *server_name, const char *dev_pci_addr, const char *rep_pci_addr, const char *text)
static void server_disconnection_event_callback(struct doca_comch_event_connection_status_changed *event, struct doca_comch_connection *comch_connection, uint8_t change_success)
static doca_error_t init_comch_data_path_server_objects(const char *server_name, const char *dev_pci_addr, const char *dev_rep_pci_addr, const char *text, struct comch_data_path_server_objects *sample_objects)
static void server_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 doca_error_t server_send_msg(struct comch_data_path_server_objects *sample_objects, const char *msg, size_t len)
doca_error_t open_doca_device_rep_with_pci(struct doca_dev *local, enum doca_devinfo_rep_filter filter, const char *pci_addr, struct doca_dev_rep **retval)
static doca_error_t open_doca_device_with_pci(const char *pcie_value, struct doca_dev **retval)
if(bitoffset % 64+bitlength > 64) result|
DOCA_STABLE struct doca_comch_server * doca_comch_server_get_server_ctx(const struct doca_comch_connection *connection)
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_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 struct doca_ctx * doca_comch_server_as_ctx(struct doca_comch_server *comch_server)
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_rep_close(struct doca_dev_rep *dev)
Destroy allocated representor device instance.
DOCA_STABLE doca_error_t doca_dev_close(struct doca_dev *dev)
Destroy allocated local device instance.
@ DOCA_DEVINFO_REP_FILTER_NET
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.
#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
uint32_t remote_consumer_id
struct doca_comch_connection * connection
struct comch_data_path_objects * data_path
struct doca_comch_connection * connection
bool data_path_test_started
bool data_path_test_stopped
doca_error_t server_result
struct doca_dev_rep * rep_dev
struct doca_comch_server * server
Convenience type for representing opaque data.
struct upf_accel_ctx * ctx