RTE_SWX_TABLE_SELECTOR_CREATE(3)
π rte_swx_table_selector.h π
okay so bestie, welcome to the rte_swx_table_selector.h page from the DPDK library manual, section 3 (Library Functions Manual energy only, we don't do anything less). this is the selector table interface and it's lowkey iconic, so let's get into it π
πΈ NAME πΈ
rte_swx_table_selector.h β literally the header, she's the whole point π«Ά
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <rte_compat.h>
#include 'rte_swx_table.h'
π Data Structures
struct rte_swx_table_selector_paramsstruct rte_swx_table_selector_memberstruct rte_swx_table_selector_group
π¦ Functions
RTE_TAILQ_HEAD (rte_swx_table_selector_member_list, rte_swx_table_selector_member)__rte_experimental uint64_t rte_swx_table_selector_footprint_get (uint32_t n_groups_max, uint32_t n_members_per_group_max)__rte_experimental uint64_t rte_swx_table_selector_mailbox_size_get (void)__rte_experimental void * rte_swx_table_selector_create (struct rte_swx_table_selector_params *params, struct rte_swx_table_selector_group **groups, int numa_node)__rte_experimental int rte_swx_table_selector_group_set (void *table, uint32_t group_id, struct rte_swx_table_selector_group *group)__rte_experimental int rte_swx_table_selector_select (void *table, void *mailbox, uint8_t **group_id_buffer, uint8_t **selector_buffer, uint8_t **member_id_buffer)__rte_experimental void rte_swx_table_selector_free (void *table)
π Detailed Description π
RTE SWX Selector Table β¨
Selector table interface. that's the vibe, that's the whole thing.
Definition in file rte_swx_table_selector.h.
π₯ Function Documentation π₯
π RTE_TAILQ_HEAD (rte_swx_table_selector_member_list , rte_swx_table_selector_member )
List of group members. the whole squad, assembled π«Ά
π __rte_experimental uint64_t rte_swx_table_selector_footprint_get (uint32_t n_groups_max, uint32_t n_members_per_group_max)
Selector table memory footprint get β how much memory is this whole thing gonna eat, bestie π
Parameters
n_groups_maxβ Maximum number of groups. Must be non-zero. (no, fr, it has to be non-zero, don't test her)n_members_per_group_maxβ Maximum number of members per group. Must be non-zero. (same energy, non-zero only π)
Returns
Selector table memory footprint in bytes.
π§ __rte_experimental uint64_t rte_swx_table_selector_mailbox_size_get (void )
Selector table mailbox size get β sizing up the mailbox π¬
The mailbox is used to store the context of a select operation that is in progress and it is passed as a parameter to the select operation. This allows for multiple concurrent select operations into the same table. (yes, concurrency. she's multitasking like a main character π )
Returns
Selector table mailbox footprint in bytes.
β __rte_experimental void * rte_swx_table_selector_create (struct rte_swx_table_selector_params * params, struct rte_swx_table_selector_group ** groups, int numa_node)
Selector table create β build her from scratch, no cap π
Parameters
paramsβ Selector table creation parameters.groupsβ Groups to be added to the table at creation time. WhenNULL, it signifies that all groups are invalid, otherwise it points to a pre-allocated array of sizen_groups_max, where aNULLelement indicates that the associated group is invalid.numa_nodeβ Non-Uniform Memory Access (NUMA) node.
Returns
Table handle, on success, or NULL, on error.
π¦ __rte_experimental int rte_swx_table_selector_group_set (void * table, uint32_t group_id, struct rte_swx_table_selector_group * group)
Group set β set the group, periodt β¨
Parameters
tableβ Selector table handle.group_idβ Group ID.groupβ Group parameters.
Returns
0 on success or the following error codes otherwise:
-EINVAL: Invalid argument(s);-ENOSPC: Too many group members.
π __rte_experimental int rte_swx_table_selector_select (void * table, void * mailbox, uint8_t ** group_id_buffer, uint8_t ** selector_buffer, uint8_t ** member_id_buffer)
Selector table select β the moment we've all been waiting for π
This operation selects a member from the given group based on a hasing scheme.
Multiple invocations of this function may be required in order to complete a single select operation for a given table and a given group ID. The completion of the operation is flagged by a return value of 1; in case of a return value of 0, the function must be invoked again with exactly the same arguments. (yes, exactly. do not freestyle, i'm begging π)
The mailbox argument is used to store the context of each on-going operation. The mailbox mechanism allows for multiple concurrent select operations into the same table.
The typical reason an implementation may choose to split the operation into multiple steps is to hide the latency of the inherent memory read operations: before a read operation with the source data likely not in the CPU cache, the source data prefetch is issued and the operation is postponed in favor of some other unrelated work, which the CPU executes in parallel with the source data being fetched into the CPU cache; later on, the operation is resumed, this time with the source data likely to be read from the CPU cache with no CPU pipeline stall, which significantly improves the operation performance. (she's literally doing cache choreography, it's giving olympic-level multitasking π§β¨)
Parameters
tableβ Selector table handle.mailboxβ Mailbox for the current operation.group_id_bufferβ Buffer where the input group ID is located at offsetgroup_id_offset.selector_bufferβ Buffer where the key to select a member within the identified group is located starting from offsetselector_offset. Its size must be equal to the tableselector_size.member_id_bufferβ Buffer where the output member ID is to be placed at offsetmember_id_offset.
Returns
0 when the operation is not yet completed, and 1 when the operation is complete. No other return values are allowed. (that's it. that's the whole menu π)
π __rte_experimental void rte_swx_table_selector_free (void * table)
Selector table free β say goodbye, release her, let her rest πΈ
Parameters
tableβ Selector table handle.
π«Ά Author π«Ά
Generated automatically by Doxygen for DPDK from the source code. (she wasn't hand-written by a human bestie, she was generated, and honestly? still ate π )
and that's the page!! every struct, every __rte_experimental, every error code, every buffer offset β all present and accounted for, unchanged, fr fr. go be a selector table icon ππ
DPDK Β· Version 25.11.3 Β· rte_swx_table_selector.h(3) β mwah, see you in the man pages bestie ππβ¨
π¦ 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