---
name: "rte_port_in_action_profile_create"
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_port_in_action.h"
---

# rte\_port\_in\_action\_profile\_create(3)

Part of [rte\_port\_in\_action.h(3)](/rte_port_in_action.h/3.md).

## NAME

rte\_port\_in\_action.h

## SYNOPSIS

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

### Data Structures

struct **rte\_port\_in\_action\_fltr\_config**\
 struct **rte\_port\_in\_action\_fltr\_params**\
 struct **rte\_port\_in\_action\_lb\_config**\
 struct **rte\_port\_in\_action\_lb\_params**\

### Macros

\#define **RTE\_PORT\_IN\_ACTION\_FLTR\_KEY\_SIZE**   16\
 \#define **RTE\_PORT\_IN\_ACTION\_LB\_KEY\_SIZE\_MIN**   8\
 \#define **RTE\_PORT\_IN\_ACTION\_LB\_KEY\_SIZE\_MAX**   64\
 \#define **RTE\_PORT\_IN\_ACTION\_LB\_TABLE\_SIZE**   16\

### Enumerations

enum **rte\_port\_in\_action\_type** { **RTE\_PORT\_IN\_ACTION\_FLTR** = 0, **RTE\_PORT\_IN\_ACTION\_LB** }\

### Functions

\_\_rte\_experimental struct rte\_port\_in\_action\_profile \* **rte\_port\_in\_action\_profile\_create** (uint32\_t socket\_id)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_profile\_free** (struct rte\_port\_in\_action\_profile \*profile)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_profile\_action\_register** (struct rte\_port\_in\_action\_profile \*profile, enum **rte\_port\_in\_action\_type** type, void \*action\_config)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_profile\_freeze** (struct rte\_port\_in\_action\_profile \*profile)\
 \_\_rte\_experimental struct rte\_port\_in\_action \* **rte\_port\_in\_action\_create** (struct rte\_port\_in\_action\_profile \*profile, uint32\_t socket\_id)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_free** (struct rte\_port\_in\_action \*action)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_params\_get** (struct rte\_port\_in\_action \*action, struct **rte\_pipeline\_port\_in\_params** \*params)\
 \_\_rte\_experimental int **rte\_port\_in\_action\_apply** (struct rte\_port\_in\_action \*action, enum **rte\_port\_in\_action\_type** type, void \*action\_params)\

## Detailed Description

RTE Pipeline Input Port Actions

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

Each pipeline input port can be assigned an action handler to be executed on every input packet during the pipeline execution. The pipeline library allows the user to define his own input port actions by providing customized input port action handler. 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 an input port action profile. This is a configuration template that can potentially be shared by multiple input ports from the same or different pipelines, with different input ports from the same pipeline able to use different action profiles. For every input port using a given action profile, the profile defines the set of actions and the action configuration to be executed by the input port. API functions: **rte\_port\_in\_action\_profile\_create()**, **rte\_port\_in\_action\_profile\_action\_register()**, **rte\_port\_in\_action\_profile\_freeze()**.

- •

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

- •

  Use the input port action object to generate the input port action handler invoked by the pipeline. API functions: **rte\_port\_in\_action\_params\_get()**.

- •

  Use the input port action object to generate the internal data structures used by the input port action handler based on given action parameters. API functions: **rte\_port\_in\_action\_apply()**.

**Warning**

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

Definition in file **rte\_port\_in\_action.h**.

## Macro Definition Documentation

### #define RTE\_PORT\_IN\_ACTION\_FLTR\_KEY\_SIZE 16

RTE\_PORT\_IN\_ACTION\_FLTR Filter key size (number of bytes)

Definition at line **73** of file **rte\_port\_in\_action.h**.

### #define RTE\_PORT\_IN\_ACTION\_LB\_KEY\_SIZE\_MIN 8

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

Definition at line **113** of file **rte\_port\_in\_action.h**.

### #define RTE\_PORT\_IN\_ACTION\_LB\_KEY\_SIZE\_MAX 64

Load balance key size max (number of bytes).

Definition at line **116** of file **rte\_port\_in\_action.h**.

### #define RTE\_PORT\_IN\_ACTION\_LB\_TABLE\_SIZE 16

Load balance table size.

Definition at line **119** of file **rte\_port\_in\_action.h**.

## Enumeration Type Documentation

### enum rte\_port\_in\_action\_type

Input port actions.

**Enumerator**

- *RTE\_PORT\_IN\_ACTION\_FLTR*

  *Filter selected input packets.*

- *RTE\_PORT\_IN\_ACTION\_LB*

  *Load balance.*

*Definition at line* **61** *of file* **rte\_port\_in\_action.h***.*

## Function Documentation

### \_\_rte\_experimental struct rte\_port\_in\_action\_profile \* rte\_port\_in\_action\_profile\_create (uint32\_t socket\_id)

*Input port action profile create.*

**Parameters**

*socket\_id CPU socket ID for the internal data structures memory allocation.*

**Returns**

*Input port action profile handle on success, NULL otherwise.*

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

*Input port action profile free.*

**Parameters**

*profile Input port action profile handle (needs to be valid). If profile is NULL, no operation is performed.*

**Returns**

*Always zero.*

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

*Input port action profile action register.*

**Parameters**

*profile Input port action profile handle (needs to be valid and not in frozen state).* \
 *type Specific input port action to be registered for profile.* \
 *action\_config Configuration for the type action. If struct rte\_port\_in\_action\_\*type\*\_config is defined, 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\_port\_in\_action\_profile\_freeze (struct rte\_port\_in\_action\_profile \* profile)

*Input port 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 input port action objects.*

**Parameters**

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

**Returns**

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

**See also**

**rte\_port\_in\_action\_create()**

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

*Input port action create.*

*Instantiates the given input port action profile to create an input port action object.*

**Parameters**

*profile Input port 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 input port action object should be allocated.*

**Returns**

*Handle to input port action object on success, NULL on error.*

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

*Input port action free.*

**Parameters**

*action Handle to input port action object (needs to be valid). If action is NULL, no operation is performed.*

**Returns**

*Always zero.*

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

*Input port params get.*

**Parameters**

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

**Returns**

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

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

*Input port action apply.*

**Parameters**

*action Handle to input port action object (needs to be valid).* \
 *type Specific input port action previously registered for the input port action profile of the action object.* \
 *action\_params Parameters for the type action. If struct rte\_port\_in\_action\_\*type\*\_params is defined, 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.*

## Author

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