DAOS API (v2.1 - dev)
Loading...
Searching...
No Matches
tse.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2015-2024 Intel Corporation.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
13#ifndef __TSE_SCHEDULE_H__
14#define __TSE_SCHEDULE_H__
15
16#include <gurt/list.h>
17
18#include <pthread.h>
19#include <inttypes.h>
20#include <stdbool.h>
21
23#define TSE_TASK_ARG_LEN (840 + sizeof(pthread_mutex_t))
25#define TSE_PRIV_SIZE (TSE_TASK_ARG_LEN + 136)
27#define TSE_TASK_SIZE (TSE_PRIV_SIZE + 8)
28
30typedef struct tse_task {
36 struct {
37 char dt_space[TSE_PRIV_SIZE];
40
42typedef struct {
45
47 void *ds_udata;
48
50 struct {
51 uint64_t ds_space[48];
52 } ds_private;
54
56typedef int (*tse_sched_comp_cb_t)(void *args, int rc);
58typedef int (*tse_task_func_t)(tse_task_t *);
59
61typedef int (*tse_task_cb_t)(tse_task_t *, void *arg);
62
64void *
66
70
85int
87 void *udata);
88
94void
96
102void
104
110void
112
121void
122tse_sched_complete(tse_sched_t *sched, int ret, bool cancel);
123
134int
136
147void
149
157bool
159
181int
182tse_task_create(tse_task_func_t task_func, tse_sched_t *sched, void *priv,
183 tse_task_t **taskp);
184
196int
197tse_task_schedule(tse_task_t *task, bool instant);
198
209int
210tse_task_schedule_with_delay(tse_task_t *task, bool instant, uint64_t delay);
211
223int
225 void *arg, size_t arg_size);
226
233void
235
248void *
250
255void *
257
262void *
263tse_task_set_priv(tse_task_t *task, void *priv);
264
277int
279 tse_task_t *dep_tasks[]);
280
296int
298 void *prep_data, size_t prep_data_size,
299 tse_task_cb_t comp_cb, void *comp_data,
300 size_t comp_data_size);
301
315int
317
328int
330
344int
345tse_task_reset(tse_task_t *task, tse_task_func_t task_func, void *priv);
346
348void
350
352void
354
359int
360tse_task_list_add(tse_task_t *task, d_list_t *head);
361
365void
367
373tse_task_list_first(d_list_t *head);
374
378void
379tse_task_list_sched(d_list_t *head, bool instant);
380
384void
385tse_task_list_abort(d_list_t *head, int rc);
386
390int
391tse_task_list_depend(d_list_t *head, tse_task_t *task);
392
396int
397tse_task_depend_list(tse_task_t *task, d_list_t *head);
398
404int
405tse_task_list_traverse(d_list_t *head, tse_task_cb_t cb, void *arg);
406
411int
412tse_task_list_traverse_adv(d_list_t *head, tse_task_cb_t cb, void *arg);
413
417void
419
420#endif /* __TSE_SCHEDULE_H__ */
void * ds_udata
Definition tse.h:47
int ds_result
Definition tse.h:44
Definition tse.h:30
struct tse_task::@34 dt_private
int dt_result
Definition tse.h:32
int dt_pad32
Definition tse.h:34
int(* tse_task_cb_t)(tse_task_t *, void *arg)
Definition tse.h:61
tse_sched_t * tse_task2sched(tse_task_t *task)
int(* tse_sched_comp_cb_t)(void *args, int rc)
Definition tse.h:56
int tse_task_list_traverse_adv(d_list_t *head, tse_task_cb_t cb, void *arg)
int tse_task_register_deps(tse_task_t *task, int num_deps, tse_task_t *dep_tasks[])
#define TSE_PRIV_SIZE
Definition tse.h:25
struct tse_task tse_task_t
int(* tse_task_func_t)(tse_task_t *)
Definition tse.h:58
void tse_sched_complete(tse_sched_t *sched, int ret, bool cancel)
void tse_task_list_sched(d_list_t *head, bool instant)
int tse_task_list_depend(d_list_t *head, tse_task_t *task)
void tse_sched_addref(tse_sched_t *sched)
void tse_task_addref(tse_task_t *task)
void * tse_task_buf_embedded(tse_task_t *task, int size)
void * tse_task_set_priv(tse_task_t *task, void *priv)
int tse_task_reinit(tse_task_t *task)
int tse_task_register_cbs(tse_task_t *task, tse_task_cb_t prep_cb, void *prep_data, size_t prep_data_size, tse_task_cb_t comp_cb, void *comp_data, size_t comp_data_size)
void tse_sched_decref(tse_sched_t *sched)
int tse_task_register_comp_cb(tse_task_t *task, tse_task_cb_t comp_cb, void *arg, size_t arg_size)
int tse_task_schedule_with_delay(tse_task_t *task, bool instant, uint64_t delay)
void tse_task_list_abort(d_list_t *head, int rc)
void tse_task_complete(tse_task_t *task, int ret)
void * tse_task2arg(tse_task_t *task)
void tse_sched_progress(tse_sched_t *sched)
int tse_task_schedule(tse_task_t *task, bool instant)
void * tse_task_get_priv(tse_task_t *task)
int tse_task_reinit_with_delay(tse_task_t *task, uint64_t delay)
int tse_task_depend_list(tse_task_t *task, d_list_t *head)
int tse_sched_register_comp_cb(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *arg)
int tse_sched_init(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *udata)
void tse_task_decref(tse_task_t *task)
bool tse_sched_check_complete(tse_sched_t *sched)
tse_task_t * tse_task_list_first(d_list_t *head)
int tse_task_create(tse_task_func_t task_func, tse_sched_t *sched, void *priv, tse_task_t **taskp)
int tse_task_list_add(tse_task_t *task, d_list_t *head)
void tse_disable_propagate(tse_task_t *task)
int tse_task_list_traverse(d_list_t *head, tse_task_cb_t cb, void *arg)
int tse_task_reset(tse_task_t *task, tse_task_func_t task_func, void *priv)
void tse_sched_fini(tse_sched_t *sched)
void tse_task_list_del(tse_task_t *task)