1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
4 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
14 TASK_STATE_DRAINING = 3,
15 TASK_STATE_DRAINED = 4,
16 TASK_STATE_INVALID = 5,
20 * data structure to describe a 'task' which is a short
21 * function that returns 0 as long as it needs to be
25 struct work_struct work;
29 int (*func)(struct rxe_qp *qp);
35 int rxe_alloc_wq(void);
37 void rxe_destroy_wq(void);
40 * init rxe_task structure
41 * qp => parameter to pass to func
42 * func => function to call until it returns != 0
44 int rxe_init_task(struct rxe_task *task, struct rxe_qp *qp,
45 int (*func)(struct rxe_qp *));
48 void rxe_cleanup_task(struct rxe_task *task);
50 void rxe_run_task(struct rxe_task *task);
52 void rxe_sched_task(struct rxe_task *task);
54 /* keep a task from scheduling */
55 void rxe_disable_task(struct rxe_task *task);
57 /* allow task to run */
58 void rxe_enable_task(struct rxe_task *task);
60 #endif /* RXE_TASK_H */