DPDK
20.11.10
|
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <rte_compat.h>
#include "rte_swx_port.h"
#include "rte_swx_table.h"
Go to the source code of this file.
Data Structures | |
struct | rte_swx_ctl_pipeline_info |
struct | rte_swx_ctl_action_info |
struct | rte_swx_ctl_action_arg_info |
struct | rte_swx_ctl_table_info |
struct | rte_swx_ctl_table_match_field_info |
struct | rte_swx_ctl_table_action_info |
struct | rte_swx_table_state |
Macros | |
#define | RTE_SWX_CTL_NAME_SIZE 64 |
Functions | |
__rte_experimental int | rte_swx_ctl_pipeline_info_get (struct rte_swx_pipeline *p, struct rte_swx_ctl_pipeline_info *pipeline) |
__rte_experimental int | rte_swx_ctl_pipeline_numa_node_get (struct rte_swx_pipeline *p, int *numa_node) |
__rte_experimental int | rte_swx_ctl_pipeline_port_in_stats_read (struct rte_swx_pipeline *p, uint32_t port_id, struct rte_swx_port_in_stats *stats) |
__rte_experimental int | rte_swx_ctl_pipeline_port_out_stats_read (struct rte_swx_pipeline *p, uint32_t port_id, struct rte_swx_port_out_stats *stats) |
__rte_experimental int | rte_swx_ctl_action_info_get (struct rte_swx_pipeline *p, uint32_t action_id, struct rte_swx_ctl_action_info *action) |
__rte_experimental int | rte_swx_ctl_action_arg_info_get (struct rte_swx_pipeline *p, uint32_t action_id, uint32_t action_arg_id, struct rte_swx_ctl_action_arg_info *action_arg) |
__rte_experimental int | rte_swx_ctl_table_info_get (struct rte_swx_pipeline *p, uint32_t table_id, struct rte_swx_ctl_table_info *table) |
__rte_experimental int | rte_swx_ctl_table_match_field_info_get (struct rte_swx_pipeline *p, uint32_t table_id, uint32_t match_field_id, struct rte_swx_ctl_table_match_field_info *match_field) |
__rte_experimental int | rte_swx_ctl_table_action_info_get (struct rte_swx_pipeline *p, uint32_t table_id, uint32_t table_action_id, struct rte_swx_ctl_table_action_info *table_action) |
__rte_experimental int | rte_swx_ctl_table_ops_get (struct rte_swx_pipeline *p, uint32_t table_id, struct rte_swx_table_ops *table_ops, int *is_stub) |
__rte_experimental int | rte_swx_pipeline_table_state_get (struct rte_swx_pipeline *p, struct rte_swx_table_state **table_state) |
__rte_experimental int | rte_swx_pipeline_table_state_set (struct rte_swx_pipeline *p, struct rte_swx_table_state *table_state) |
__rte_experimental struct rte_swx_ctl_pipeline * | rte_swx_ctl_pipeline_create (struct rte_swx_pipeline *p) |
__rte_experimental int | rte_swx_ctl_pipeline_table_entry_add (struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry) |
__rte_experimental int | rte_swx_ctl_pipeline_table_default_entry_add (struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry) |
__rte_experimental int | rte_swx_ctl_pipeline_table_entry_delete (struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry) |
__rte_experimental int | rte_swx_ctl_pipeline_commit (struct rte_swx_ctl_pipeline *ctl, int abort_on_fail) |
__rte_experimental void | rte_swx_ctl_pipeline_abort (struct rte_swx_ctl_pipeline *ctl) |
__rte_experimental struct rte_swx_table_entry * | rte_swx_ctl_pipeline_table_entry_read (struct rte_swx_ctl_pipeline *ctl, const char *table_name, const char *string) |
__rte_experimental int | rte_swx_ctl_pipeline_table_fprintf (FILE *f, struct rte_swx_ctl_pipeline *ctl, const char *table_name) |
__rte_experimental void | rte_swx_ctl_pipeline_free (struct rte_swx_ctl_pipeline *ctl) |
RTE SWX Pipeline Control
Definition in file rte_swx_ctl.h.
#define RTE_SWX_CTL_NAME_SIZE 64 |
Name size.
Definition at line 29 of file rte_swx_ctl.h.
__rte_experimental int rte_swx_ctl_pipeline_info_get | ( | struct rte_swx_pipeline * | p, |
struct rte_swx_ctl_pipeline_info * | pipeline | ||
) |
Pipeline info get
[in] | p | Pipeline handle. |
[out] | pipeline | Pipeline info. |
__rte_experimental int rte_swx_ctl_pipeline_numa_node_get | ( | struct rte_swx_pipeline * | p, |
int * | numa_node | ||
) |
Pipeline NUMA node get
[in] | p | Pipeline handle. |
[out] | numa_node | Pipeline NUMA node. |
__rte_experimental int rte_swx_ctl_pipeline_port_in_stats_read | ( | struct rte_swx_pipeline * | p, |
uint32_t | port_id, | ||
struct rte_swx_port_in_stats * | stats | ||
) |
Input port statistics counters read
[in] | p | Pipeline handle. |
[in] | port_id | Port ID (0 .. n_ports_in - 1). |
[out] | stats | Input port stats. |
__rte_experimental int rte_swx_ctl_pipeline_port_out_stats_read | ( | struct rte_swx_pipeline * | p, |
uint32_t | port_id, | ||
struct rte_swx_port_out_stats * | stats | ||
) |
Output port statistics counters read
[in] | p | Pipeline handle. |
[in] | port_id | Port ID (0 .. n_ports_out - 1). |
[out] | stats | Output port stats. |
__rte_experimental int rte_swx_ctl_action_info_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | action_id, | ||
struct rte_swx_ctl_action_info * | action | ||
) |
Action info get
[in] | p | Pipeline handle. |
[in] | action_id | Action ID (0 .. n_actions - 1). |
[out] | action | Action info. |
__rte_experimental int rte_swx_ctl_action_arg_info_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | action_id, | ||
uint32_t | action_arg_id, | ||
struct rte_swx_ctl_action_arg_info * | action_arg | ||
) |
Action argument info get
[in] | p | Pipeline handle. |
[in] | action_id | Action ID (0 .. n_actions - 1). |
[in] | action_arg_id | Action ID (0 .. n_args - 1). |
[out] | action_arg | Action argument info. |
__rte_experimental int rte_swx_ctl_table_info_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | table_id, | ||
struct rte_swx_ctl_table_info * | table | ||
) |
Table info get
[in] | p | Pipeline handle. |
[in] | table_id | Table ID (0 .. n_tables - 1). |
[out] | table | Table info. |
__rte_experimental int rte_swx_ctl_table_match_field_info_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | table_id, | ||
uint32_t | match_field_id, | ||
struct rte_swx_ctl_table_match_field_info * | match_field | ||
) |
Table match field info get
[in] | p | Pipeline handle. |
[in] | table_id | Table ID (0 .. n_tables). |
[in] | match_field_id | Match field ID (0 .. n_match_fields - 1). |
[out] | match_field | Table match field info. |
__rte_experimental int rte_swx_ctl_table_action_info_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | table_id, | ||
uint32_t | table_action_id, | ||
struct rte_swx_ctl_table_action_info * | table_action | ||
) |
Table action info get
[in] | p | Pipeline handle. |
[in] | table_id | Table ID (0 .. n_tables). |
[in] | table_action_id | Action index within the set of table actions (0 .. table n_actions - 1). Not to be confused with the action ID, which works at the pipeline level (0 .. pipeline n_actions - 1), which is precisely what this function returns as part of table_action. |
[out] | table_action | Table action info. |
__rte_experimental int rte_swx_ctl_table_ops_get | ( | struct rte_swx_pipeline * | p, |
uint32_t | table_id, | ||
struct rte_swx_table_ops * | table_ops, | ||
int * | is_stub | ||
) |
Table operations get
[in] | p | Pipeline handle. |
[in] | table_id | Table ID (0 .. n_tables). |
[out] | table_ops | Table operations. Only valid when function returns success and is_stub is zero (false). |
[out] | is_stub | A stub table is a table with no match fields. No "regular" table entries (i.e. entries other than the default entry) can be added to such a table, therefore the lookup operation always results in lookup miss. Non-zero (true) when the current table is a stub table, zero (false) otherwise. |
__rte_experimental int rte_swx_pipeline_table_state_get | ( | struct rte_swx_pipeline * | p, |
struct rte_swx_table_state ** | table_state | ||
) |
Pipeline table state get
[in] | p | Pipeline handle. |
[out] | table_state | After successful execution, the table_state contains the pointer to the current pipeline table state, which is an array of n_tables elements, with array element i containing the state of the i-th pipeline table. The pipeline continues to own all the data structures directly or indirectly referenced by the table_state until the subsequent successful invocation of function rte_swx_pipeline_table_state_set. |
__rte_experimental int rte_swx_pipeline_table_state_set | ( | struct rte_swx_pipeline * | p, |
struct rte_swx_table_state * | table_state | ||
) |
Pipeline table state set
[in] | p | Pipeline handle. |
[out] | table_state | After successful execution, the pipeline table state is updated to this table_state. The ownership of all the data structures directly or indirectly referenced by this table_state is passed from the caller to the pipeline. |
__rte_experimental struct rte_swx_ctl_pipeline* rte_swx_ctl_pipeline_create | ( | struct rte_swx_pipeline * | p | ) |
Pipeline control create
[in] | p | Pipeline handle. |
__rte_experimental int rte_swx_ctl_pipeline_table_entry_add | ( | struct rte_swx_ctl_pipeline * | ctl, |
const char * | table_name, | ||
struct rte_swx_table_entry * | entry | ||
) |
Pipeline table entry add
Schedule entry for addition to table or update as part of the next commit operation.
[in] | ctl | Pipeline control handle. |
[in] | table_name | Table name. |
[in] | entry | Entry to be added to the table. |
__rte_experimental int rte_swx_ctl_pipeline_table_default_entry_add | ( | struct rte_swx_ctl_pipeline * | ctl, |
const char * | table_name, | ||
struct rte_swx_table_entry * | entry | ||
) |
Pipeline table default entry add
Schedule table default entry update as part of the next commit operation.
[in] | ctl | Pipeline control handle. |
[in] | table_name | Table name. |
[in] | entry | The new table default entry. The key and key_mask entry fields are ignored. |
__rte_experimental int rte_swx_ctl_pipeline_table_entry_delete | ( | struct rte_swx_ctl_pipeline * | ctl, |
const char * | table_name, | ||
struct rte_swx_table_entry * | entry | ||
) |
Pipeline table entry delete
Schedule entry for deletion from table as part of the next commit operation. Request is silently discarded if no such entry exists.
[in] | ctl | Pipeline control handle. |
[in] | table_name | Table name. |
[in] | entry | Entry to be deleted from the table. The action_id and action_data entry fields are ignored. |
__rte_experimental int rte_swx_ctl_pipeline_commit | ( | struct rte_swx_ctl_pipeline * | ctl, |
int | abort_on_fail | ||
) |
Pipeline commit
Perform all the scheduled table work.
[in] | ctl | Pipeline control handle. |
[in] | abort_on_fail | When non-zero (false), all the scheduled work is discarded after a failed commit. Otherwise, the scheduled work is still kept pending for the next commit. |
__rte_experimental void rte_swx_ctl_pipeline_abort | ( | struct rte_swx_ctl_pipeline * | ctl | ) |
Pipeline abort
Discard all the scheduled table work.
[in] | ctl | Pipeline control handle. |
__rte_experimental struct rte_swx_table_entry* rte_swx_ctl_pipeline_table_entry_read | ( | struct rte_swx_ctl_pipeline * | ctl, |
const char * | table_name, | ||
const char * | string | ||
) |
Pipeline table entry read
Read table entry from string.
[in] | ctl | Pipeline control handle. |
[in] | table_name | Table name. |
[in] | string | String containing the table entry. |
__rte_experimental int rte_swx_ctl_pipeline_table_fprintf | ( | FILE * | f, |
struct rte_swx_ctl_pipeline * | ctl, | ||
const char * | table_name | ||
) |
Pipeline table print to file
Print all the table entries to file.
[in] | f | Output file. |
[in] | ctl | Pipeline control handle. |
[in] | table_name | Table name. |
__rte_experimental void rte_swx_ctl_pipeline_free | ( | struct rte_swx_ctl_pipeline * | ctl | ) |
Pipeline control free
[in] | ctl | Pipeline control handle. |