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_params
  • struct rte_swx_field_params
  • struct rte_swx_match_field_params
  • struct rte_swx_pipeline_table_params
  • struct rte_swx_pipeline_selector_params
  • struct 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 between 0 and n_bits bits, with its actual size determined at run-time for each packet. If zero (false), then the last field has a constant size of n_bits bits.

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: YES
  • M β€” Meta-data field β€” format: m.field β€” DST: YES β€” SRC: YES
  • E β€” Extern obj mailbox field β€” format: e.ext_obj.field β€” DST: YES β€” SRC: YES
  • F β€” Extern func mailbox field β€” format: f.ext_func.field β€” DST: YES β€” SRC: YES
  • T β€” Table action data field β€” format: t.header.field β€” DST: NO β€” SRC: YES
  • I β€” 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: HMEFTI
  • add β€” dst += src β€” format: add dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • sub β€” dst -= src β€” format: add dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • ckadd β€” Checksum add: dst = dst '+ src[0:1] '+ src[2:3] '+ ... β€” format: add dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI or hdr
  • cksub β€” Checksum subtract: dst = dst '- src β€” format: add dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • and β€” dst &= src β€” format: and dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • or β€” dst |= src β€” format: or dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • xor β€” dst ^= src β€” format: xor dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • shl β€” dst <<= src β€” format: shl dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • shr β€” dst >>= src β€” format: shr dst src β€” 1st opnd: HMEF β€” 2nd opnd: HMEFTI
  • table β€” 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.mfunc or extern 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 when a == b. Syntax: jmpeq LABEL a b. Extra columns: HMEFT, HMEFTI.
  • jmpneq β€” jump when a != b. Syntax: jmpneq LABEL a b. Extra columns: HMEFT, HMEFTI.
  • jmplt β€” jump when a < b. Syntax: jmplt LABEL a b. Extra columns: HMEFT, HMEFTI.
  • jmpgt β€” jump when a > 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 to NULL when 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 to NULL. 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 the timeout array.

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 is 0.

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 is 1.
  • 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. If p is NULL, 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