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:
Cristian Dumitrescu 2020-10-01 11:20:00 +01:00 committed by David Marchand
parent b32c0a2c5e
commit 3ca60ceed7
4 changed files with 1467 additions and 0 deletions

View File

@ -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',

View File

@ -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;

View File

@ -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
*

File diff suppressed because it is too large Load Diff