68 struct doca_sync_event *wait_event =
NULL;
69 struct doca_sync_event *comp_event =
NULL;
71 uint64_t wait_thresh = 4;
72 uint64_t comp_event_val = 10;
73 const unsigned int num_dpa_threads = 1;
88 DOCA_LOG_ERR(
"Failed to create DOCA sync event for DPA kernel completion: %s",
90 goto destroy_wait_event;
102 goto destroy_comp_event;
109 goto destroy_comp_event;
112 res = pthread_detach(tid);
116 goto destroy_comp_event;
static doca_error_t create_doca_dpa_completion_sync_event(struct doca_dpa *doca_dpa, struct doca_dev *doca_device, struct doca_sync_event **comp_event)
#define SYNC_EVENT_MASK_FFS
doca_error_t create_doca_dpa_wait_sync_event(struct doca_dpa *doca_dpa, struct doca_dev *doca_device, struct doca_sync_event **wait_event)
Create DOCA sync event to be published by the CPU and subscribed by the DPA.
doca_error_t kernel_launch(struct dpa_resources *resources)
static void * wait_event_update_thread(void *event)
doca_dpa_func_t hello_world
DOCA_LOG_REGISTER(KERNEL_LAUNCH::SAMPLE)
struct rdma_resources resources
DOCA_EXPERIMENTAL doca_error_t doca_dpa_kernel_launch_update_set(struct doca_dpa *dpa, struct doca_sync_event *wait_event, uint64_t wait_threshold, struct doca_sync_event *comp_event, uint64_t comp_count, unsigned int num_threads, doca_dpa_func_t *func,...)
Submit a kernel to DPA that sets completion event.
void() doca_dpa_func_t(void)
Generic function pointer type.
#define DOCA_ERROR_PROPAGATE(r, t)
Save the first encountered doca_error_t.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_OPERATING_SYSTEM
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
DOCA_EXPERIMENTAL doca_error_t doca_sync_event_update_set(struct doca_sync_event *event, uint64_t value)
Set the value of a Sync Event to some value synchronously.
DOCA_EXPERIMENTAL doca_error_t doca_sync_event_wait_gt(struct doca_sync_event *event, uint64_t value, uint64_t mask)
Wait for the value of a Sync Event to be grater than some threshold value synchronously in a polling ...
DOCA_EXPERIMENTAL doca_error_t doca_sync_event_destroy(struct doca_sync_event *event)
Destroy a Sync Event instance.
A struct that includes all the resources needed for DPA.