1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
4 #ifndef __INCLUDE_RTE_SWX_PIPELINE_H__
5 #define __INCLUDE_RTE_SWX_PIPELINE_H__
19 #include <rte_compat.h>
21 #include "rte_swx_port.h"
24 #ifndef RTE_SWX_NAME_SIZE
25 #define RTE_SWX_NAME_SIZE 64
28 * Pipeline setup and operation
31 /** Pipeline opaque data structure. */
32 struct rte_swx_pipeline;
38 * Pipeline handle. Must point to valid memory. Contains valid pipeline handle
39 * when the function returns successfully.
40 * @param[in] numa_node
41 * Non-Uniform Memory Access (NUMA) node.
43 * 0 on success or the following error codes otherwise:
44 * -EINVAL: Invalid argument;
45 * -ENOMEM: Not enough space/cannot allocate memory.
49 rte_swx_pipeline_config(struct rte_swx_pipeline **p,
53 * Pipeline input ports
57 * Pipeline input port type register
62 * Input port type name.
64 * Input port type operations.
66 * 0 on success or the following error codes otherwise:
67 * -EINVAL: Invalid argument;
68 * -ENOMEM: Not enough space/cannot allocate memory;
69 * -EEXIST: Input port type with this name already exists.
73 rte_swx_pipeline_port_in_type_register(struct rte_swx_pipeline *p,
75 struct rte_swx_port_in_ops *ops);
78 * Pipeline input port configure
84 * @param[in] port_type_name
85 * Existing input port type name.
87 * Input port creation arguments.
89 * 0 on success or the following error codes otherwise:
90 * -EINVAL: Invalid argument;
91 * -ENOMEM: Not enough space/cannot allocate memory;
92 * -ENODEV: Input port object creation error.
96 rte_swx_pipeline_port_in_config(struct rte_swx_pipeline *p,
98 const char *port_type_name,
102 * Pipeline output ports
106 * Pipeline output port type register
111 * Output port type name.
113 * Output port type operations.
115 * 0 on success or the following error codes otherwise:
116 * -EINVAL: Invalid argument;
117 * -ENOMEM: Not enough space/cannot allocate memory;
118 * -EEXIST: Output port type with this name already exists.
122 rte_swx_pipeline_port_out_type_register(struct rte_swx_pipeline *p,
124 struct rte_swx_port_out_ops *ops);
127 * Pipeline output port configure
133 * @param[in] port_type_name
134 * Existing output port type name.
136 * Output port creation arguments.
138 * 0 on success or the following error codes otherwise:
139 * -EINVAL: Invalid argument;
140 * -ENOMEM: Not enough space/cannot allocate memory;
141 * -ENODEV: Output port object creation error.
145 rte_swx_pipeline_port_out_config(struct rte_swx_pipeline *p,
147 const char *port_type_name,
153 * Once called, the pipeline build operation marks the end of pipeline
154 * configuration. At this point, all the internal data structures needed to run
155 * the pipeline are built.
160 * 0 on success or the following error codes otherwise:
161 * -EINVAL: Invalid argument;
162 * -ENOMEM: Not enough space/cannot allocate memory;
163 * -EEXIST: Pipeline was already built successfully.
167 rte_swx_pipeline_build(struct rte_swx_pipeline *p);
177 rte_swx_pipeline_free(struct rte_swx_pipeline *p);