Scroll to navigation

rte_swx_ctl.h(3) DPDK rte_swx_ctl.h(3)

NAME

rte_swx_ctl.h

SYNOPSIS

#include <stdint.h>
#include <stdio.h>
#include <rte_compat.h>
#include <rte_meter.h>
#include 'rte_swx_port.h'
#include 'rte_swx_table.h'

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_stats
struct rte_swx_ctl_selector_info
struct rte_swx_pipeline_selector_stats
struct rte_swx_ctl_learner_info
struct rte_swx_learner_stats
struct rte_swx_pipeline_mirroring_session_params
struct rte_swx_table_state
struct rte_swx_ctl_regarray_info
struct rte_swx_ctl_metarray_info
struct rte_swx_ctl_meter_stats
struct rte_swx_ctl_rss_info

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_ctl_pipeline_table_stats_read (struct rte_swx_pipeline *p, const char *table_name, struct rte_swx_table_stats *stats)
__rte_experimental int rte_swx_ctl_selector_info_get (struct rte_swx_pipeline *p, uint32_t selector_id, struct rte_swx_ctl_selector_info *selector)
__rte_experimental int rte_swx_ctl_selector_group_id_field_info_get (struct rte_swx_pipeline *p, uint32_t selector_id, struct rte_swx_ctl_table_match_field_info *field)
__rte_experimental int rte_swx_ctl_selector_field_info_get (struct rte_swx_pipeline *p, uint32_t selector_id, uint32_t selector_field_id, struct rte_swx_ctl_table_match_field_info *field)
__rte_experimental int rte_swx_ctl_selector_member_id_field_info_get (struct rte_swx_pipeline *p, uint32_t selector_id, struct rte_swx_ctl_table_match_field_info *field)
__rte_experimental int rte_swx_ctl_pipeline_selector_stats_read (struct rte_swx_pipeline *p, const char *selector_name, struct rte_swx_pipeline_selector_stats *stats)
__rte_experimental int rte_swx_ctl_learner_info_get (struct rte_swx_pipeline *p, uint32_t learner_id, struct rte_swx_ctl_learner_info *learner)
__rte_experimental int rte_swx_ctl_learner_match_field_info_get (struct rte_swx_pipeline *p, uint32_t learner_id, uint32_t match_field_id, struct rte_swx_ctl_table_match_field_info *match_field)
__rte_experimental int rte_swx_ctl_learner_action_info_get (struct rte_swx_pipeline *p, uint32_t learner_id, uint32_t learner_action_id, struct rte_swx_ctl_table_action_info *learner_action)
__rte_experimental int rte_swx_ctl_pipeline_learner_timeout_get (struct rte_swx_pipeline *p, uint32_t learner_id, uint32_t timeout_id, uint32_t *timeout)
__rte_experimental int rte_swx_ctl_pipeline_learner_timeout_set (struct rte_swx_pipeline *p, uint32_t learner_id, uint32_t timeout_id, uint32_t timeout)
__rte_experimental int rte_swx_ctl_pipeline_learner_stats_read (struct rte_swx_pipeline *p, const char *learner_name, struct rte_swx_learner_stats *stats)
__rte_experimental int rte_swx_ctl_pipeline_mirroring_session_set (struct rte_swx_pipeline *p, uint32_t session_id, struct rte_swx_pipeline_mirroring_session_params *params)
__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_find (const char *name)
__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_selector_group_add (struct rte_swx_ctl_pipeline *ctl, const char *selector_name, uint32_t *group_id)
__rte_experimental int rte_swx_ctl_pipeline_selector_group_delete (struct rte_swx_ctl_pipeline *ctl, const char *selector_name, uint32_t group_id)
__rte_experimental int rte_swx_ctl_pipeline_selector_group_member_add (struct rte_swx_ctl_pipeline *ctl, const char *selector_name, uint32_t group_id, uint32_t member_id, uint32_t member_weight)
__rte_experimental int rte_swx_ctl_pipeline_selector_group_member_delete (struct rte_swx_ctl_pipeline *ctl, const char *selector_name, uint32_t group_id, uint32_t member_id)
__rte_experimental int rte_swx_ctl_pipeline_learner_default_entry_add (struct rte_swx_ctl_pipeline *ctl, const char *learner_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, int *is_blank_or_comment)
__rte_experimental struct rte_swx_table_entry * rte_swx_ctl_pipeline_learner_default_entry_read (struct rte_swx_ctl_pipeline *ctl, const char *learner_name, const char *string, int *is_blank_or_comment)
__rte_experimental int rte_swx_ctl_pipeline_table_fprintf (FILE *f, struct rte_swx_ctl_pipeline *ctl, const char *table_name)
__rte_experimental int rte_swx_ctl_pipeline_selector_fprintf (FILE *f, struct rte_swx_ctl_pipeline *ctl, const char *selector_name)
__rte_experimental int rte_swx_ctl_regarray_info_get (struct rte_swx_pipeline *p, uint32_t regarray_id, struct rte_swx_ctl_regarray_info *regarray)
__rte_experimental int rte_swx_ctl_pipeline_regarray_read (struct rte_swx_pipeline *p, const char *regarray_name, uint32_t regarray_index, uint64_t *value)
__rte_experimental int rte_swx_ctl_pipeline_regarray_write (struct rte_swx_pipeline *p, const char *regarray_name, uint32_t regarray_index, uint64_t value)
__rte_experimental int rte_swx_ctl_pipeline_regarray_read_with_key (struct rte_swx_pipeline *p, const char *regarray_name, const char *table_name, uint8_t *table_key, uint64_t *value)
__rte_experimental int rte_swx_ctl_pipeline_regarray_write_with_key (struct rte_swx_pipeline *p, const char *regarray_name, const char *table_name, uint8_t *table_key, uint64_t value)
__rte_experimental int rte_swx_ctl_metarray_info_get (struct rte_swx_pipeline *p, uint32_t metarray_id, struct rte_swx_ctl_metarray_info *metarray)
__rte_experimental int rte_swx_ctl_meter_profile_add (struct rte_swx_pipeline *p, const char *name, struct rte_meter_trtcm_params *params)
__rte_experimental int rte_swx_ctl_meter_profile_delete (struct rte_swx_pipeline *p, const char *name)
__rte_experimental int rte_swx_ctl_meter_reset (struct rte_swx_pipeline *p, const char *metarray_name, uint32_t metarray_index)
__rte_experimental int rte_swx_ctl_meter_set (struct rte_swx_pipeline *p, const char *metarray_name, uint32_t metarray_index, const char *profile_name)
__rte_experimental int rte_swx_ctl_meter_stats_read (struct rte_swx_pipeline *p, const char *metarray_name, uint32_t metarray_index, struct rte_swx_ctl_meter_stats *stats)
__rte_experimental int rte_swx_ctl_meter_reset_with_key (struct rte_swx_pipeline *p, const char *metarray_name, const char *table_name, uint8_t *table_key)
__rte_experimental int rte_swx_ctl_meter_set_with_key (struct rte_swx_pipeline *p, const char *metarray_name, const char *table_name, uint8_t *table_key, const char *profile_name)
__rte_experimental int rte_swx_ctl_meter_stats_read_with_key (struct rte_swx_pipeline *p, const char *metarray_name, const char *table_name, uint8_t *table_key, struct rte_swx_ctl_meter_stats *stats)
__rte_experimental int rte_swx_ctl_rss_info_get (struct rte_swx_pipeline *p, uint32_t rss_obj_id, struct rte_swx_ctl_rss_info *rss)
__rte_experimental int rte_swx_ctl_pipeline_rss_key_size_read (struct rte_swx_pipeline *p, const char *rss_obj_name, uint32_t *key_size)
__rte_experimental int rte_swx_ctl_pipeline_rss_key_read (struct rte_swx_pipeline *p, const char *rss_obj_name, uint8_t *key)
__rte_experimental int rte_swx_ctl_pipeline_rss_key_write (struct rte_swx_pipeline *p, const char *rss_obj_name, uint32_t key_size, uint8_t *key)
__rte_experimental void rte_swx_ctl_pipeline_free (struct rte_swx_ctl_pipeline *ctl)

Detailed Description

RTE SWX Pipeline Control

Definition in file rte_swx_ctl.h.

Macro Definition Documentation

#define RTE_SWX_CTL_NAME_SIZE 64

Name size.

Definition at line 29 of file rte_swx_ctl.h.

Function Documentation

__rte_experimental int rte_swx_ctl_pipeline_info_get (struct rte_swx_pipeline * p, struct rte_swx_ctl_pipeline_info * pipeline)

Pipeline info get

Parameters:

p Pipeline handle.
pipeline Pipeline info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_numa_node_get (struct rte_swx_pipeline * p, int * numa_node)

Pipeline NUMA node get

Parameters:

p Pipeline handle.
numa_node Pipeline NUMA node.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
port_id Port ID (0 .. n_ports_in - 1).
stats Input port stats.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
port_id Port ID (0 .. n_ports_out - 1).
stats Output port stats.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
action_id Action ID (0 .. n_actions - 1).
action Action info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
action_id Action ID (0 .. n_actions - 1).
action_arg_id Action ID (0 .. n_args - 1).
action_arg Action argument info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
table_id Table ID (0 .. n_tables - 1).
table Table info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
table_id Table ID (0 .. n_tables).
match_field_id Match field ID (0 .. n_match_fields - 1).
match_field Table match field info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
table_id Table ID (0 .. n_tables).
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.
table_action Table action info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
table_id Table ID (0 .. n_tables).
table_ops Table operations. Only valid when function returns success and is_stub is zero (false).
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.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_table_stats_read (struct rte_swx_pipeline * p, const char * table_name, struct rte_swx_table_stats * stats)

Table statistics counters read

Parameters:

p Pipeline handle.
table_name Table name.
stats Table stats. Must point to a pre-allocated structure. The n_pkts_action field also needs to be pre-allocated as array of pipeline n_actions elements. The pipeline actions that are not valid for the current table have their associated n_pkts_action element always set to zero.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_selector_info_get (struct rte_swx_pipeline * p, uint32_t selector_id, struct rte_swx_ctl_selector_info * selector)

Selector table info get

Parameters:

p Pipeline handle.
selector_id Selector table ID (0 .. n_selectors - 1).
selector Selector table info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_selector_group_id_field_info_get (struct rte_swx_pipeline * p, uint32_t selector_id, struct rte_swx_ctl_table_match_field_info * field)

Selector table 'group ID' field info get

Parameters:

p Pipeline handle.
selector_id Selector table ID (0 .. n_selectors).
field Selector table 'group ID' field info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_selector_field_info_get (struct rte_swx_pipeline * p, uint32_t selector_id, uint32_t selector_field_id, struct rte_swx_ctl_table_match_field_info * field)

Sselector table selector field info get

Parameters:

p Pipeline handle.
selector_id Selector table ID (0 .. n_selectors).
selector_field_id Selector table selector field ID (0 .. n_selector_fields - 1).
field Selector table selector field info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_selector_member_id_field_info_get (struct rte_swx_pipeline * p, uint32_t selector_id, struct rte_swx_ctl_table_match_field_info * field)

Selector table 'member ID' field info get

Parameters:

p Pipeline handle.
selector_id Selector table ID (0 .. n_selectors).
field Selector table 'member ID' field info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_selector_stats_read (struct rte_swx_pipeline * p, const char * selector_name, struct rte_swx_pipeline_selector_stats * stats)

Selector table statistics counters read

Parameters:

p Pipeline handle.
selector_name Selector table name.
stats Selector table stats. Must point to a pre-allocated structure.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_learner_info_get (struct rte_swx_pipeline * p, uint32_t learner_id, struct rte_swx_ctl_learner_info * learner)

Learner table info get

Parameters:

p Pipeline handle.
learner_id Learner table ID (0 .. n_learners - 1).
learner Learner table info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_learner_match_field_info_get (struct rte_swx_pipeline * p, uint32_t learner_id, uint32_t match_field_id, struct rte_swx_ctl_table_match_field_info * match_field)

Learner table match field info get

Parameters:

p Pipeline handle.
learner_id Learner table ID (0 .. n_learners - 1).
match_field_id Match field ID (0 .. n_match_fields - 1).
match_field Learner table match field info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_learner_action_info_get (struct rte_swx_pipeline * p, uint32_t learner_id, uint32_t learner_action_id, struct rte_swx_ctl_table_action_info * learner_action)

Learner table action info get

Parameters:

p Pipeline handle.
learner_id Learner table ID (0 .. n_learners - 1).
learner_action_id Action index within the set of learner table actions (0 .. learner table n_actions - 1). Not to be confused with the pipeline-leve action ID (0 .. pipeline n_actions - 1), which is precisely what this function returns as part of the learner_action.
learner_action Learner action info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_learner_timeout_get (struct rte_swx_pipeline * p, uint32_t learner_id, uint32_t timeout_id, uint32_t * timeout)

Learner table timeout get

Parameters:

p Pipeline handle.
learner_id Learner table ID (0 .. n_learners - 1).
timeout_id Timeout ID.
timeout Timeout value measured in seconds. Must be non-NULL.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_learner_timeout_set (struct rte_swx_pipeline * p, uint32_t learner_id, uint32_t timeout_id, uint32_t timeout)

Learner table timeout set

Parameters:

p Pipeline handle.
learner_id Learner table ID (0 .. n_learners - 1).
timeout_id Timeout ID.
timeout Timeout value measured in seconds.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_learner_stats_read (struct rte_swx_pipeline * p, const char * learner_name, struct rte_swx_learner_stats * stats)

Learner table statistics counters read

Parameters:

p Pipeline handle.
learner_name Learner table name.
stats Learner table stats. Must point to a pre-allocated structure. The n_pkts_action field also needs to be pre-allocated as array of pipeline n_actions elements. The pipeline actions that are not valid for the current learner table have their associated n_pkts_action element always set to zero.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_mirroring_session_set (struct rte_swx_pipeline * p, uint32_t session_id, struct rte_swx_pipeline_mirroring_session_params * params)

Packet mirroring session set

Parameters:

p Pipeline handle.
session_id Packet mirroring session ID.
params Packet mirroring session parameters.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -EEXIST: Pipeline was already built successfully.

__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

Parameters:

p Pipeline handle.
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.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__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

Parameters:

p Pipeline handle.
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.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental struct rte_swx_ctl_pipeline* rte_swx_ctl_pipeline_find (const char * name)

Pipeline control find

Parameters:

name Pipeline name.

Returns:

Valid pipeline control handle if found or NULL otherwise.

__rte_experimental struct rte_swx_ctl_pipeline* rte_swx_ctl_pipeline_create (struct rte_swx_pipeline * p)

Pipeline control create

Parameters:

p Pipeline handle.

Returns:

Pipeline control handle, on success, or NULL, on error.

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

Parameters:

ctl Pipeline control handle.
table_name Table name.
entry Entry to be added to the table.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

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

Parameters:

ctl Pipeline control handle.
table_name Table name.
entry The new table default entry. The key and key_mask entry fields are ignored.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

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

Parameters:

ctl Pipeline control handle.
table_name Table name.
entry Entry to be deleted from the table. The action_id and action_data entry fields are ignored.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_selector_group_add (struct rte_swx_ctl_pipeline * ctl, const char * selector_name, uint32_t * group_id)

Pipeline selector table group add

Add a new group to a selector table. This operation is executed before this function returns and its result is independent of the result of the next commit operation.

Parameters:

ctl Pipeline control handle.
selector_name Selector table name.
group_id The ID of the new group. Only valid when the function call is successful. This group is initially empty, i.e. it does not contain any members.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOSPC: All groups are currently in use, no group available.

__rte_experimental int rte_swx_ctl_pipeline_selector_group_delete (struct rte_swx_ctl_pipeline * ctl, const char * selector_name, uint32_t group_id)

Pipeline selector table group delete

Schedule a group for deletion as part of the next commit operation. The group to be deleted can be empty or non-empty.

Parameters:

ctl Pipeline control handle.
selector_name Selector table name.
group_id Group to be deleted from the selector table.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory.

__rte_experimental int rte_swx_ctl_pipeline_selector_group_member_add (struct rte_swx_ctl_pipeline * ctl, const char * selector_name, uint32_t group_id, uint32_t member_id, uint32_t member_weight)

Pipeline selector table member add to group

Schedule the operation to add a new member to an existing group as part of the next commit operation. If this member is already in this group, the member weight is updated to the new value. A weight of zero means this member is to be deleted from the group.

Parameters:

ctl Pipeline control handle.
selector_name Selector table name.
group_id The group ID.
member_id The member to be added to the group.
member_weight Member weight.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory; -ENOSPC: The group is full.

__rte_experimental int rte_swx_ctl_pipeline_selector_group_member_delete (struct rte_swx_ctl_pipeline * ctl, const char * selector_name, uint32_t group_id, uint32_t member_id)

Pipeline selector table member delete from group

Schedule the operation to delete a member from an existing group as part of the next commit operation.

Parameters:

ctl Pipeline control handle.
selector_name Selector table name.
group_id The group ID. Must be valid.
member_id The member to be added to the group. Must be valid.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_learner_default_entry_add (struct rte_swx_ctl_pipeline * ctl, const char * learner_name, struct rte_swx_table_entry * entry)

Pipeline learner table default entry add

Schedule learner table default entry update as part of the next commit operation.

Parameters:

ctl Pipeline control handle.
learner_name Learner table name.
entry The new table default entry. The key and key_mask entry fields are ignored.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

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

Parameters:

ctl Pipeline control handle.
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.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental void rte_swx_ctl_pipeline_abort (struct rte_swx_ctl_pipeline * ctl)

Pipeline abort

Discard all the scheduled table work.

Parameters:

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, int * is_blank_or_comment)

Pipeline table entry read

Read table entry from string.

Parameters:

ctl Pipeline control handle.
table_name Table name.
string String containing the table entry.
is_blank_or_comment On error, this argument provides an indication of whether string contains an invalid table entry (set to zero) or a blank or comment line that should typically be ignored (set to a non-zero value).

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental struct rte_swx_table_entry* rte_swx_ctl_pipeline_learner_default_entry_read (struct rte_swx_ctl_pipeline * ctl, const char * learner_name, const char * string, int * is_blank_or_comment)

Pipeline learner table default entry read

Read learner table default entry from string.

Parameters:

ctl Pipeline control handle.
learner_name Learner table name.
string String containing the learner table default entry.
is_blank_or_comment On error, this argument provides an indication of whether string contains an invalid table entry (set to zero) or a blank or comment line that should typically be ignored (set to a non-zero value).

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

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

Parameters:

f Output file.
ctl Pipeline control handle.
table_name Table name.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_selector_fprintf (FILE * f, struct rte_swx_ctl_pipeline * ctl, const char * selector_name)

Pipeline selector print to file

Print all the selector entries to file.

Parameters:

f Output file.
ctl Pipeline control handle.
selector_name Selector table name.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_regarray_info_get (struct rte_swx_pipeline * p, uint32_t regarray_id, struct rte_swx_ctl_regarray_info * regarray)

Register array info get

Parameters:

p Pipeline handle.
regarray_id Register array ID (0 .. n_regarrays - 1).
regarray Register array info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_regarray_read (struct rte_swx_pipeline * p, const char * regarray_name, uint32_t regarray_index, uint64_t * value)

Register read

Parameters:

p Pipeline handle.
regarray_name Register array name.
regarray_index Register index within the array (0 .. size - 1).
value Current register value.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_regarray_write (struct rte_swx_pipeline * p, const char * regarray_name, uint32_t regarray_index, uint64_t value)

Register write

Parameters:

p Pipeline handle.
regarray_name Register array name.
regarray_index Register index within the array (0 .. size - 1).
value Value to be written to the register.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_regarray_read_with_key (struct rte_swx_pipeline * p, const char * regarray_name, const char * table_name, uint8_t * table_key, uint64_t * value)

Register read with table key lookup

Parameters:

p Pipeline handle.
regarray_name Register array name.
table_name Regular or learner table name.
table_key Table key.
value Current register value.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory.

__rte_experimental int rte_swx_ctl_pipeline_regarray_write_with_key (struct rte_swx_pipeline * p, const char * regarray_name, const char * table_name, uint8_t * table_key, uint64_t value)

Register write with table key lookup

Parameters:

p Pipeline handle.
regarray_name Register array name.
table_name Regular or learner table name.
table_key Table key.
value Value to be written to the register.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough memory.

__rte_experimental int rte_swx_ctl_metarray_info_get (struct rte_swx_pipeline * p, uint32_t metarray_id, struct rte_swx_ctl_metarray_info * metarray)

Meter array info get

Parameters:

p Pipeline handle.
metarray_id Meter array ID (0 .. n_metarrays - 1).
metarray Meter array info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_profile_add (struct rte_swx_pipeline * p, const char * name, struct rte_meter_trtcm_params * params)

Meter profile add

Parameters:

p Pipeline handle.
name Meter profile name.
params Meter profile parameters.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -ENOMEM: Not enough space/cannot allocate memory; -EEXIST: Meter profile with this name already exists.

__rte_experimental int rte_swx_ctl_meter_profile_delete (struct rte_swx_pipeline * p, const char * name)

Meter profile delete

Parameters:

p Pipeline handle.
name Meter profile name.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument; -EBUSY: Meter profile is currently in use.

__rte_experimental int rte_swx_ctl_meter_reset (struct rte_swx_pipeline * p, const char * metarray_name, uint32_t metarray_index)

Meter reset

Reset a meter within a given meter array to use the default profile that causes all the input packets to be colored as green. It is the responsibility of the control plane to make sure this meter is not used by the data plane pipeline before calling this function.

Parameters:

p Pipeline handle.
metarray_name Meter array name.
metarray_index Meter index within the meter array.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_set (struct rte_swx_pipeline * p, const char * metarray_name, uint32_t metarray_index, const char * profile_name)

Meter set

Set a meter within a given meter array to use a specific profile. It is the responsibility of the control plane to make sure this meter is not used by the data plane pipeline before calling this function.

Parameters:

p Pipeline handle.
metarray_name Meter array name.
metarray_index Meter index within the meter array.
profile_name Existing meter profile name.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_stats_read (struct rte_swx_pipeline * p, const char * metarray_name, uint32_t metarray_index, struct rte_swx_ctl_meter_stats * stats)

Meter statistics counters read

Parameters:

p Pipeline handle.
metarray_name Meter array name.
metarray_index Meter index within the meter array.
stats Meter statistics counters.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_reset_with_key (struct rte_swx_pipeline * p, const char * metarray_name, const char * table_name, uint8_t * table_key)

Meter reset with table key lookup

Reset a meter within a given meter array to use the default profile that causes all the input packets to be colored as green. It is the responsibility of the control plane to make sure this meter is not used by the data plane pipeline before calling this function.

Parameters:

p Pipeline handle.
metarray_name Meter array name.
table_name Regular or learner table name.
table_key Table key.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_set_with_key (struct rte_swx_pipeline * p, const char * metarray_name, const char * table_name, uint8_t * table_key, const char * profile_name)

Meter set with table key lookup

Set a meter within a given meter array to use a specific profile. It is the responsibility of the control plane to make sure this meter is not used by the data plane pipeline before calling this function.

Parameters:

p Pipeline handle.
metarray_name Meter array name.
table_name Regular or learner table name.
table_key Table key.
profile_name Existing meter profile name.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_meter_stats_read_with_key (struct rte_swx_pipeline * p, const char * metarray_name, const char * table_name, uint8_t * table_key, struct rte_swx_ctl_meter_stats * stats)

Meter statistics counters read with table key lookup

Parameters:

p Pipeline handle.
metarray_name Meter array name.
table_name Regular or learner table name.
table_key Table key.
stats Meter statistics counters.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_rss_info_get (struct rte_swx_pipeline * p, uint32_t rss_obj_id, struct rte_swx_ctl_rss_info * rss)

RSS object info get

Parameters:

p Pipeline handle.
rss_obj_id RSS object ID (0 .. n_rss - 1).
rss RSS object info.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_rss_key_size_read (struct rte_swx_pipeline * p, const char * rss_obj_name, uint32_t * key_size)

RSS object key size read

Parameters:

p Pipeline handle.
rss_obj_name RSS object name.
key_size RSS key size in bytes.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_rss_key_read (struct rte_swx_pipeline * p, const char * rss_obj_name, uint8_t * key)

RSS object key read

Parameters:

p Pipeline handle.
rss_obj_name RSS object name.
key RSS key. Must be pre-allocated by the caller to store key_size bytes.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental int rte_swx_ctl_pipeline_rss_key_write (struct rte_swx_pipeline * p, const char * rss_obj_name, uint32_t key_size, uint8_t * key)

RSS object key write

Parameters:

p Pipeline handle.
rss_obj_name RSS object name.
key_size RSS key size in bytes. Must be at least 4 and a power of 2.
key RSS key.

Returns:

0 on success or the following error codes otherwise: -EINVAL: Invalid argument.

__rte_experimental void rte_swx_ctl_pipeline_free (struct rte_swx_ctl_pipeline * ctl)

Pipeline control free

Parameters:

ctl Pipeline control handle. If ctl is NULL, no operation is performed.

Author

Generated automatically by Doxygen for DPDK from the source code.

Thu May 23 2024 Version 23.11.0