DPDK  24.11.0-rc3
Data Structures | Macros | Enumerations | Functions
rte_port_in_action.h File Reference
#include <stdint.h>
#include <rte_compat.h>
#include <rte_table_hash.h>
#include "rte_pipeline.h"

Go to the source code of this file.

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:

Warning
EXPERIMENTAL: this API may change without prior notice

Definition in file rte_port_in_action.h.

Macro Definition Documentation

◆ RTE_PORT_IN_ACTION_FLTR_KEY_SIZE

#define RTE_PORT_IN_ACTION_FLTR_KEY_SIZE   16

RTE_PORT_IN_ACTION_FLTRFilter key size (number of bytes)

Examples:
examples/ip_pipeline/cli.c.

Definition at line 73 of file rte_port_in_action.h.

◆ RTE_PORT_IN_ACTION_LB_KEY_SIZE_MIN

#define RTE_PORT_IN_ACTION_LB_KEY_SIZE_MIN   8

RTE_PORT_IN_ACTION_LBLoad balance key size min (number of bytes).

Definition at line 113 of file rte_port_in_action.h.

◆ RTE_PORT_IN_ACTION_LB_KEY_SIZE_MAX

#define RTE_PORT_IN_ACTION_LB_KEY_SIZE_MAX   64

Load balance key size max (number of bytes).

Examples:
examples/ip_pipeline/cli.c.

Definition at line 116 of file rte_port_in_action.h.

◆ RTE_PORT_IN_ACTION_LB_TABLE_SIZE

#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

◆ 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_port_in_action_profile_create()

__rte_experimental struct rte_port_in_action_profile* rte_port_in_action_profile_create ( uint32_t  socket_id)

Input port action profile create.

Parameters
[in]socket_idCPU socket ID for the internal data structures memory allocation.
Returns
Input port action profile handle on success, NULL otherwise.
Examples:
examples/ip_pipeline/action.c.

◆ rte_port_in_action_profile_free()

__rte_experimental int rte_port_in_action_profile_free ( struct rte_port_in_action_profile *  profile)

Input port action profile free.

Parameters
[in]profileInput port action profile handle (needs to be valid). If profile is NULL, no operation is performed.
Returns
Always zero.
Examples:
examples/ip_pipeline/action.c.

◆ rte_port_in_action_profile_action_register()

__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
[in]profileInput port action profile handle (needs to be valid and not in frozen state).
[in]typeSpecific input port action to be registered for profile.
[in]action_configConfiguration 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.
Examples:
examples/ip_pipeline/action.c.

◆ rte_port_in_action_profile_freeze()

__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
[in]profileInput 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()
Examples:
examples/ip_pipeline/action.c.

◆ 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
[in]profileInput port profile action handle (needs to be valid and in frozen state).
[in]socket_idCPU 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.
Examples:
examples/ip_pipeline/pipeline.c.

◆ rte_port_in_action_free()

__rte_experimental int rte_port_in_action_free ( struct rte_port_in_action *  action)

Input port action free.

Parameters
[in]actionHandle to input port action object (needs to be valid). If action is NULL, no operation is performed.
Returns
Always zero.
Examples:
examples/ip_pipeline/pipeline.c.

◆ rte_port_in_action_params_get()

__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
[in]actionHandle to input port action object (needs to be valid).
[in,out]paramsPipeline input port parameters (needs to be pre-allocated).
Returns
Zero on success, non-zero error code otherwise.
Examples:
examples/ip_pipeline/pipeline.c.

◆ rte_port_in_action_apply()

__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
[in]actionHandle to input port action object (needs to be valid).
[in]typeSpecific input port action previously registered for the input port action profile of the action object.
[in]action_paramsParameters 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.