rte_swx_ctl.h(3)
rte_swx_ctl.h ππ¦
okay bestie, welcome to the rte_swx_ctl.h(3) manual β yep, that's a Library Functions Manual situation, section 3, and she is LONG so buckle up. this is part 1 of 4, so do not go anywhere, we're just getting the lay of the land rn πΈ
NAME π
rte_swx_ctl.h
like... that's it, that's the name. iconic of her honestly π
SYNOPSIS β¨
to even start the conversation with this header, you gotta pull in all her little friends first:
#include <stdint.h>
#include <stdio.h>
#include <rte_compat.h>
#include <rte_meter.h>
#include 'rte_swx_port.h'
#include 'rte_swx_table.h'
slay. now the actual content π
Data Structures π
she comes with a whole entourage, no cap:
struct rte_swx_ctl_pipeline_infostruct rte_swx_ctl_action_infostruct rte_swx_ctl_action_arg_infostruct rte_swx_ctl_table_infostruct rte_swx_ctl_table_match_field_infostruct rte_swx_ctl_table_action_infostruct rte_swx_table_statsstruct rte_swx_ctl_selector_infostruct rte_swx_pipeline_selector_statsstruct rte_swx_ctl_learner_infostruct rte_swx_learner_statsstruct rte_swx_pipeline_mirroring_session_paramsstruct rte_swx_table_statestruct rte_swx_ctl_regarray_infostruct rte_swx_ctl_metarray_infostruct rte_swx_ctl_meter_statsstruct rte_swx_ctl_rss_info
Macros π
just the one macro, living her solo era:
#define RTE_SWX_CTL_NAME_SIZE 64
Functions π
okay so here's the FULL roster, copy-pasted with love, every single one of them is marked __rte_experimental btw so don't @ me if the vibes shift later π:
__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)
that's 60 functions btw. sixty. she ate and left no crumbs ππ
Detailed Description π«Ά
RTE SWX Pipeline Control
that's the whole vibe. the control plane for your SWX pipeline, fr fr.
and if you ever need to find her again:
Definition in file rte_swx_ctl.h.
okay so that's the intro + the full map. next parts are gonna go DEEP on what each of these actually does, so keep scrolling bestie, we are SO not done πβ¨
π MACRO DEFINITION DOCUMENTATION π
RTE_SWX_CTL_NAME_SIZE
bestie, it's literally one macro and she's serving maximum importance. It decides how big a name is allowed to be. β¨
#define RTE_SWX_CTL_NAME_SIZE 64
Name size. That's the whole vibe β the size of a name, and that size is 64. Definition at line 29 of file rte_swx_ctl.h.
β¨ FUNCTION DOCUMENTATION β¨
okay so this is the main-character section, buckle in π
rte_swx_ctl_pipeline_info_get()
Pipeline info get β it goes and grabs the info for ya.
__rte_experimental int rte_swx_ctl_pipeline_info_get(struct rte_swx_pipeline *p,
struct rte_swx_ctl_pipeline_info *pipeline)
Parameters
pβ Pipeline handle.pipelineβ Pipeline info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_numa_node_get()
Pipeline NUMA node get β pulls the NUMA node for the pipeline.
__rte_experimental int rte_swx_ctl_pipeline_numa_node_get(struct rte_swx_pipeline *p,
int *numa_node)
Parameters
pβ Pipeline handle.numa_nodeβ Pipeline NUMA node.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_port_in_stats_read()
Input port statistics counters read β reads the stats counters off an input port. π
__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)
Parameters
pβ Pipeline handle.port_idβ Port ID (0 .. n_ports_in - 1).statsβ Input port stats.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_port_out_stats_read()
Output port statistics counters read β same energy, but the output side.
__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)
Parameters
pβ Pipeline handle.port_idβ Port ID (0 .. n_ports_out - 1).statsβ Output port stats.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_action_info_get()
Action info get β fetches the info for an action.
__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)
Parameters
pβ Pipeline handle.action_idβ Action ID (0 .. n_actions - 1).actionβ Action info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_action_arg_info_get()
Action argument info get β zooming in one level deeper, we're getting the info for an action argument now. π
__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)
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
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_table_info_get()
Table info get β the info for a table, served fresh.
__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)
Parameters
pβ Pipeline handle.table_idβ Table ID (0 .. n_tables - 1).tableβ Table info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_table_match_field_info_get()
Table match field info get β now we're getting the info for one specific match field of a 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)
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
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_table_action_info_get()
Table action info get β the info for an action as it lives inside a table.
__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)
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 oftable_action.table_actionβ Table action info.
β οΈ okay bestie this is the one people mess up:table_action_idis table-scoped, not pipeline-scoped. The pipeline-level action ID is what comes back to you insidetable_action. Two different numbers, don't mix them up, iykyk. π
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_table_ops_get()
Table operations get β hands you the table's operations back.
__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)
Parameters
pβ Pipeline handle.table_idβ Table ID (0 .. n_tables).table_opsβ Table operations. Only valid when the function returns success andis_stubis 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.
π«Ά real talk: ifis_stubcomes back true, don't you dare touchtable_opsβ it's only valid when the call succeeds andis_stubis zero (false).
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_table_stats_read()
Table statistics counters read β reads the stats counters for a table by name.
__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)
Parameters
pβ Pipeline handle.table_nameβ Table name.statsβ Table stats. Must point to a pre-allocated structure. Then_pkts_actionfield also needs to be pre-allocated as array of pipelinen_actionselements. The pipeline actions that are not valid for the current table have their associatedn_pkts_actionelement always set to zero.
πΈ pre-allocate this yourself, bestie, this function will NOT do it for you. And remembern_pkts_actionis an array of pipelinen_actionselements β the actions that don't apply to this table just sit there at zero.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_selector_info_get()
Selector table info get β info for a selector table.
__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)
Parameters
pβ Pipeline handle.selector_idβ Selector table ID (0 .. n_selectors - 1).selectorβ Selector table info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_selector_group_id_field_info_get()
Selector table "group ID" field info get β the info for the selector table's "group ID" field. π
__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)
Parameters
pβ Pipeline handle.selector_idβ Selector table ID (0 .. n_selectors).fieldβ Selector table "group ID" field info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_selector_field_info_get()
Sselector table selector field info get β grabs the info for one selector field of a selector table.
__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)
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
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_selector_member_id_field_info_get()
Selector table "member ID" field info get β the info for the selector table's "member ID" 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)
Parameters
pβ Pipeline handle.selector_idβ Selector table ID (0 .. n_selectors).fieldβ Selector table "member ID" field info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_selector_stats_read()
Selector table statistics counters read β stats for a selector table, by name. π
__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)
Parameters
pβ Pipeline handle.selector_nameβ Selector table name.statsβ Selector table stats. Must point to a pre-allocated structure.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_learner_info_get()
Learner table info get β info for a learner table. π
__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)
Parameters
pβ Pipeline handle.learner_idβ Learner table ID (0 .. n_learners - 1).learnerβ Learner table info.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_learner_match_field_info_get()
Learner table match field info get β the info for a single match field of a learner table.
__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)
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
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_learner_action_info_get()
Learner table action info get β the info for an action inside a learner table.
__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)
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 thelearner_action.learner_actionβ Learner action info.
β οΈ same trap as the table version, bestie:learner_action_idis scoped to the learner table, the pipeline-level action ID is what you get back inlearner_action. Two numbers. Don't conflate them. π
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_learner_timeout_get()
Learner table timeout get β reads a learner table's timeout value.
__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)
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.
πtimeouthas to be non-NULLβ do not pass null to this, I'm serious.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_learner_timeout_set()
Learner table timeout set β writes a learner table's timeout value.
__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)
Parameters
pβ Pipeline handle.learner_idβ Learner table ID (0 .. n_learners - 1).timeout_idβ Timeout ID.timeoutβ Timeout value measured in seconds.
Returns
0on success, or the following error codes otherwise:-EINVAL: Invalid argument.
rte_swx_ctl_pipeline_learner_stats_read π
__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 β¨ bestie we are β¨readingβ¨ the counters, that's the whole job.
Parameters
pβ Pipeline handle.learner_nameβ Learner table name.statsβ Learner table stats. Must point to a pre-allocated structure. Then_pkts_actionfield also needs to be pre-allocated as array of pipelinen_actionselements. The pipeline actions that are not valid for the current learner table have their associatedn_pkts_actionelement always set to zero. π
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_mirroring_session_set πͺ
__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 β main character energy only, we're setting up a mirroring session.
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_swx_pipeline_table_state_get πΈ
__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 β no cap, we are grabbing the current state.
Parameters
pβ Pipeline handle.table_stateβ After successful execution, thetable_statecontains the pointer to the current pipeline table state, which is an array ofn_tableselements, with array elementicontaining the state of thei-th pipeline table. The pipeline continues to own all the data structures directly or indirectly referenced by thetable_stateuntil the subsequent successful invocation of functionrte_swx_pipeline_table_state_set. π«Ά
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
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 β okay so now we're giving the state instead of getting it, slay.
Parameters
pβ Pipeline handle.table_stateβ After successful execution, the pipeline table state is updated to thistable_state. The ownership of all the data structures directly or indirectly referenced by thistable_stateis passed from the caller to the pipeline. π
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_find π
__rte_experimental struct rte_swx_ctl_pipeline *rte_swx_ctl_pipeline_find
(const char *name)
Pipeline control find β the search-and-rescue of pipeline control handles.
Parameters
nameβ Pipeline name.
Returns
Valid pipeline control handle if found or NULL otherwise.
rte_swx_ctl_pipeline_create π±
__rte_experimental struct rte_swx_ctl_pipeline *rte_swx_ctl_pipeline_create
(struct rte_swx_pipeline *p)
Pipeline control create β manifesting a brand new pipeline control handle, periodt.
Parameters
pβ Pipeline handle.
Returns
Pipeline control handle, on success, or NULL, on error.
rte_swx_ctl_pipeline_table_entry_add β
__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. Bestie it's a schedule, not an instant thing β the commit does the actual work later. β¨
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_swx_ctl_pipeline_table_default_entry_add β
__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. Thekeyandkey_maskentry fields are ignored. π
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_table_entry_delete ποΈ
__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. π no drama, no error, just gone.
Parameters
ctlβ Pipeline control handle.table_nameβ Table name.entryβ Entry to be deleted from the table. Theaction_idandaction_dataentry fields are ignored.
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_selector_group_add π
__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. So like, this one is not a schedule β it happens now. π₯
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_swx_ctl_pipeline_selector_group_delete βοΈ
__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. Eviction notice served, iconic. π
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_swx_ctl_pipeline_selector_group_member_add π«
__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. π (yes, zero = unfollow, that's just how they do it.)
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_swx_ctl_pipeline_selector_group_member_delete π
__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. It's giving removal arc. π
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.
Okay bestie, yes, the manual really does say "added" there even though this is the delete function. We're just the messenger, we keep it exactly as written. π
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_learner_default_entry_add π¦
__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. Thekeyandkey_maskentry fields are ignored. π«Ά
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_commit π
__rte_experimental int rte_swx_ctl_pipeline_commit(struct
rte_swx_ctl_pipeline *ctl, int abort_on_fail)
Pipeline commit β the moment we've all been waiting for. 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.
Not me side-eyeing that "(false)" in the original text β but fr fr, that's literally what it says, so it stays. Copying it verbatim is the vibe. β¨
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument.
rte_swx_ctl_pipeline_abort π
__rte_experimental void rte_swx_ctl_pipeline_abort(struct
rte_swx_ctl_pipeline *ctl)
Pipeline abort
Discard all the scheduled table work. Everything on the schedule? Cancelled. Not sorry. π
Parameters
ctlβ Pipeline control handle.
rte_swx_ctl_pipeline_table_entry_read π
__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. Glow-up from raw text to struct. β¨
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 whetherstringcontains 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_swx_ctl_pipeline_learner_default_entry_read π
__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 whetherstringcontains 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_swx_ctl_pipeline_table_fprintf π¨οΈ
__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. Dump the whole roster, no filter, no cap. π
Parameters
fβ Output file.ctlβ Pipeline control handle.table_nameβ Table name.
rte_swx_ctl_pipeline_selector_fprintf</p> β pipeline selector print to file π
__rte_experimental int rte_swx_ctl_pipeline_selector_fprintf(FILE *f, struct rte_swx_ctl_pipeline *ctl, const char *selector_name)
bestie it literally prints all the selector entries straight to a file. that's the whole vibe. β¨
Parameters
fβ output file πctlβ the pipeline control handleselector_nameβ selector table name
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_regarray_info_get</p> β register array info get π
__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)
grab the info for a register array. yes queen, get the details. π
Parameters
pβ pipeline handleregarray_idβ register array ID (0 .. n_regarrays - 1)regarrayβ register array info
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_regarray_read</p> β register read π
__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)
read a register, so iconic of you honestly. π
Parameters
pβ pipeline handleregarray_nameβ register array nameregarray_indexβ register index within the array (0 .. size - 1)valueβ current register value
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_regarray_write</p> β register write βοΈ
__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)
the write to the read, the pen to the paper, the main character moment of registers. π
Parameters
pβ pipeline handleregarray_nameβ register array nameregarray_indexβ register index within the array (0 .. size - 1)valueβ value to be written to the register
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_regarray_read_with_key</p> β register read with table key lookup π
__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)
same read energy as before, except this time the register index gets looked up through the table key. iykyk. π¦
Parameters
pβ pipeline handleregarray_nameβ register array nametable_nameβ regular or learner table nametable_keyβ table keyvalueβ current register value
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument; -ENOMEM: not enough memory.
rte_swx_ctl_pipeline_regarray_write_with_key</p> β register write with table key lookup π
__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)
you already know: write, but the index comes from the table key lookup. periodt. π
Parameters
pβ pipeline handleregarray_nameβ register array nametable_nameβ regular or learner table nametable_keyβ table keyvalueβ value to be written to the register
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument; -ENOMEM: not enough memory.
rte_swx_ctl_metarray_info_get</p> β meter array info get πΈ
__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)
get the tea on a meter array. ββ¨
Parameters
pβ pipeline handlemetarray_idβ meter array ID (0 .. n_metarrays - 1)metarrayβ meter array info
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_profile_add</p> β meter profile add β
__rte_experimental int rte_swx_ctl_meter_profile_add(struct rte_swx_pipeline *p, const char *name, struct rte_meter_trtcm_params *params)
adding a brand new meter profile to the collection, slay. π
Parameters
pβ pipeline handlenameβ meter profile nameparamsβ meter profile parameters
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument; -ENOMEM: not enough space/cannot allocate memory; -EEXIST: meter profile with this name already exists.
bestie if -EEXIST shows up, the name is already taken. pick a different one. π
rte_swx_ctl_meter_profile_delete</p> β meter profile delete ποΈ
__rte_experimental int rte_swx_ctl_meter_profile_delete(struct rte_swx_pipeline *p, const char *name)
bye bye meter profile. it's giving closure. π
Parameters
pβ pipeline handlenameβ meter profile name
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument; -EBUSY: meter profile is currently in use.
-EBUSY means nope, something is currently using it. can't delete what's still booked. π
rte_swx_ctl_meter_reset</p> β meter reset π
__rte_experimental int rte_swx_ctl_meter_reset(struct rte_swx_pipeline *p, const char *metarray_name, uint32_t metarray_index)
resets a meter inside a given meter array so it uses the default profile, which makes all the input packets get colored as green. π
okay important: 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. do not skip that step, bestie. π
Parameters
pβ pipeline handlemetarray_nameβ meter array namemetarray_indexβ meter index within the meter array
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_set</p> β meter set π―
__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)
points a meter inside a given meter array at a specific profile. glow-up assigned. β¨
same energy as above: 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 handlemetarray_nameβ meter array namemetarray_indexβ meter index within the meter arrayprofile_nameβ existing meter profile name
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_stats_read</p> β meter statistics counters read π
__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)
read the meter's statistics counters and get the numbers, bestie. π’
Parameters
pβ pipeline handlemetarray_nameβ meter array namemetarray_indexβ meter index within the meter arraystatsβ meter statistics counters
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_reset_with_key</p> β meter reset with table key lookup ππ
__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)
resets a meter inside a given meter array to the default profile, which colors all the input packets as green β except this time the meter is found via table key lookup. π¦
and yes, again: 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 handlemetarray_nameβ meter array nametable_nameβ regular or learner table nametable_keyβ table key
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_set_with_key</p> β meter set with table key lookup π―π
__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)
sets a meter inside a given meter array to use a specific profile, with the meter located through the table key. π«Ά
you know the drill: 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 handlemetarray_nameβ meter array nametable_nameβ regular or learner table nametable_keyβ table keyprofile_nameβ existing meter profile name
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_meter_stats_read_with_key</p> β meter statistics counters read with table key lookup ππ
__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)
statistics counters read, but the meter is looked up with the table key. no notes. π
Parameters
pβ pipeline handlemetarray_nameβ meter array nametable_nameβ regular or learner table nametable_keyβ table keystatsβ meter statistics counters
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_rss_info_get</p> β RSS object info get π
__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)
all the info about an RSS object, served fresh. β
Parameters
pβ pipeline handlerss_obj_idβ RSS object ID (0 .. n_rss - 1)rssβ RSS object info
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_rss_key_size_read</p> β RSS object key size read π
__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)
how big is the RSS key, you ask? this tells you. π«
Parameters
pβ pipeline handlerss_obj_nameβ RSS object namekey_sizeβ RSS key size in bytes
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_rss_key_read</p> β RSS object key read π
__rte_experimental int rte_swx_ctl_pipeline_rss_key_read(struct rte_swx_pipeline *p, const char *rss_obj_name, uint8_t *key)
reads the RSS key out. π
Parameters
pβ pipeline handlerss_obj_nameβ RSS object namekeyβ RSS key. Must be pre-allocated by the caller to storekey_sizebytes.
bestie, pre-allocate that buffer yourself β this function is not doing it for you. it needs room for key_size bytes. π
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_rss_key_write</p> β RSS object key write ποΈ
__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)
writes the RSS key. setting the vibe, honestly. π₯
Parameters
pβ pipeline handlerss_obj_nameβ RSS object namekey_sizeβ RSS key size in bytes. Must be at least4and a power of2.keyβ RSS key
key_sizehas requirements: at least4and a power of2. don't come in there with a3. π
Returns
0 on success, or these error codes if not: -EINVAL: invalid argument.
rte_swx_ctl_pipeline_free</p> β pipeline control free ποΈ
__rte_experimental void rte_swx_ctl_pipeline_free(struct rte_swx_ctl_pipeline *ctl)
free the pipeline control handle. releasing it back to the universe. π
Parameters
ctlβ pipeline control handle. IfctlisNULL, no operation is performed.
cute detail: ifctlisNULL, nothing happens at all. no crash, no drama. π
Author ποΈ
Generated automatically by Doxygen for DPDK from the source code. the robots wrote it, i just added the sparkle. π€β¨
and that's a wrap on rte_swx_ctl.h(3), bestie!! π you made it through the entire control-plane saga and honestly? iconic. this page came straight from DPDK, Version 25.11.3, and that footer date/version line is your little timestamp of when this whole thing got generated. go forth and control those pipelines. periodt. π
πππ¦πΈ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms