---
name: "rte_swx_pipeline_port_in_config"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_swx_pipeline.h"
---

# rte\_swx\_pipeline\_port\_in\_config(3)

Part of [rte\_swx\_pipeline.h(3)](/rte_swx_pipeline.h/3.md).

## NAME

rte\_swx\_pipeline.h

## 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.

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.

### \_\_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)

Pipeline extern type member function register

**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\_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.

**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\_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

**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\_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

**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\_experimental int rte\_swx\_pipeline\_rss\_config (struct rte\_swx\_pipeline \* p, const char \* name)

Pipeline Receive Side Scaling (RSS) object configure

**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\_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\_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

**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\_experimental int rte\_swx\_pipeline\_packet\_metadata\_register (struct rte\_swx\_pipeline \* p, const char \* struct\_type\_name)

Pipeline packet meta-data register

**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\_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:

```
+-----+---------------------------+------------------+-----+-----+
```

```
|     | Description               | Format           | DST | SRC |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| hdr | Header                    | h.header         |     |     |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| act | Action                    | ACTION           |     |     |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| tbl | Table                     | TABLE            |     |     |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| H   | Header field              | h.header.field   | YES | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| M   | Meta-data field           | m.field          | YES | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| E   | Extern obj mailbox field  | e.ext_obj.field  | YES | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| F   | Extern func mailbox field | f.ext_func.field | YES | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| T   | Table action data field   | t.header.field   | NO  | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

```
| I   | Immediate value (64-bit)  | h.header.field   | NO  | YES |
```

```
+-----+---------------------------+------------------+-----+-----+
```

Instruction set:

```
+------------+----------------------+-------------------+------+--------+
```

```
| Instr.     | Instruction          | Instruction       | 1st  | 2nd    |
```

```
| Name       | Description          | Format            | opnd.| opnd.  |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| rx         | Receive one pkt      | rx m.port_in      | M    |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| tx         | Transmit one pkt     | tx m.port_out     | M    |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| extract    | Extract one hdr      | extract h.hdr     | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| emit       | Emit one hdr         | emit h.hdr        | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| validate   | Validate one hdr     | validate h.hdr    | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| invalidate | Invalidate one hdr   | invalidate h.hdr  | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| mov        | dst = src            | mov dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| add        | dst += src           | add dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| sub        | dst -= src           | add dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| ckadd      | Checksum add: dst =  | add dst src       | HMEF | HMEFTI |
```

```
|            | dst '+ src[0:1] '+   |                   |      | or hdr |
```

```
|            | src[2:3] '+ ...      |                   |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| cksub      | Checksum subtract:   | add dst src       | HMEF | HMEFTI |
```

```
|            | dst = dst '- src     |                   |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| and        | dst &= src           | and dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| or         | dst |= src           | or  dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| xor        | dst ^= src           | xor dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| shl        | dst <<= src          | shl dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| shr        | dst >>= src          | shr dst src       | HMEF | HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| table      | Table lookup         | table TABLE       | tbl  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| extern     | Ext obj member func  | extern e.obj.mfunc| ext  |        |
```

```
|            | call or ext func call| extern f.func     |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmp        | Unconditional jump   | jmp LABEL         |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpv       | Jump if hdr is valid | jmpv LABEL h.hdr  | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpnv      | Jump if hdr is inval | jmpnv LABEL h.hdr | hdr  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmph       | Jump if tbl lkp hit  | jmph LABEL        |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpnh      | Jump if tbl lkp miss | jmpnh LABEL       |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpa       | Jump if action run   | jmpa LABEL ACTION | act  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpna      | Jump if act not run  | jmpna LABEL ACTION| act  |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpeq      | Jump if (a == b)     | jmpeq LABEL a b   | HMEFT| HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpneq     | Jump if (a != b)     | jmpneq LABEL a b  | HMEFT| HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmplt      | Jump if (a < b)      | jmplt LABEL a b   | HMEFT| HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| jmpgt      | Jump if (a > b)      | jmpgt LABEL a b   | HMEFT| HMEFTI |
```

```
+------------+----------------------+-------------------+------+--------+
```

```
| return     | Return from action   | return            |      |        |
```

```
+------------+----------------------+-------------------+------+--------+
```

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

**Parameters**

*p* Pipeline handle. \
 *name* Action name. \
 *args\_struct\_type\_name* 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. \
 *instructions* Action instructions. \
 *n\_instructions* Number of action instructions.

**Returns**

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.

### \_\_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* Match type implemented by the new table type. \
 *ops* Table type operations.

**Returns**

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.

### \_\_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* 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. \
 *args* Table creation arguments. \
 *size* Guideline on maximum number of table entries.

**Returns**

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.

### \_\_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 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.

### \_\_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. \
 *timeout* Array of possible table entry timeouts in seconds. Must be non-NULL. \
 *n\_timeouts* Number of elements in the *timeout* array.

**Returns**

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.

### \_\_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. Each register is 64-bit in size. \
 *init\_val* Initial value for every register in the array. The recommended value is 0.

**Returns**

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.

### \_\_rte\_experimental int rte\_swx\_pipeline\_metarray\_config (struct rte\_swx\_pipeline \* p, const char \* name, uint32\_t size)

Pipeline meter array configure

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

**Returns**

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.

### \_\_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 or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory.

### \_\_rte\_experimental int rte\_swx\_pipeline\_build (struct rte\_swx\_pipeline \* p)

Pipeline build

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.

**Parameters**

*p* Pipeline handle.

**Returns**

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.

### \_\_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* Pipeline specification file (.spec) provided as input. \
 *code\_file* Pipeline C language file (.c) to be generated. \
 *err\_line* In case of error and non-NULL, the line number within the *spec* file where the error occurred. The first line number in the file is 1. \
 *err\_msg* In case of error and non-NULL, the error message.

**Returns**

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.

### \_\_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 previously generated by the **rte\_swx\_pipeline\_codegen()** API function.

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

**Parameters**

*p* Pipeline handle. Must point to valid memory. Contains valid pipeline handle when the function returns successfully. \
 *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 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.

### \_\_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.

### \_\_rte\_experimental void rte\_swx\_pipeline\_flush (struct rte\_swx\_pipeline \* p)

Pipeline flush

Flush all output ports of the pipeline.

**Parameters**

*p* Pipeline handle. If p is NULL, no operation is performed.

### \_\_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.
