pipeline: add new SWX pipeline type
[dpdk.git] / lib / librte_pipeline / rte_swx_pipeline.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4 #ifndef __INCLUDE_RTE_SWX_PIPELINE_H__
5 #define __INCLUDE_RTE_SWX_PIPELINE_H__
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 /**
12  * @file
13  * RTE SWX Pipeline
14  */
15
16 #include <stddef.h>
17 #include <stdint.h>
18
19 #include <rte_compat.h>
20
21 /*
22  * Pipeline setup and operation
23  */
24
25 /** Pipeline opaque data structure. */
26 struct rte_swx_pipeline;
27
28 /**
29  * Pipeline configure
30  *
31  * @param[out] p
32  *   Pipeline handle. Must point to valid memory. Contains valid pipeline handle
33  *   when the function returns successfully.
34  * @param[in] numa_node
35  *   Non-Uniform Memory Access (NUMA) node.
36  * @return
37  *   0 on success or the following error codes otherwise:
38  *   -EINVAL: Invalid argument;
39  *   -ENOMEM: Not enough space/cannot allocate memory.
40  */
41 __rte_experimental
42 int
43 rte_swx_pipeline_config(struct rte_swx_pipeline **p,
44                         int numa_node);
45
46 /**
47  * Pipeline build
48  *
49  * Once called, the pipeline build operation marks the end of pipeline
50  * configuration. At this point, all the internal data structures needed to run
51  * the pipeline are built.
52  *
53  * @param[in] p
54  *   Pipeline handle.
55  * @return
56  *   0 on success or the following error codes otherwise:
57  *   -EINVAL: Invalid argument;
58  *   -ENOMEM: Not enough space/cannot allocate memory;
59  *   -EEXIST: Pipeline was already built successfully.
60  */
61 __rte_experimental
62 int
63 rte_swx_pipeline_build(struct rte_swx_pipeline *p);
64
65 /**
66  * Pipeline free
67  *
68  * @param[in] p
69  *   Pipeline handle.
70  */
71 __rte_experimental
72 void
73 rte_swx_pipeline_free(struct rte_swx_pipeline *p);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif