rte_swx_pipeline.h(3)
β¨ rte_swx_pipeline.h β¨
okay bestie, sit down, hydrate, because we're about to get into rte_swx_pipeline.h β the RTE SWX Pipeline library functions manual π
it's a whole header file of pipeline management and it's giving iconic. this is part 1 of 3 so buckle up, we're not done yet π
πΈ NAME πΈ
rte_swx_pipeline.h β no cap, that's literally the name, that's the whole vibe π¦
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <stdio.h>
#include <rte_compat.h>
#include 'rte_swx_port.h'
#include 'rte_swx_table.h'
#include 'rte_swx_extern.h'
π§ Data Structures
struct rte_swx_pipeline_mirroring_paramsstruct rte_swx_field_paramsstruct rte_swx_match_field_paramsstruct rte_swx_pipeline_table_paramsstruct rte_swx_pipeline_selector_paramsstruct rte_swx_pipeline_learner_params
π Macros
#define RTE_SWX_NAME_SIZE 64#define RTE_SWX_INSTRUCTION_SIZE 256#define RTE_SWX_INSTRUCTION_TOKENS_MAX 16#define RTE_SWX_PACKET_MIRRORING_SLOTS_DEFAULT 4#define RTE_SWX_PACKET_MIRRORING_SESSIONS_DEFAULT 64
π Functions
__rte_experimental struct rte_swx_pipeline * rte_swx_pipeline_find
(const char *name)
__rte_experimental int rte_swx_pipeline_config (struct rte_swx_pipeline
**p, const char *name, int numa_node)
__rte_experimental int rte_swx_pipeline_port_in_type_register (struct
rte_swx_pipeline *p, const char *name, struct rte_swx_port_in_ops
*ops)
__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)
__rte_experimental int rte_swx_pipeline_port_out_type_register (struct
rte_swx_pipeline *p, const char *name, struct rte_swx_port_out_ops
*ops)
__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)
__rte_experimental int rte_swx_pipeline_mirroring_config (struct
rte_swx_pipeline *p, struct rte_swx_pipeline_mirroring_params
*params)
__rte_experimental int rte_swx_pipeline_extern_type_register (struct
rte_swx_pipeline *p, const char *name, const char
*mailbox_struct_type_name, rte_swx_extern_type_constructor_t
constructor, rte_swx_extern_type_destructor_t destructor)
__rte_experimental int rte_swx_pipeline_extern_type_member_func_register
(struct rte_swx_pipeline *p, const char *extern_type_name, const
char *name, rte_swx_extern_type_member_func_t member_func)
__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)
__rte_experimental int rte_swx_pipeline_extern_func_register (struct
rte_swx_pipeline *p, const char *name, const char
*mailbox_struct_type_name, rte_swx_extern_func_t func)
__rte_experimental int rte_swx_pipeline_hash_func_register (struct
rte_swx_pipeline *p, const char *name, rte_swx_hash_func_t func)
__rte_experimental int rte_swx_pipeline_rss_config (struct
rte_swx_pipeline *p, const char *name)
__rte_experimental int rte_swx_pipeline_struct_type_register (struct
rte_swx_pipeline *p, const char *name, struct rte_swx_field_params
*fields, uint32_t n_fields, int last_field_has_variable_size)
__rte_experimental int rte_swx_pipeline_packet_header_register (struct
rte_swx_pipeline *p, const char *name, const char *struct_type_name)
__rte_experimental int rte_swx_pipeline_packet_metadata_register (struct
rte_swx_pipeline *p, const char *struct_type_name)
__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)
__rte_experimental int rte_swx_pipeline_table_type_register (struct
rte_swx_pipeline *p, const char *name, enum rte_swx_table_match_type
match_type, struct rte_swx_table_ops *ops)
__rte_experimental int rte_swx_pipeline_table_config (struct
rte_swx_pipeline *p, const char *name, struct
rte_swx_pipeline_table_params *params, const char
*recommended_table_type_name, const char *args, uint32_t size)
__rte_experimental int rte_swx_pipeline_selector_config (struct
rte_swx_pipeline *p, const char *name, struct
rte_swx_pipeline_selector_params *params)
__rte_experimental int rte_swx_pipeline_learner_config (struct
rte_swx_pipeline *p, const char *name, struct
rte_swx_pipeline_learner_params *params, uint32_t size, uint32_t
*timeout, uint32_t n_timeouts)
__rte_experimental int rte_swx_pipeline_regarray_config (struct
rte_swx_pipeline *p, const char *name, uint32_t size, uint64_t
init_val)
__rte_experimental int rte_swx_pipeline_metarray_config (struct
rte_swx_pipeline *p, const char *name, uint32_t size)
__rte_experimental int rte_swx_pipeline_instructions_config (struct
rte_swx_pipeline *p, const char **instructions, uint32_t
n_instructions)
__rte_experimental int rte_swx_pipeline_build (struct rte_swx_pipeline
*p)
__rte_experimental int rte_swx_pipeline_codegen (FILE *spec_file, FILE
*code_file, uint32_t *err_line, const char **err_msg)
__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)
__rte_experimental void rte_swx_pipeline_run (struct rte_swx_pipeline
*p, uint32_t n_instructions)
__rte_experimental void rte_swx_pipeline_flush (struct rte_swx_pipeline
*p)
__rte_experimental void rte_swx_pipeline_free (struct rte_swx_pipeline
*p)
π Detailed Description π
RTE SWX Pipeline π₯
Definition in file rte_swx_pipeline.h.
π«Ά Macro Definition Documentation π«Ά
π #define RTE_SWX_NAME_SIZE 64
Name size. that's it, that's the whole job π
Definition at line 27 of file rte_swx_pipeline.h.
π #define RTE_SWX_INSTRUCTION_SIZE 256
Instruction size.
Definition at line 32 of file rte_swx_pipeline.h.
π #define RTE_SWX_INSTRUCTION_TOKENS_MAX 16
Instruction tokens.
Definition at line 37 of file rte_swx_pipeline.h.
π #define RTE_SWX_PACKET_MIRRORING_SLOTS_DEFAULT 4
Default number of packet mirroring slots.
Definition at line 184 of file rte_swx_pipeline.h.
π #define RTE_SWX_PACKET_MIRRORING_SESSIONS_DEFAULT 64
Default maximum number of packet mirroring sessions.
Definition at line 189 of file rte_swx_pipeline.h.
β Function Documentation β
π¦ __rte_experimental struct rte_swx_pipeline * rte_swx_pipeline_find (const char * name)
Pipeline find π
Parameters
nameβ Pipeline name.
Returns
Valid pipeline handle if found or NULL otherwise.
π¦ __rte_experimental int rte_swx_pipeline_config (struct rte_swx_pipeline ** p, const char * name, int numa_node)
Pipeline configure β¨
Parameters
pβ Pipeline handle. Must point to valid memory. Contains valid pipeline handle when the function returns successfully.nameβ Pipeline unique name.numa_nodeβ Non-Uniform Memory Access (NUMA) node.
Returns
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.
π¦ __rte_experimental int rte_swx_pipeline_port_in_type_register (struct rte_swx_pipeline * p, const char * name, struct rte_swx_port_in_ops * ops)
Pipeline input port type register π₯
Parameters
pβ Pipeline handle.nameβ Input port type name.opsβ Input port type operations.
Returns
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.
π¦ __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 π
Parameters
pβ Pipeline handle.port_idβ Input port ID.port_type_nameβ Existing input port type name.argsβ Input port creation arguments.
Returns
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.
π¦ __rte_experimental int rte_swx_pipeline_port_out_type_register (struct rte_swx_pipeline * p, const char * name, struct rte_swx_port_out_ops * ops)
Pipeline output port type register π€
Parameters
pβ Pipeline handle.nameβ Output port type name.opsβ Output port type operations.
Returns
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.
π¦ __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 π
Parameters
pβ Pipeline handle.port_idβ Output port ID.port_type_nameβ Existing output port type name.argsβ Output port creation arguments.
Returns
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.
π¦ __rte_experimental int rte_swx_pipeline_mirroring_config (struct rte_swx_pipeline * p, struct rte_swx_pipeline_mirroring_params * params)
Packet mirroring configure πͺ
Parameters
pβ Pipeline handle.paramsβ Packet mirroring parameters.
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory; -EEXIST: Pipeline was already built successfully.
π¦ __rte_experimental int rte_swx_pipeline_extern_type_register (struct rte_swx_pipeline * p, const char * name, const char * mailbox_struct_type_name, rte_swx_extern_type_constructor_t constructor, rte_swx_extern_type_destructor_t destructor)
Pipeline extern type register π
Parameters
pβ Pipeline handle.nameβ Extern type name.mailbox_struct_type_nameβ 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.constructorβ Function used to create the extern objects that are instances of this type.destructorβ Function used to free the extern objects that are instances of this type.
Returns
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.
okay bestie that's part 1, but the way there's SO much more where that came from πΈ keep scrolling, we're not even close to done π
β¨ rte_swx_pipeline_extern_type_member_func_register β¨
__rte_experimental int rte_swx_pipeline_extern_type_member_func_register
(struct rte_swx_pipeline * p, const char * extern_type_name, const char
* name, rte_swx_extern_type_member_func_t member_func)
Okay bestie, this is the Pipeline extern type member function register moment. π Itβs literally adding a new member function to an existing extern type.
Parameters:
pβ Pipeline handle.extern_type_nameβ Existing extern type name.nameβ Name for the new member function to be added to the extern type.member_funcβ The new member function.
Returns:
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.
π¦ rte_swx_pipeline_extern_object_config π¦
__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 β instantiate a given extern type to create new extern object. Slay. π
Parameters:
pβ Pipeline handle.extern_type_nameβ Existing extern type name.nameβ Name for the new object instantiating the extern type.argsβ Extern object constructor arguments.
Returns:
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.
πΈ rte_swx_pipeline_extern_func_register πΈ
__rte_experimental int rte_swx_pipeline_extern_func_register (struct
rte_swx_pipeline * p, const char * name, const char *
mailbox_struct_type_name, rte_swx_extern_func_t func)
Pipeline extern function register β because extern functions deserve their own little mailbox era. π¬
Parameters:
pβ Pipeline handle.nameβ Extern function name.mailbox_struct_type_nameβ 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.funcβ The extern function.
Returns:
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.
π rte_swx_pipeline_hash_func_register π
__rte_experimental int rte_swx_pipeline_hash_func_register (struct
rte_swx_pipeline * p, const char * name, rte_swx_hash_func_t func)
Pipeline hash function register β itβs giving βlet me introduce you to my hash function.β β¨
Parameters:
pβ Pipeline handle.nameβ Hash function name.funcβ Hash function.
Returns:
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.
π rte_swx_pipeline_rss_config π
__rte_experimental int rte_swx_pipeline_rss_config (struct rte_swx_pipeline
* p, const char * name)
Pipeline Receive Side Scaling (RSS) object configure β the RSS object is entering the chat. π
Parameters:
pβ Pipeline handle.nameβ Name for the new RSS object.
Returns:
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.
π rte_swx_pipeline_struct_type_register π
__rte_experimental int rte_swx_pipeline_struct_type_register (struct
rte_swx_pipeline * p, const char * name, struct rte_swx_field_params *
fields, uint32_t n_fields, int last_field_has_variable_size)
Pipeline struct type register β 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.
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 n_bits 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.
Parameters:
pβ Pipeline handle.nameβ Struct type name.fieldsβ The sequence of struct fields.n_fieldsβ The number of struct fields.last_field_has_variable_sizeβ If non-zero (true), then the last field has a variable size between0andn_bitsbits, with its actual size determined at run-time for each packet. If zero (false), then the last field has a constant size ofn_bitsbits.
Returns:
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.
π«Ά rte_swx_pipeline_packet_header_register π«Ά
__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 β because every packet header needs a name and a struct type to call home. π
Parameters:
pβ Pipeline handle.nameβ Header name.struct_type_nameβ The struct type instantiated by this packet header.
Returns:
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.
π rte_swx_pipeline_packet_metadata_register π
__rte_experimental int rte_swx_pipeline_packet_metadata_register (struct
rte_swx_pipeline * p, const char * struct_type_name)
Pipeline packet meta-data register β meta-data registration, but make it fashion. β¨
Parameters:
pβ Pipeline handle.struct_type_nameβ The struct type instantiated by the packet meta-data.
Returns:
0 on success or the following error codes otherwise:
-EINVALβ Invalid argument.
π
rte_swx_pipeline_action_config π
__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)
Okay so this one comes with the whole instruction-operand and instruction-set lore. No cap, itβs a lot, but itβs iconic. π§
Instruction operands:
hdrβ Header β format:h.headerβ DST: (none) β SRC: (none)actβ Action β format:ACTIONβ DST: (none) β SRC: (none)tblβ Table β format:TABLEβ DST: (none) β SRC: (none)Hβ Header field β format:h.header.fieldβ DST:YESβ SRC:YESMβ Meta-data field β format:m.fieldβ DST:YESβ SRC:YESEβ Extern obj mailbox field β format:e.ext_obj.fieldβ DST:YESβ SRC:YESFβ Extern func mailbox field β format:f.ext_func.fieldβ DST:YESβ SRC:YESTβ Table action data field β format:t.header.fieldβ DST:NOβ SRC:YESIβ Immediate value (64-bit) β format:h.header.fieldβ DST:NOβ SRC:YES
Instruction set:
rxβ Receive one pkt β format:rx m.port_inβ 1st opnd:Mβ 2nd opnd: (none)txβ Transmit one pkt β format:tx m.port_outβ 1st opnd:Mβ 2nd opnd: (none)extractβ Extract one hdr β format:extract h.hdrβ 1st opnd:hdrβ 2nd opnd: (none)emitβ Emit one hdr β format:emit h.hdrβ 1st opnd:hdrβ 2nd opnd: (none)validateβ Validate one hdr β format:validate h.hdrβ 1st opnd:hdrβ 2nd opnd: (none)invalidateβ Invalidate one hdr β format:invalidate h.hdrβ 1st opnd:hdrβ 2nd opnd: (none)movβdst = srcβ format:mov dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIaddβdst += srcβ format:add dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIsubβdst -= srcβ format:add dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIckaddβ Checksum add:dst = dst '+ src[0:1] '+ src[2:3] '+ ...β format:add dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIorhdrcksubβ Checksum subtract:dst = dst '- srcβ format:add dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIandβdst &= srcβ format:and dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIorβdst |= srcβ format:or dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIxorβdst ^= srcβ format:xor dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIshlβdst <<= srcβ format:shl dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTIshrβdst >>= srcβ format:shr dst srcβ 1st opnd:HMEFβ 2nd opnd:HMEFTItableβ Table lookup β format:table TABLEβ 1st opnd:tblβ 2nd opnd: (none)externβ Ext obj member func call or ext func call β format:extern e.obj.mfuncorextern f.funcβ 1st opnd:extβ 2nd opnd: (none)
β¦and here comes the rest of the jump crew, because of course there's a whole jump crew π same two trailing columns as the table, noted after each one:
jmpβ unconditional jump, no questions asked, we go. Syntax:jmp LABEL. Extra columns: (blank), (blank).jmpvβ jump if the hdr is valid π. Syntax:jmpv LABEL h.hdr. Extra columns:hdr, (blank).jmpnvβ jump if the hdr is inval π. Syntax:jmpnv LABEL h.hdr. Extra columns:hdr, (blank).jmphβ jump if the tbl lkp hit π―. Syntax:jmph LABEL. Extra columns: (blank), (blank).jmpnhβ jump if the tbl lkp missed π. Syntax:jmpnh LABEL. Extra columns: (blank), (blank).jmpaβ jump if the action ran. Syntax:jmpa LABEL ACTION. Extra columns:act, (blank).jmpnaβ jump if the action did not run. Syntax:jmpna LABEL ACTION. Extra columns:act, (blank).jmpeqβ jump whena == b. Syntax:jmpeq LABEL a b. Extra columns:HMEFT,HMEFTI.jmpneqβ jump whena != b. Syntax:jmpneq LABEL a b. Extra columns:HMEFT,HMEFTI.jmpltβ jump whena < b. Syntax:jmplt LABEL a b. Extra columns:HMEFT,HMEFTI.jmpgtβ jump whena > b. Syntax:jmpgt LABEL a b. Extra columns:HMEFT,HMEFTI.returnβ bounce out of the action, bye bestie π«Ά. Syntax:return. Extra columns: (blank), (blank).
At initialization time β that's once, up front, not per-packet β the pipeline instructions and the action instructions (symbolic name operands included, yes even those) get translated into internal data structures, and those are the things that actually get used at run-time. Obsessed with a pre-compile moment ngl β¨
πΈ Pipeline action configure πΈ
Parameters:
pβ pipeline handle.nameβ action name.args_struct_type_nameβ the struct type that the action data instantiates. The action data represents the action arguments, and they're stored in the table entry right next to the action ID. Set this toNULLwhen the action has no arguments whatsoever.instructionsβ action instructions.n_instructionsβ number of action instructions.
Returns: 0 on success, otherwise one of these lil guys:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ an action with this name already exists
π rte_swx_pipeline_table_type_register π
__rte_experimental int rte_swx_pipeline_table_type_register (struct rte_swx_pipeline * p, const char * name, enum rte_swx_table_match_type match_type, struct rte_swx_table_ops * ops)
Pipeline table type register π
Parameters:
pβ pipeline handle.nameβ table type name.match_typeβ the match type that the new table type implements.opsβ table type operations.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a table type with this name already exists
π rte_swx_pipeline_table_config π
__rte_experimental int rte_swx_pipeline_table_config (struct rte_swx_pipeline * p, const char * name, struct rte_swx_pipeline_table_params * params, const char * recommended_table_type_name, const char * args, uint32_t size)
Pipeline table configure β¨
Parameters:
pβ pipeline handle.nameβ table name.paramsβ table parameters.recommended_table_type_nameβ the recommended table type. Typically you set this toNULL. It's useful as guidance when multiple table types are registered for the table's match type (which gets determined from the table's match fields specification). It is silently ignored if the recommended table type doesn't exist or if it serves a different match type β so, no drama, it just doesn't happen.argsβ table creation arguments.sizeβ a guideline on the maximum number of table entries.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a table with this name already exists-ENODEVβ table creation error
π¦ rte_swx_pipeline_selector_config π¦
__rte_experimental int rte_swx_pipeline_selector_config (struct rte_swx_pipeline * p, const char * name, struct rte_swx_pipeline_selector_params * params)
Pipeline selector table configure π«
Parameters:
pβ pipeline handle.nameβ selector table name.paramsβ selector table parameters.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a selector table with this name already exists-ENODEVβ selector table creation error
π rte_swx_pipeline_learner_config π
__rte_experimental int rte_swx_pipeline_learner_config (struct rte_swx_pipeline * p, const char * name, struct rte_swx_pipeline_learner_params * params, uint32_t size, uint32_t * timeout, uint32_t n_timeouts)
Pipeline learner table configure π
Parameters:
pβ pipeline handle.nameβ learner table name.paramsβ learner table parameters.sizeβ the maximum number of table entries. Must be non-zero (no zero-sized learner tables, bestie).timeoutβ array of the possible table entry timeouts, in seconds. Must be non-NULL.n_timeoutsβ number of elements in thetimeoutarray.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a learner table with this name already exists-ENODEVβ learner table creation error
π§ rte_swx_pipeline_regarray_config π§
__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 π
Parameters:
pβ pipeline handle.nameβ register array name.sizeβ number of registers in the array. Every register is 64-bit in size, that's the whole vibe.init_valβ initial value for every single register in the array. The recommended value here is0.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a register array with this name already exists
π₯ rte_swx_pipeline_metarray_config π₯
__rte_experimental int rte_swx_pipeline_metarray_config (struct rte_swx_pipeline * p, const char * name, uint32_t size)
Pipeline meter array configure β (yes, it's spelled metarray in the source, keep it exactly like that, no cap)
Parameters:
pβ pipeline handle.nameβ meter array name.sizeβ 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. Iconic algorithm, honestly.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a meter array with this name already exists
π rte_swx_pipeline_instructions_config π
__rte_experimental int rte_swx_pipeline_instructions_config (struct rte_swx_pipeline * p, const char ** instructions, uint32_t n_instructions)
Pipeline instructions configure β¨
Parameters:
pβ pipeline handle.instructionsβ pipeline instructions.n_instructionsβ number of pipeline instructions.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory
π rte_swx_pipeline_build π
__rte_experimental int rte_swx_pipeline_build (struct rte_swx_pipeline * p)
Pipeline build π¨
The moment you call this, the pipeline build operation marks the end of the pipeline configuration era β configuration arc: complete. At this point, all the internal data structures needed to actually run the pipeline get built. Main character energy for real.
Parameters:
pβ pipeline handle.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ the pipeline was already built successfully (you already did this one, bestie π)
π rte_swx_pipeline_codegen π
__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 πͺ
Parameters:
spec_fileβ the pipeline specification file (.spec), provided as input.code_fileβ the pipeline C language file (.c) that's going to be generated.err_lineβ in case of error, and if it's non-NULL, this is the line number within the spec file where the error happened. The first line number in the file is1.err_msgβ in case of error, and if it's non-NULL, this is the error message.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a resource with the same name already exists
π rte_swx_pipeline_build_from_lib π
__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 π¦
The shared object library must be built from the C language source code file that was previously generated by the rte_swx_pipeline_codegen() API function. That's the whole pipeline, no shortcuts.
The pipeline I/O specification file defines the I/O ports of the pipeline.
Parameters:
pβ pipeline handle. Must point to valid memory. When the function returns successfully, it contains a valid pipeline handle.nameβ pipeline unique name.lib_file_nameβ shared object library file name.iospec_fileβ pipeline I/O specification file.numa_nodeβ Non-Uniform Memory Access (NUMA) node.
Returns: 0 on success, otherwise:
-EINVALβ invalid argument-ENOMEMβ not enough space / cannot allocate memory-EEXISTβ a pipeline with this name already exists-ENODEVβ extern object or table creation error
πββοΈ rte_swx_pipeline_run πββοΈ
__rte_experimental void rte_swx_pipeline_run (struct rte_swx_pipeline * p, uint32_t n_instructions)
Pipeline run π¨
Parameters:
pβ pipeline handle.n_instructionsβ number of instructions to execute.
(it returns void, so there's no return value to check β just go π«Ά)
π rte_swx_pipeline_flush π
__rte_experimental void rte_swx_pipeline_flush (struct rte_swx_pipeline * p)
Pipeline flush πΏ
Flush all the output ports of the pipeline. Every single one.
Parameters:
pβ pipeline handle. IfpisNULL, no operation is performed β nothing happens, we simply do not β
π rte_swx_pipeline_free π
__rte_experimental void rte_swx_pipeline_free (struct rte_swx_pipeline * p)
Pipeline free ποΈ
Parameters:
pβ pipeline handle.
βοΈ Author βοΈ
Generated automatically by Doxygen for DPDK from the source code. Not a human, just Doxygen doing Doxygen things, and honestly? It ate. π
aaaand that's the whole page, bestie, we made it to the end π«Ά the footer says this is DPDK, Version 25.11.3, page rte_swx_pipeline.h(3), date stamp and all β so go build your pipeline, run it, flush it, free it, and slay πβ¨
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms