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,
103 * Once called, the pipeline build operation marks the end of pipeline
104 * configuration. At this point, all the internal data structures needed to run
105 * the pipeline are built.
110 * 0 on success or the following error codes otherwise:
111 * -EINVAL: Invalid argument;
112 * -ENOMEM: Not enough space/cannot allocate memory;
113 * -EEXIST: Pipeline was already built successfully.
117 rte_swx_pipeline_build(struct rte_swx_pipeline *p);
127 rte_swx_pipeline_free(struct rte_swx_pipeline *p);