DPDK 22.11.5
|
Go to the source code of this file.
Data Structures | |
struct | rte_swx_table_params |
struct | rte_swx_table_entry |
struct | rte_swx_table_ops |
Typedefs | |
typedef uint64_t(* | rte_swx_table_footprint_get_t) (struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args) |
typedef uint64_t(* | rte_swx_table_mailbox_size_get_t) (void) |
typedef void *(* | rte_swx_table_create_t) (struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args, int numa_node) |
typedef int(* | rte_swx_table_add_t) (void *table, struct rte_swx_table_entry *entry) |
typedef int(* | rte_swx_table_delete_t) (void *table, struct rte_swx_table_entry *entry) |
typedef int(* | rte_swx_table_lookup_t) (void *table, void *mailbox, uint8_t **key, uint64_t *action_id, uint8_t **action_data, size_t *entry_id, int *hit) |
typedef void(* | rte_swx_table_free_t) (void *table) |
Enumerations | |
enum | rte_swx_table_match_type { RTE_SWX_TABLE_MATCH_WILDCARD , RTE_SWX_TABLE_MATCH_LPM , RTE_SWX_TABLE_MATCH_EXACT } |
Functions | |
RTE_TAILQ_HEAD (rte_swx_table_entry_list, rte_swx_table_entry) | |
typedef uint64_t(* rte_swx_table_footprint_get_t) (struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args) |
Table memory footprint get
[in] | params | Table create parameters. |
[in] | entries | Table entries. |
[in] | args | Any additional table create arguments. It may be NULL. |
Definition at line 137 of file rte_swx_table.h.
typedef uint64_t(* rte_swx_table_mailbox_size_get_t) (void) |
Table mailbox size get
The mailbox is used to store the context of a lookup operation that is in progress and it is passed as a parameter to the lookup operation. This allows for multiple concurrent lookup operations into the same table.
Definition at line 152 of file rte_swx_table.h.
typedef void *(* rte_swx_table_create_t) (struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args, int numa_node) |
Table create
[in] | params | Table creation parameters. |
[in] | entries | Entries to be added to the table at creation time. |
[in] | args | Any additional table create arguments. It may be NULL. |
[in] | numa_node | Non-Uniform Memory Access (NUMA) node. |
Definition at line 169 of file rte_swx_table.h.
typedef int(* rte_swx_table_add_t) (void *table, struct rte_swx_table_entry *entry) |
Table entry add
[in] | table | Table handle. |
[in] | entry | Entry to be added to the table. |
Definition at line 187 of file rte_swx_table.h.
typedef int(* rte_swx_table_delete_t) (void *table, struct rte_swx_table_entry *entry) |
Table entry delete
[in] | table | Table handle. |
[in] | entry | Entry to be deleted from the table. The entry action_id and action_data fields are ignored. |
Definition at line 204 of file rte_swx_table.h.
typedef int(* rte_swx_table_lookup_t) (void *table, void *mailbox, uint8_t **key, uint64_t *action_id, uint8_t **action_data, size_t *entry_id, int *hit) |
Table lookup
The table lookup operation searches a given key in the table and upon its completion it returns an indication of whether the key is found in the table (lookup hit) or not (lookup miss). In case of lookup hit, the action_id and the action_data associated with the key are also returned.
Multiple invocations of this function may be required in order to complete a single table lookup operation for a given table and a given lookup key. The completion of the table lookup 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.
The mailbox argument is used to store the context of an on-going table lookup operation. The mailbox mechanism allows for multiple concurrent table lookup operations into the same table.
The typical reason an implementation may choose to split the table lookup 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 table lookup 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 table lookup 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 table lookup performance.
The table entry consists of the action ID and the action data. Each table entry is unique, although different table entries can have identical content, i.e. same values for the action ID and the action data. The table entry ID is also returned by the table lookup operation. It can be used to index into an external array of resources such as counters, registers or meters to identify the resource directly associated with the current table entry with no need to store the corresponding index into the table entry. The index of the external resource is thus auto-generated instead of being stored in the table entry.
[in] | table | Table handle. |
[in] | mailbox | Mailbox for the current table lookup operation. |
[in] | key | Lookup key. Its size mult be equal to the table key_size. If the latter is zero, then the lookup key must be NULL. |
[out] | action_id | ID of the action associated with the key. Must point to a valid 64-bit variable. Only valid when the function returns 1 and hit is set to true. |
[out] | action_data | Action data for the action_id action. Must point to a valid array of table action_data_size bytes. Only valid when the function returns 1 and hit is set to true. |
[out] | entry_id | Table entry unique ID. Must point to a valid 32-bit variable. Only valid when the function returns 1 and hit is set to true. |
[out] | hit | Only valid when the function returns 1. Set to non-zero (true) on table lookup hit and to zero (false) on table lookup miss. |
Definition at line 269 of file rte_swx_table.h.
typedef void(* rte_swx_table_free_t) (void *table) |
Match type.
Enumerator | |
---|---|
RTE_SWX_TABLE_MATCH_WILDCARD | Wildcard Match (WM). |
RTE_SWX_TABLE_MATCH_LPM | Longest Prefix Match (LPM). |
RTE_SWX_TABLE_MATCH_EXACT | Exact Match (EM). |
Definition at line 25 of file rte_swx_table.h.
RTE_TAILQ_HEAD | ( | rte_swx_table_entry_list | , |
rte_swx_table_entry | |||
) |
List of table entries.