xref: /dpdk/examples/pipeline/thread.h (revision ce5d73a98d23806eb401c8fa20ab8cbaee299bd9)
1b77f6600SCristian Dumitrescu /* SPDX-License-Identifier: BSD-3-Clause
2b77f6600SCristian Dumitrescu  * Copyright(c) 2020 Intel Corporation
3b77f6600SCristian Dumitrescu  */
4b77f6600SCristian Dumitrescu 
5b77f6600SCristian Dumitrescu #ifndef _INCLUDE_THREAD_H_
6b77f6600SCristian Dumitrescu #define _INCLUDE_THREAD_H_
7b77f6600SCristian Dumitrescu 
8b77f6600SCristian Dumitrescu #include <stdint.h>
9b77f6600SCristian Dumitrescu 
10b9559f94SCristian Dumitrescu #include <rte_swx_pipeline.h>
11b77f6600SCristian Dumitrescu 
1241f5dfcbSCristian Dumitrescu /**
1341f5dfcbSCristian Dumitrescu  * Control plane (CP) thread.
1441f5dfcbSCristian Dumitrescu  */
15b77f6600SCristian Dumitrescu int
16b77f6600SCristian Dumitrescu thread_init(void);
17b77f6600SCristian Dumitrescu 
18b77f6600SCristian Dumitrescu int
1941f5dfcbSCristian Dumitrescu pipeline_enable(struct rte_swx_pipeline *p, uint32_t thread_id);
2041f5dfcbSCristian Dumitrescu 
2141f5dfcbSCristian Dumitrescu void
2241f5dfcbSCristian Dumitrescu pipeline_disable(struct rte_swx_pipeline *p);
2341f5dfcbSCristian Dumitrescu 
24*ce5d73a9SCristian Dumitrescu typedef void
25*ce5d73a9SCristian Dumitrescu (*block_run_f)(void *block);
26*ce5d73a9SCristian Dumitrescu 
27*ce5d73a9SCristian Dumitrescu int
28*ce5d73a9SCristian Dumitrescu block_enable(block_run_f block_func, void *block, uint32_t thread_id);
29*ce5d73a9SCristian Dumitrescu 
30*ce5d73a9SCristian Dumitrescu void
31*ce5d73a9SCristian Dumitrescu block_disable(void *block);
32*ce5d73a9SCristian Dumitrescu 
3341f5dfcbSCristian Dumitrescu /**
3441f5dfcbSCristian Dumitrescu  * Data plane (DP) threads.
3541f5dfcbSCristian Dumitrescu  */
3641f5dfcbSCristian Dumitrescu int
37b77f6600SCristian Dumitrescu thread_main(void *arg);
38b77f6600SCristian Dumitrescu 
39b77f6600SCristian Dumitrescu #endif /* _INCLUDE_THREAD_H_ */
40