---
name: "rte_table_action_table_params_get"
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_table_action.h"
---

# rte\_table\_action\_table\_params\_get(3)

Part of [rte\_table\_action.h(3)](/rte_table_action.h/3.md).

## NAME

rte\_table\_action.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_compat.h>`\
 `#include <rte_ether.h>`\
 `#include <rte_ip6.h>`\
 `#include <rte_meter.h>`\
 `#include <rte_table_hash.h>`\
 `#include 'rte_pipeline.h'`\

### Data Structures

struct **rte\_table\_action\_common\_config**\
 struct **rte\_table\_action\_fwd\_params**\
 struct **rte\_table\_action\_lb\_config**\
 struct **rte\_table\_action\_lb\_params**\
 struct **rte\_table\_action\_dscp\_table\_entry**\
 struct **rte\_table\_action\_dscp\_table**\
 struct **rte\_table\_action\_meter\_profile**\
 struct **rte\_table\_action\_mtr\_tc\_params**\
 struct **rte\_table\_action\_mtr\_counters\_tc**\
 struct **rte\_table\_action\_mtr\_config**\
 struct **rte\_table\_action\_mtr\_params**\
 struct **rte\_table\_action\_mtr\_counters**\
 struct **rte\_table\_action\_tm\_config**\
 struct **rte\_table\_action\_tm\_params**\
 struct **rte\_table\_action\_ether\_hdr**\
 struct **rte\_table\_action\_vlan\_hdr**\
 struct **rte\_table\_action\_mpls\_hdr**\
 struct **rte\_table\_action\_pppoe\_hdr**\
 struct **rte\_table\_action\_ipv4\_header**\
 struct **rte\_table\_action\_ipv6\_header**\
 struct **rte\_table\_action\_udp\_header**\
 struct **rte\_table\_action\_vxlan\_hdr**\
 struct **rte\_table\_action\_encap\_ether\_params**\
 struct **rte\_table\_action\_encap\_vlan\_params**\
 struct **rte\_table\_action\_encap\_qinq\_params**\
 struct **rte\_table\_action\_encap\_mpls\_params**\
 struct **rte\_table\_action\_encap\_pppoe\_params**\
 struct **rte\_table\_action\_encap\_vxlan\_params**\
 struct **rte\_table\_action\_encap\_config**\
 struct **rte\_table\_encap\_ether\_qinq\_pppoe**\
 struct **rte\_table\_action\_encap\_params**\
 struct **rte\_table\_action\_nat\_config**\
 struct **rte\_table\_action\_nat\_params**\
 struct **rte\_table\_action\_ttl\_config**\
 struct **rte\_table\_action\_ttl\_params**\
 struct **rte\_table\_action\_ttl\_counters**\
 struct **rte\_table\_action\_stats\_config**\
 struct **rte\_table\_action\_stats\_params**\
 struct **rte\_table\_action\_stats\_counters**\
 struct **rte\_table\_action\_time\_params**\
 struct **rte\_table\_action\_vlo**\
 struct **rte\_table\_action\_sym\_crypto\_config**\
 struct **rte\_table\_action\_sym\_crypto\_params**\
 struct **rte\_table\_action\_tag\_params**\
 struct **rte\_table\_action\_decap\_params**\

### Macros

\#define **RTE\_TABLE\_ACTION\_LB\_KEY\_SIZE\_MIN**   8\
 \#define **RTE\_TABLE\_ACTION\_LB\_KEY\_SIZE\_MAX**   64\
 \#define **RTE\_TABLE\_ACTION\_LB\_TABLE\_SIZE**   8\
 \#define **RTE\_TABLE\_ACTION\_TC\_MAX**   16\
 \#define **RTE\_TABLE\_ACTION\_TC\_QUEUE\_MAX**   16\
 \#define **RTE\_TABLE\_ACTION\_MPLS\_LABELS\_MAX**   4\
 \#define **RTE\_TABLE\_ACTION\_SYM\_CRYPTO\_IV\_SIZE\_MAX**   (16)\

### Enumerations

enum **rte\_table\_action\_type** { **RTE\_TABLE\_ACTION\_FWD** = 0, **RTE\_TABLE\_ACTION\_LB**, **RTE\_TABLE\_ACTION\_MTR**, **RTE\_TABLE\_ACTION\_TM**, **RTE\_TABLE\_ACTION\_ENCAP**, **RTE\_TABLE\_ACTION\_NAT**, **RTE\_TABLE\_ACTION\_TTL**, **RTE\_TABLE\_ACTION\_STATS**, **RTE\_TABLE\_ACTION\_TIME**, **RTE\_TABLE\_ACTION\_SYM\_CRYPTO**, **RTE\_TABLE\_ACTION\_TAG**, **RTE\_TABLE\_ACTION\_DECAP** }\
 enum **rte\_table\_action\_meter\_algorithm** { **RTE\_TABLE\_ACTION\_METER\_SRTCM**, **RTE\_TABLE\_ACTION\_METER\_TRTCM** }\
 enum **rte\_table\_action\_policer** { **RTE\_TABLE\_ACTION\_POLICER\_COLOR\_GREEN** = 0, **RTE\_TABLE\_ACTION\_POLICER\_COLOR\_YELLOW**, **RTE\_TABLE\_ACTION\_POLICER\_COLOR\_RED**, **RTE\_TABLE\_ACTION\_POLICER\_DROP**, **RTE\_TABLE\_ACTION\_POLICER\_MAX** }\
 enum **rte\_table\_action\_encap\_type** { **RTE\_TABLE\_ACTION\_ENCAP\_ETHER** = 0, **RTE\_TABLE\_ACTION\_ENCAP\_VLAN**, **RTE\_TABLE\_ACTION\_ENCAP\_QINQ**, **RTE\_TABLE\_ACTION\_ENCAP\_MPLS**, **RTE\_TABLE\_ACTION\_ENCAP\_PPPOE**, **RTE\_TABLE\_ACTION\_ENCAP\_VXLAN**, **RTE\_TABLE\_ACTION\_ENCAP\_QINQ\_PPPOE** }\

### Functions

\_\_rte\_experimental struct rte\_table\_action\_profile \* **rte\_table\_action\_profile\_create** (struct **rte\_table\_action\_common\_config** \*common)\
 \_\_rte\_experimental int **rte\_table\_action\_profile\_free** (struct rte\_table\_action\_profile \*profile)\
 \_\_rte\_experimental int **rte\_table\_action\_profile\_action\_register** (struct rte\_table\_action\_profile \*profile, enum **rte\_table\_action\_type** type, void \*action\_config)\
 \_\_rte\_experimental int **rte\_table\_action\_profile\_freeze** (struct rte\_table\_action\_profile \*profile)\
 \_\_rte\_experimental struct rte\_table\_action \* **rte\_table\_action\_create** (struct rte\_table\_action\_profile \*profile, uint32\_t socket\_id)\
 \_\_rte\_experimental int **rte\_table\_action\_free** (struct rte\_table\_action \*action)\
 \_\_rte\_experimental int **rte\_table\_action\_table\_params\_get** (struct rte\_table\_action \*action, struct **rte\_pipeline\_table\_params** \*params)\
 \_\_rte\_experimental int **rte\_table\_action\_apply** (struct rte\_table\_action \*action, void \*data, enum **rte\_table\_action\_type** type, void \*action\_params)\
 \_\_rte\_experimental int **rte\_table\_action\_dscp\_table\_update** (struct rte\_table\_action \*action, uint64\_t dscp\_mask, struct **rte\_table\_action\_dscp\_table** \*table)\
 \_\_rte\_experimental int **rte\_table\_action\_meter\_profile\_add** (struct rte\_table\_action \*action, uint32\_t meter\_profile\_id, struct **rte\_table\_action\_meter\_profile** \*profile)\
 \_\_rte\_experimental int **rte\_table\_action\_meter\_profile\_delete** (struct rte\_table\_action \*action, uint32\_t meter\_profile\_id)\
 \_\_rte\_experimental int **rte\_table\_action\_meter\_read** (struct rte\_table\_action \*action, void \*data, uint32\_t tc\_mask, struct **rte\_table\_action\_mtr\_counters** \*stats, int clear)\
 \_\_rte\_experimental int **rte\_table\_action\_ttl\_read** (struct rte\_table\_action \*action, void \*data, struct **rte\_table\_action\_ttl\_counters** \*stats, int clear)\
 \_\_rte\_experimental int **rte\_table\_action\_stats\_read** (struct rte\_table\_action \*action, void \*data, struct **rte\_table\_action\_stats\_counters** \*stats, int clear)\
 \_\_rte\_experimental int **rte\_table\_action\_time\_read** (struct rte\_table\_action \*action, void \*data, uint64\_t \*timestamp)\
 \_\_rte\_experimental struct rte\_cryptodev\_sym\_session \* **rte\_table\_action\_crypto\_sym\_session\_get** (struct rte\_table\_action \*action, void \*data)\

## Detailed Description

RTE Pipeline Table Actions

This API provides a common set of actions for pipeline tables to speed up application development.

Each match-action rule added to a pipeline table has associated data that stores the action context. This data is input to the table action handler called for every input packet that hits the rule as part of the table lookup during the pipeline execution. The pipeline library allows the user to define his own table actions by providing customized table action handlers (table lookup) and complete freedom of setting the rules and their data (table rule add/delete). While the user can still follow this process, this API is intended to provide a quicker development alternative for a set of predefined actions.

The typical steps to use this API are:

- •

  Define a table action profile. This is a configuration template that can potentially be shared by multiple tables from the same or different pipelines, with different tables from the same pipeline likely to use different action profiles. For every table using a given action profile, the profile defines the set of actions and the action configuration to be implemented for all the table rules. API functions: **rte\_table\_action\_profile\_create()**, **rte\_table\_action\_profile\_action\_register()**, **rte\_table\_action\_profile\_freeze()**.

- •

  Instantiate the table action profile to create table action objects. Each pipeline table has its own table action object. API functions: **rte\_table\_action\_create()**.

- •

  Use the table action object to generate the pipeline table action handlers (invoked by the pipeline table lookup operation). API functions: **rte\_table\_action\_table\_params\_get()**.

- •

  Use the table action object to generate the rule data (for the pipeline table rule add operation) based on given action parameters. API functions: **rte\_table\_action\_apply()**.

- •

  Use the table action object to read action data (e.g. stats counters) for any given rule. API functions: rte\_table\_action\_XYZ\_read().

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

Definition in file **rte\_table\_action.h**.

## Macro Definition Documentation

### #define RTE\_TABLE\_ACTION\_LB\_KEY\_SIZE\_MIN 8

RTE\_TABLE\_ACTION\_LB Load balance key size min (number of bytes).

Definition at line **137** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_LB\_KEY\_SIZE\_MAX 64

Load balance key size max (number of bytes).

Definition at line **140** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_LB\_TABLE\_SIZE 8

Load balance table size.

Definition at line **143** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_TC\_MAX 16

RTE\_TABLE\_ACTION\_MTR Max number of traffic classes (TCs).

Definition at line **185** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_TC\_QUEUE\_MAX 16

Max number of queues per traffic class.

Definition at line **188** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_MPLS\_LABELS\_MAX 4

Max number of MPLS labels per output packet for MPLS encapsulation.

Definition at line **461** of file **rte\_table\_action.h**.

### #define RTE\_TABLE\_ACTION\_SYM\_CRYPTO\_IV\_SIZE\_MAX (16)

RTE\_TABLE\_ACTION\_CRYPTO

Definition at line **709** of file **rte\_table\_action.h**.

## Enumeration Type Documentation

### enum rte\_table\_action\_type

Table actions.

**Enumerator**

- *RTE\_TABLE\_ACTION\_FWD*

  *Forward to next pipeline table, output port or drop.*

- *RTE\_TABLE\_ACTION\_LB*

  *Load balance.*

- *RTE\_TABLE\_ACTION\_MTR*

  *Traffic Metering and Policing.*

- *RTE\_TABLE\_ACTION\_TM*

  *Traffic Management.*

- *RTE\_TABLE\_ACTION\_ENCAP*

  *Packet encapsulations.*

- *RTE\_TABLE\_ACTION\_NAT*

  *Network Address Translation (NAT).*

- *RTE\_TABLE\_ACTION\_TTL*

  *Time to Live (TTL) update.*

- *RTE\_TABLE\_ACTION\_STATS*

  *Statistics.*

- *RTE\_TABLE\_ACTION\_TIME*

  *Timestamp.*

- *RTE\_TABLE\_ACTION\_SYM\_CRYPTO*

  *Crypto.*

- *RTE\_TABLE\_ACTION\_TAG*

  *Tag.*

- *RTE\_TABLE\_ACTION\_DECAP*

  *Packet decapsulations.*

*Definition at line* **70** *of file* **rte\_table\_action.h***.*

### enum rte\_table\_action\_meter\_algorithm

*Supported traffic metering algorithms.*

**Enumerator**

- *RTE\_TABLE\_ACTION\_METER\_SRTCM*

  *Single Rate Three Color Marker (srTCM) - IETF RFC 2697.*

- *RTE\_TABLE\_ACTION\_METER\_TRTCM*

  *Two Rate Three Color Marker (trTCM) - IETF RFC 2698.*

*Definition at line* **216** *of file* **rte\_table\_action.h***.*

### enum rte\_table\_action\_policer

*Policer actions.*

**Enumerator**

- *RTE\_TABLE\_ACTION\_POLICER\_COLOR\_GREEN*

  *Recolor the packet as green.*

- *RTE\_TABLE\_ACTION\_POLICER\_COLOR\_YELLOW*

  *Recolor the packet as yellow.*

- *RTE\_TABLE\_ACTION\_POLICER\_COLOR\_RED*

  *Recolor the packet as red.*

- *RTE\_TABLE\_ACTION\_POLICER\_DROP*

  *Drop the packet.*

- *RTE\_TABLE\_ACTION\_POLICER\_MAX*

  *Number of policer actions.*

*Definition at line* **239** *of file* **rte\_table\_action.h***.*

### enum rte\_table\_action\_encap\_type

*RTE\_TABLE\_ACTION\_ENCAP Supported packet encapsulation types.*

**Enumerator**

- *RTE\_TABLE\_ACTION\_ENCAP\_ETHER*

  *IP -\> { Ether \| IP }*

- *RTE\_TABLE\_ACTION\_ENCAP\_VLAN*

  *IP -\> { Ether \| VLAN \| IP }*

- *RTE\_TABLE\_ACTION\_ENCAP\_QINQ*

  *IP -\> { Ether \| S-VLAN \| C-VLAN \| IP }*

- *RTE\_TABLE\_ACTION\_ENCAP\_MPLS*

  *IP -\> { Ether \| MPLS \| IP }*

- *RTE\_TABLE\_ACTION\_ENCAP\_PPPOE*

  *IP -\> { Ether \| PPPoE \| PPP \| IP }*

- *RTE\_TABLE\_ACTION\_ENCAP\_VXLAN*

  *Ether -\> { Ether \| IP \| UDP \| VXLAN \| Ether } Ether -\> { Ether \| VLAN \| IP \| UDP \| VXLAN \| Ether }*

- *RTE\_TABLE\_ACTION\_ENCAP\_QINQ\_PPPOE*

  *IP -\> { Ether \| S-VLAN \| C-VLAN \| PPPoE \| PPP \| IP }*

*Definition at line* **363** *of file* **rte\_table\_action.h***.*

## Function Documentation

### \_\_rte\_experimental struct rte\_table\_action\_profile \* rte\_table\_action\_profile\_create (struct rte\_table\_action\_common\_config \* common)

*Table action profile create.*

**Parameters**

*common Common action configuration.*

**Returns**

*Table action profile handle on success, NULL otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_profile\_free (struct rte\_table\_action\_profile \* profile)

*Table action profile free.*

**Parameters**

*profile Table profile action handle (needs to be valid).*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_profile\_action\_register (struct rte\_table\_action\_profile \* profile, enum rte\_table\_action\_type type, void \* action\_config)

*Table action profile action register.*

**Parameters**

*profile Table profile action handle (needs to be valid and not in frozen state).* \
 *type Specific table action to be registered for profile.* \
 *action\_config Configuration for the type action. If struct rte\_table\_action\_\*type\*\_config is defined by the Table Action API, it needs to point to a valid instance of this structure, otherwise it needs to be set to NULL.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_profile\_freeze (struct rte\_table\_action\_profile \* profile)

*Table action profile freeze.*

*Once this function is called successfully, the given profile enters the frozen state with the following immediate effects: no more actions can be registered for this profile, so the profile can be instantiated to create table action objects.*

**Parameters**

*profile Table profile action handle (needs to be valid and not in frozen state).*

**Returns**

*Zero on success, non-zero error code otherwise.*

**See also**

**rte\_table\_action\_create()**

### \_\_rte\_experimental struct rte\_table\_action \* rte\_table\_action\_create (struct rte\_table\_action\_profile \* profile, uint32\_t socket\_id)

*Table action create.*

*Instantiates the given table action profile to create a table action object.*

**Parameters**

*profile Table profile action handle (needs to be valid and in frozen state).* \
 *socket\_id CPU socket ID where the internal data structures required by the new table action object should be allocated.*

**Returns**

*Handle to table action object on success, NULL on error.*

**See also**

**rte\_table\_action\_create()**

### \_\_rte\_experimental int rte\_table\_action\_free (struct rte\_table\_action \* action)

*Table action free.*

**Parameters**

*action Handle to table action object (needs to be valid).*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_table\_params\_get (struct rte\_table\_action \* action, struct rte\_pipeline\_table\_params \* params)

*Table action table params get.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *params Pipeline table parameters (needs to be pre-allocated).*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_apply (struct rte\_table\_action \* action, void \* data, enum rte\_table\_action\_type type, void \* action\_params)

*Table action apply.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) to apply action type on.* \
 *type Specific table action previously registered for the table action profile of the action object.* \
 *action\_params Parameters for the type action. If struct rte\_table\_action\_\*type\*\_params is defined by the Table Action API, it needs to point to a valid instance of this structure, otherwise it needs to be set to NULL.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_dscp\_table\_update (struct rte\_table\_action \* action, uint64\_t dscp\_mask, struct rte\_table\_action\_dscp\_table \* table)

*Table action DSCP table update.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *dscp\_mask 64-bit mask defining the DSCP table entries to be updated. If bit N is set in this bit mask, then DSCP table entry N is to be updated, otherwise not.* \
 *table DSCP table.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_meter\_profile\_add (struct rte\_table\_action \* action, uint32\_t meter\_profile\_id, struct rte\_table\_action\_meter\_profile \* profile)

*Table action meter profile add.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *meter\_profile\_id Meter profile ID to be used for the profile once it is successfully added to the action object (needs to be unused by the set of meter profiles currently registered for the action object).* \
 *profile Meter profile to be added.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_meter\_profile\_delete (struct rte\_table\_action \* action, uint32\_t meter\_profile\_id)

*Table action meter profile delete.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *meter\_profile\_id Meter profile ID of the meter profile to be deleted from the action object (needs to be valid for the action object).*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_meter\_read (struct rte\_table\_action \* action, void \* data, uint32\_t tc\_mask, struct rte\_table\_action\_mtr\_counters \* stats, int clear)

*Table action meter read.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) with meter action previously applied on it.* \
 *tc\_mask Bit mask defining which traffic classes should have the meter stats counters read from data and stored into stats. If bit N is set in this bit mask, then traffic class N is part of this operation, otherwise it is not. If bit N is set in this bit mask, then traffic class N must be one of the traffic classes that are enabled for the meter action in the table action profile used by the action object.* \
 *stats When non-NULL, it points to the area where the meter stats counters read from data are saved. Only the meter stats counters for the tc\_mask traffic classes are read and stored to stats.* \
 *clear When non-zero, the meter stats counters are cleared (i.e. set to zero), otherwise the counters are not modified. When the read operation is enabled (stats is non-NULL), the clear operation is performed after the read operation is completed.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_ttl\_read (struct rte\_table\_action \* action, void \* data, struct rte\_table\_action\_ttl\_counters \* stats, int clear)

*Table action TTL read.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) with TTL action previously applied on it.* \
 *stats When non-NULL, it points to the area where the TTL stats counters read from data are saved.* \
 *clear When non-zero, the TTL stats counters are cleared (i.e. set to zero), otherwise the counters are not modified. When the read operation is enabled (stats is non-NULL), the clear operation is performed after the read operation is completed.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_stats\_read (struct rte\_table\_action \* action, void \* data, struct rte\_table\_action\_stats\_counters \* stats, int clear)

*Table action stats read.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) with stats action previously applied on it.* \
 *stats When non-NULL, it points to the area where the stats counters read from data are saved.* \
 *clear When non-zero, the stats counters are cleared (i.e. set to zero), otherwise the counters are not modified. When the read operation is enabled (stats is non-NULL), the clear operation is performed after the read operation is completed.*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental int rte\_table\_action\_time\_read (struct rte\_table\_action \* action, void \* data, uint64\_t \* timestamp)

*Table action timestamp read.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) with timestamp action previously applied on it.* \
 *timestamp Pre-allocated memory where the timestamp read from data is saved (has to be non-NULL).*

**Returns**

*Zero on success, non-zero error code otherwise.*

### \_\_rte\_experimental struct rte\_cryptodev\_sym\_session \* rte\_table\_action\_crypto\_sym\_session\_get (struct rte\_table\_action \* action, void \* data)

*Table action cryptodev symmetric session get.*

**Parameters**

*action Handle to table action object (needs to be valid).* \
 *data Data byte array (typically table rule data) with sym crypto action.*

**Returns**

*The pointer to the session on success, NULL otherwise.*

## Author

*Generated automatically by Doxygen for DPDK from the source code.*
