pipeline: add SWX pipeline specification file
Add support for building the SWX pipeline based on specification file with syntax aligned to the P4 language. The specification file may be generated by the P4C compiler in the future. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
parent
b32c0a2c5e
commit
3ca60ceed7
@ -5,6 +5,7 @@ sources = files('rte_pipeline.c',
|
||||
'rte_port_in_action.c',
|
||||
'rte_table_action.c',
|
||||
'rte_swx_pipeline.c',
|
||||
'rte_swx_pipeline_spec.c',
|
||||
'rte_swx_ctl.c',)
|
||||
headers = files('rte_pipeline.h',
|
||||
'rte_port_in_action.h',
|
||||
|
@ -81,6 +81,7 @@ EXPERIMENTAL {
|
||||
rte_swx_ctl_table_ops_get;
|
||||
rte_swx_pipeline_action_config;
|
||||
rte_swx_pipeline_build;
|
||||
rte_swx_pipeline_build_from_spec;
|
||||
rte_swx_pipeline_config;
|
||||
rte_swx_pipeline_extern_func_register;
|
||||
rte_swx_pipeline_extern_object_config;
|
||||
|
@ -643,6 +643,32 @@ __rte_experimental
|
||||
int
|
||||
rte_swx_pipeline_build(struct rte_swx_pipeline *p);
|
||||
|
||||
/**
|
||||
* Pipeline build from specification file
|
||||
*
|
||||
* @param[in] p
|
||||
* Pipeline handle.
|
||||
* @param[in] spec
|
||||
* Pipeline specification file.
|
||||
* @param[out] err_line
|
||||
* In case of error and non-NULL, the line number within the *spec* file where
|
||||
* the error occurred. The first line number in the file is 1.
|
||||
* @param[out] err_msg
|
||||
* In case of error and non-NULL, the error message.
|
||||
* @return
|
||||
* 0 on success or the following error codes otherwise:
|
||||
* -EINVAL: Invalid argument;
|
||||
* -ENOMEM: Not enough space/cannot allocate memory;
|
||||
* -EEXIST: Resource with the same name already exists;
|
||||
* -ENODEV: Extern object or table creation error.
|
||||
*/
|
||||
__rte_experimental
|
||||
int
|
||||
rte_swx_pipeline_build_from_spec(struct rte_swx_pipeline *p,
|
||||
FILE *spec,
|
||||
uint32_t *err_line,
|
||||
const char **err_msg);
|
||||
|
||||
/**
|
||||
* Pipeline run
|
||||
*
|
||||
|
1439
lib/librte_pipeline/rte_swx_pipeline_spec.c
Normal file
1439
lib/librte_pipeline/rte_swx_pipeline_spec.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user