.TH "rte_swx_pipeline.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_swx_pipeline.h
.SH SYNOPSIS
.br
.PP
\fR#include <stdint\&.h>\fP
.br
\fR#include <stdio\&.h>\fP
.br
\fR#include <rte_compat\&.h>\fP
.br
\fR#include 'rte_swx_port\&.h'\fP
.br
\fR#include 'rte_swx_table\&.h'\fP
.br
\fR#include 'rte_swx_extern\&.h'\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_swx_pipeline_mirroring_params\fP"
.br
.ti -1c
.RI "struct \fBrte_swx_field_params\fP"
.br
.ti -1c
.RI "struct \fBrte_swx_match_field_params\fP"
.br
.ti -1c
.RI "struct \fBrte_swx_pipeline_table_params\fP"
.br
.ti -1c
.RI "struct \fBrte_swx_pipeline_selector_params\fP"
.br
.ti -1c
.RI "struct \fBrte_swx_pipeline_learner_params\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_SWX_NAME_SIZE\fP   64"
.br
.ti -1c
.RI "#define \fBRTE_SWX_INSTRUCTION_SIZE\fP   256"
.br
.ti -1c
.RI "#define \fBRTE_SWX_INSTRUCTION_TOKENS_MAX\fP   16"
.br
.ti -1c
.RI "#define \fBRTE_SWX_PACKET_MIRRORING_SLOTS_DEFAULT\fP   4"
.br
.ti -1c
.RI "#define \fBRTE_SWX_PACKET_MIRRORING_SESSIONS_DEFAULT\fP   64"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "__rte_experimental struct rte_swx_pipeline * \fBrte_swx_pipeline_find\fP (const char *name)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_config\fP (struct rte_swx_pipeline **p, const char *name, int numa_node)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_port_in_type_register\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_port_in_ops\fP *ops)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_port_in_config\fP (struct rte_swx_pipeline *p, uint32_t port_id, const char *port_type_name, void *args)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_port_out_type_register\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_port_out_ops\fP *ops)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_port_out_config\fP (struct rte_swx_pipeline *p, uint32_t port_id, const char *port_type_name, void *args)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_mirroring_config\fP (struct rte_swx_pipeline *p, struct \fBrte_swx_pipeline_mirroring_params\fP *params)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_extern_type_register\fP (struct rte_swx_pipeline *p, const char *name, const char *mailbox_struct_type_name, \fBrte_swx_extern_type_constructor_t\fP constructor, \fBrte_swx_extern_type_destructor_t\fP destructor)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_extern_type_member_func_register\fP (struct rte_swx_pipeline *p, const char *extern_type_name, const char *name, \fBrte_swx_extern_type_member_func_t\fP member_func)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_extern_object_config\fP (struct rte_swx_pipeline *p, const char *extern_type_name, const char *name, const char *args)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_extern_func_register\fP (struct rte_swx_pipeline *p, const char *name, const char *mailbox_struct_type_name, \fBrte_swx_extern_func_t\fP func)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_hash_func_register\fP (struct rte_swx_pipeline *p, const char *name, \fBrte_swx_hash_func_t\fP func)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_rss_config\fP (struct rte_swx_pipeline *p, const char *name)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_struct_type_register\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_field_params\fP *fields, uint32_t n_fields, int last_field_has_variable_size)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_packet_header_register\fP (struct rte_swx_pipeline *p, const char *name, const char *struct_type_name)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_packet_metadata_register\fP (struct rte_swx_pipeline *p, const char *struct_type_name)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_action_config\fP (struct rte_swx_pipeline *p, const char *name, const char *args_struct_type_name, const char **instructions, uint32_t n_instructions)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_table_type_register\fP (struct rte_swx_pipeline *p, const char *name, enum \fBrte_swx_table_match_type\fP match_type, struct \fBrte_swx_table_ops\fP *ops)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_table_config\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_pipeline_table_params\fP *params, const char *recommended_table_type_name, const char *args, uint32_t size)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_selector_config\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_pipeline_selector_params\fP *params)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_learner_config\fP (struct rte_swx_pipeline *p, const char *name, struct \fBrte_swx_pipeline_learner_params\fP *params, uint32_t size, uint32_t *timeout, uint32_t n_timeouts)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_regarray_config\fP (struct rte_swx_pipeline *p, const char *name, uint32_t size, uint64_t init_val)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_metarray_config\fP (struct rte_swx_pipeline *p, const char *name, uint32_t size)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_instructions_config\fP (struct rte_swx_pipeline *p, const char **instructions, uint32_t n_instructions)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_build\fP (struct rte_swx_pipeline *p)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_codegen\fP (FILE *spec_file, FILE *code_file, uint32_t *err_line, const char **err_msg)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_swx_pipeline_build_from_lib\fP (struct rte_swx_pipeline **p, const char *name, const char *lib_file_name, FILE *iospec_file, int numa_node)"
.br
.ti -1c
.RI "__rte_experimental void \fBrte_swx_pipeline_run\fP (struct rte_swx_pipeline *p, uint32_t n_instructions)"
.br
.ti -1c
.RI "__rte_experimental void \fBrte_swx_pipeline_flush\fP (struct rte_swx_pipeline *p)"
.br
.ti -1c
.RI "__rte_experimental void \fBrte_swx_pipeline_free\fP (struct rte_swx_pipeline *p)"
.br
.in -1c
.SH "Detailed Description"
.PP 
RTE SWX Pipeline 
.PP
Definition in file \fBrte_swx_pipeline\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#define RTE_SWX_NAME_SIZE   64"
Name size\&. 
.PP
Definition at line \fB27\fP of file \fBrte_swx_pipeline\&.h\fP\&.
.SS "#define RTE_SWX_INSTRUCTION_SIZE   256"
Instruction size\&. 
.PP
Definition at line \fB32\fP of file \fBrte_swx_pipeline\&.h\fP\&.
.SS "#define RTE_SWX_INSTRUCTION_TOKENS_MAX   16"
Instruction tokens\&. 
.PP
Definition at line \fB37\fP of file \fBrte_swx_pipeline\&.h\fP\&.
.SS "#define RTE_SWX_PACKET_MIRRORING_SLOTS_DEFAULT   4"
Default number of packet mirroring slots\&. 
.PP
Definition at line \fB184\fP of file \fBrte_swx_pipeline\&.h\fP\&.
.SS "#define RTE_SWX_PACKET_MIRRORING_SESSIONS_DEFAULT   64"
Default maximum number of packet mirroring sessions\&. 
.PP
Definition at line \fB189\fP of file \fBrte_swx_pipeline\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "__rte_experimental struct rte_swx_pipeline * rte_swx_pipeline_find (const char * name)"
Pipeline find

.PP
\fBParameters\fP
.RS 4
\fIname\fP Pipeline name\&. 
.RE
.PP
\fBReturns\fP
.RS 4
Valid pipeline handle if found or NULL otherwise\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_config (struct rte_swx_pipeline ** p, const char * name, int numa_node)"
Pipeline configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. Must point to valid memory\&. Contains valid pipeline handle when the function returns successfully\&. 
.br
\fIname\fP Pipeline unique name\&. 
.br
\fInuma_node\fP Non-Uniform Memory Access (NUMA) node\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Pipeline with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_port_in_type_register (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_port_in_ops\fP * ops)"
Pipeline input port type register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Input port type name\&. 
.br
\fIops\fP Input port type operations\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Input port type with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_port_in_config (struct rte_swx_pipeline * p, uint32_t port_id, const char * port_type_name, void * args)"
Pipeline input port configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIport_id\fP Input port ID\&. 
.br
\fIport_type_name\fP Existing input port type name\&. 
.br
\fIargs\fP Input port creation arguments\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -ENODEV: Input port object creation error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_port_out_type_register (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_port_out_ops\fP * ops)"
Pipeline output port type register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Output port type name\&. 
.br
\fIops\fP Output port type operations\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Output port type with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_port_out_config (struct rte_swx_pipeline * p, uint32_t port_id, const char * port_type_name, void * args)"
Pipeline output port configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIport_id\fP Output port ID\&. 
.br
\fIport_type_name\fP Existing output port type name\&. 
.br
\fIargs\fP Output port creation arguments\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -ENODEV: Output port object creation error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_mirroring_config (struct rte_swx_pipeline * p, struct \fBrte_swx_pipeline_mirroring_params\fP * params)"
Packet mirroring configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIparams\fP Packet mirroring parameters\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory; -EEXIST: Pipeline was already built successfully\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_extern_type_register (struct rte_swx_pipeline * p, const char * name, const char * mailbox_struct_type_name, \fBrte_swx_extern_type_constructor_t\fP constructor, \fBrte_swx_extern_type_destructor_t\fP destructor)"
Pipeline extern type register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Extern type name\&. 
.br
\fImailbox_struct_type_name\fP Name of existing struct type used to define the mailbox size and layout for the extern objects that are instances of this type\&. Each extern object gets its own mailbox, which is used to pass the input arguments to the member functions and retrieve the output results\&. 
.br
\fIconstructor\fP Function used to create the extern objects that are instances of this type\&. 
.br
\fIdestructor\fP Function used to free the extern objects that are instances of this type\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Extern type with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_extern_type_member_func_register (struct rte_swx_pipeline * p, const char * extern_type_name, const char * name, \fBrte_swx_extern_type_member_func_t\fP member_func)"
Pipeline extern type member function register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIextern_type_name\fP Existing extern type name\&. 
.br
\fIname\fP Name for the new member function to be added to the extern type\&. 
.br
\fImember_func\fP The new member function\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Member function with this name already exists for this type; -ENOSPC: Maximum number of member functions reached for this type\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_extern_object_config (struct rte_swx_pipeline * p, const char * extern_type_name, const char * name, const char * args)"
Pipeline extern object configure

.PP
Instantiate a given extern type to create new extern object\&.

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIextern_type_name\fP Existing extern type name\&. 
.br
\fIname\fP Name for the new object instantiating the extern type\&. 
.br
\fIargs\fP Extern object constructor arguments\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Extern object with this name already exists; -ENODEV: Extern object constructor error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_extern_func_register (struct rte_swx_pipeline * p, const char * name, const char * mailbox_struct_type_name, \fBrte_swx_extern_func_t\fP func)"
Pipeline extern function register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Extern function name\&. 
.br
\fImailbox_struct_type_name\fP Name of existing struct type used to define the mailbox size and layout for this extern function\&. The mailbox is used to pass the input arguments to the extern function and retrieve the output results\&. 
.br
\fIfunc\fP The extern function\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Extern function with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_hash_func_register (struct rte_swx_pipeline * p, const char * name, \fBrte_swx_hash_func_t\fP func)"
Pipeline hash function register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Hash function name\&. 
.br
\fIfunc\fP Hash function\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Hash function with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_rss_config (struct rte_swx_pipeline * p, const char * name)"
Pipeline Receive Side Scaling (RSS) object configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Name for the new RSS object\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: RSS object with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_struct_type_register (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_field_params\fP * fields, uint32_t n_fields, int last_field_has_variable_size)"
Pipeline struct type register

.PP
Structs are used extensively in many part of the pipeline to define the size and layout of a specific memory piece such as: headers, meta-data, action data stored in a table entry, mailboxes for extern objects and functions\&. Similar to C language structs, they are a well defined sequence of fields, with each field having a unique name and a constant size\&.

.PP
In order to use structs to express variable size packet headers such as IPv4 with options, it is allowed for the last field of the struct type to have a variable size between 0 and \fIn_bits\fP bits, with the actual size of this field determined at run-time for each packet\&. This struct feature is restricted to just a few selected instructions that deal with packet headers, so a typical struct generally has a constant size that is fully known when its struct type is registered\&.

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Struct type name\&. 
.br
\fIfields\fP The sequence of struct fields\&. 
.br
\fIn_fields\fP The number of struct fields\&. 
.br
\fIlast_field_has_variable_size\fP If non-zero (true), then the last field has a variable size between 0 and \fIn_bits\fP bits, with its actual size determined at run-time for each packet\&. If zero (false), then the last field has a constant size of \fIn_bits\fP bits\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Struct type with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_packet_header_register (struct rte_swx_pipeline * p, const char * name, const char * struct_type_name)"
Pipeline packet header register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Header name\&. 
.br
\fIstruct_type_name\fP The struct type instantiated by this packet header\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Header with this name already exists; -ENOSPC: Maximum number of headers reached for the pipeline\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_packet_metadata_register (struct rte_swx_pipeline * p, const char * struct_type_name)"
Pipeline packet meta-data register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIstruct_type_name\fP The struct type instantiated by the packet meta-data\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_action_config (struct rte_swx_pipeline * p, const char * name, const char * args_struct_type_name, const char ** instructions, uint32_t n_instructions)"
Instruction operands:

.PP
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
|     | Description               | Format           | DST | SRC |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| hdr | Header                    | h\&.header         |     |     |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| act | Action                    | ACTION           |     |     |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| tbl | Table                     | TABLE            |     |     |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| H   | Header field              | h\&.header\&.field   | YES | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| M   | Meta-data field           | m\&.field          | YES | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| E   | Extern obj mailbox field  | e\&.ext_obj\&.field  | YES | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| F   | Extern func mailbox field | f\&.ext_func\&.field | YES | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| T   | Table action data field   | t\&.header\&.field   | NO  | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP
 
.PP
.nf
| I   | Immediate value (64-bit)  | h\&.header\&.field   | NO  | YES |
.fi
.PP
 
.PP
.nf
+-----+---------------------------+------------------+-----+-----+
.fi
.PP

.PP
Instruction set:

.PP
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| Instr\&.     | Instruction          | Instruction       | 1st  | 2nd    |
.fi
.PP
 
.PP
.nf
| Name       | Description          | Format            | opnd\&.| opnd\&.  |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| rx         | Receive one pkt      | rx m\&.port_in      | M    |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| tx         | Transmit one pkt     | tx m\&.port_out     | M    |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| extract    | Extract one hdr      | extract h\&.hdr     | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| emit       | Emit one hdr         | emit h\&.hdr        | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| validate   | Validate one hdr     | validate h\&.hdr    | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| invalidate | Invalidate one hdr   | invalidate h\&.hdr  | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| mov        | dst = src            | mov dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| add        | dst += src           | add dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| sub        | dst -= src           | add dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| ckadd      | Checksum add: dst =  | add dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
|            | dst '+ src[0:1] '+   |                   |      | or hdr |
.fi
.PP
 
.PP
.nf
|            | src[2:3] '+ \&.\&.\&.      |                   |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| cksub      | Checksum subtract:   | add dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
|            | dst = dst '- src     |                   |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| and        | dst &= src           | and dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| or         | dst |= src           | or  dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| xor        | dst ^= src           | xor dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| shl        | dst <<= src          | shl dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| shr        | dst >>= src          | shr dst src       | HMEF | HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| table      | Table lookup         | table TABLE       | tbl  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| extern     | Ext obj member func  | extern e\&.obj\&.mfunc| ext  |        |
.fi
.PP
 
.PP
.nf
|            | call or ext func call| extern f\&.func     |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmp        | Unconditional jump   | jmp LABEL         |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpv       | Jump if hdr is valid | jmpv LABEL h\&.hdr  | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpnv      | Jump if hdr is inval | jmpnv LABEL h\&.hdr | hdr  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmph       | Jump if tbl lkp hit  | jmph LABEL        |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpnh      | Jump if tbl lkp miss | jmpnh LABEL       |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpa       | Jump if action run   | jmpa LABEL ACTION | act  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpna      | Jump if act not run  | jmpna LABEL ACTION| act  |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpeq      | Jump if (a == b)     | jmpeq LABEL a b   | HMEFT| HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpneq     | Jump if (a != b)     | jmpneq LABEL a b  | HMEFT| HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmplt      | Jump if (a < b)      | jmplt LABEL a b   | HMEFT| HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| jmpgt      | Jump if (a > b)      | jmpgt LABEL a b   | HMEFT| HMEFTI |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP
 
.PP
.nf
| return     | Return from action   | return            |      |        |
.fi
.PP
 
.PP
.nf
+------------+----------------------+-------------------+------+--------+
.fi
.PP

.PP
At initialization time, the pipeline and action instructions (including the symbolic name operands) are translated to internal data structures that are used at run-time\&. Pipeline action configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Action name\&. 
.br
\fIargs_struct_type_name\fP The struct type instantiated by the action data\&. The action data represent the action arguments that are stored in the table entry together with the action ID\&. Set to NULL when the action does not have any arguments\&. 
.br
\fIinstructions\fP Action instructions\&. 
.br
\fIn_instructions\fP Number of action instructions\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Action with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_table_type_register (struct rte_swx_pipeline * p, const char * name, enum \fBrte_swx_table_match_type\fP match_type, struct \fBrte_swx_table_ops\fP * ops)"
Pipeline table type register

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Table type name\&. 
.br
\fImatch_type\fP Match type implemented by the new table type\&. 
.br
\fIops\fP Table type operations\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Table type with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_table_config (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_pipeline_table_params\fP * params, const char * recommended_table_type_name, const char * args, uint32_t size)"
Pipeline table configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Table name\&. 
.br
\fIparams\fP Table parameters\&. 
.br
\fIrecommended_table_type_name\fP Recommended table type\&. Typically set to NULL\&. Useful as guidance when there are multiple table types registered for the match type of the table, as determined from the table match fields specification\&. Silently ignored if the recommended table type does not exist or it serves a different match type\&. 
.br
\fIargs\fP Table creation arguments\&. 
.br
\fIsize\fP Guideline on maximum number of table entries\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Table with this name already exists; -ENODEV: Table creation error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_selector_config (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_pipeline_selector_params\fP * params)"
Pipeline selector table configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Selector table name\&. 
.br
\fIparams\fP Selector table parameters\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Selector table with this name already exists; -ENODEV: Selector table creation error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_learner_config (struct rte_swx_pipeline * p, const char * name, struct \fBrte_swx_pipeline_learner_params\fP * params, uint32_t size, uint32_t * timeout, uint32_t n_timeouts)"
Pipeline learner table configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Learner table name\&. 
.br
\fIparams\fP Learner table parameters\&. 
.br
\fIsize\fP The maximum number of table entries\&. Must be non-zero\&. 
.br
\fItimeout\fP Array of possible table entry timeouts in seconds\&. Must be non-NULL\&. 
.br
\fIn_timeouts\fP Number of elements in the \fItimeout\fP array\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Learner table with this name already exists; -ENODEV: Learner table creation error\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_regarray_config (struct rte_swx_pipeline * p, const char * name, uint32_t size, uint64_t init_val)"
Pipeline register array configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Register array name\&. 
.br
\fIsize\fP Number of registers in the array\&. Each register is 64-bit in size\&. 
.br
\fIinit_val\fP Initial value for every register in the array\&. The recommended value is 0\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Register array with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_metarray_config (struct rte_swx_pipeline * p, const char * name, uint32_t size)"
Pipeline meter array configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIname\fP Meter array name\&. 
.br
\fIsize\fP Number of meters in the array\&. Each meter in the array implements the Two Rate Three Color Marker (trTCM) algorithm, as specified by RFC 2698\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Meter array with this name already exists\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_instructions_config (struct rte_swx_pipeline * p, const char ** instructions, uint32_t n_instructions)"
Pipeline instructions configure

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIinstructions\fP Pipeline instructions\&. 
.br
\fIn_instructions\fP Number of pipeline instructions\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_build (struct rte_swx_pipeline * p)"
Pipeline build

.PP
Once called, the pipeline build operation marks the end of pipeline configuration\&. At this point, all the internal data structures needed to run the pipeline are built\&.

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Pipeline was already built successfully\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_codegen (FILE * spec_file, FILE * code_file, uint32_t * err_line, const char ** err_msg)"
Pipeline C code generate based on input specification file

.PP
\fBParameters\fP
.RS 4
\fIspec_file\fP Pipeline specification file (\&.spec) provided as input\&. 
.br
\fIcode_file\fP Pipeline C language file (\&.c) to be generated\&. 
.br
\fIerr_line\fP In case of error and non-NULL, the line number within the \fIspec\fP file where the error occurred\&. The first line number in the file is 1\&. 
.br
\fIerr_msg\fP In case of error and non-NULL, the error message\&. 
.RE
.PP
\fBReturns\fP
.RS 4
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\&. 
.RE
.PP

.SS "__rte_experimental int rte_swx_pipeline_build_from_lib (struct rte_swx_pipeline ** p, const char * name, const char * lib_file_name, FILE * iospec_file, int numa_node)"
Pipeline build from shared object library

.PP
The shared object library must be built from the C language source code file previously generated by the \fBrte_swx_pipeline_codegen()\fP API function\&.

.PP
The pipeline I/O specification file defines the I/O ports of the pipeline\&.

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. Must point to valid memory\&. Contains valid pipeline handle when the function returns successfully\&. 
.br
\fIname\fP Pipeline unique name\&. 
.br
\fIlib_file_name\fP Shared object library file name\&. 
.br
\fIiospec_file\fP Pipeline I/O specification file\&. 
.br
\fInuma_node\fP Non-Uniform Memory Access (NUMA) node\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Pipeline with this name already exists; -ENODEV: Extern object or table creation error\&. 
.RE
.PP

.SS "__rte_experimental void rte_swx_pipeline_run (struct rte_swx_pipeline * p, uint32_t n_instructions)"
Pipeline run

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.br
\fIn_instructions\fP Number of instructions to execute\&. 
.RE
.PP

.SS "__rte_experimental void rte_swx_pipeline_flush (struct rte_swx_pipeline * p)"
Pipeline flush

.PP
Flush all output ports of the pipeline\&.

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. If p is NULL, no operation is performed\&. 
.RE
.PP

.SS "__rte_experimental void rte_swx_pipeline_free (struct rte_swx_pipeline * p)"
Pipeline free

.PP
\fBParameters\fP
.RS 4
\fIp\fP Pipeline handle\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
