DPDK  21.11.8
Data Structures | Typedefs | Enumerations | Functions
rte_swx_table.h File Reference
#include <stdint.h>
#include <rte_os.h>

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, 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)
 

Detailed Description

RTE SWX Table

Table interface.

Definition in file rte_swx_table.h.

Typedef Documentation

◆ rte_swx_table_footprint_get_t

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

Parameters
[in]paramsTable create parameters.
[in]entriesTable entries.
[in]argsAny additional table create arguments. It may be NULL.
Returns
Table memory footprint in bytes, if successful, or zero, on error.

Definition at line 130 of file rte_swx_table.h.

◆ rte_swx_table_mailbox_size_get_t

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.

Returns
Table memory footprint in bytes, on success, or zero, on error.

Definition at line 145 of file rte_swx_table.h.

◆ rte_swx_table_create_t

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

Parameters
[in]paramsTable creation parameters.
[in]entriesEntries to be added to the table at creation time.
[in]argsAny additional table create arguments. It may be NULL.
[in]numa_nodeNon-Uniform Memory Access (NUMA) node.
Returns
Table handle, on success, or NULL, on error.

Definition at line 162 of file rte_swx_table.h.

◆ rte_swx_table_add_t

typedef int(* rte_swx_table_add_t) (void *table, struct rte_swx_table_entry *entry)

Table entry add

Parameters
[in]tableTable handle.
[in]entryEntry to be added to the table.
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid table handle, entry or entry field; -ENOSPC: Table full.

Definition at line 180 of file rte_swx_table.h.

◆ rte_swx_table_delete_t

typedef int(* rte_swx_table_delete_t) (void *table, struct rte_swx_table_entry *entry)

Table entry delete

Parameters
[in]tableTable handle.
[in]entryEntry to be deleted from the table. The entry action_id and action_data fields are ignored.
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid table handle, entry or entry field; -ENOSPC: Table full.

Definition at line 197 of file rte_swx_table.h.

◆ rte_swx_table_lookup_t

typedef int(* rte_swx_table_lookup_t) (void *table, void *mailbox, uint8_t **key, uint64_t *action_id, uint8_t **action_data, 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.

Parameters
[in]tableTable handle.
[in]mailboxMailbox for the current table lookup operation.
[in]keyLookup 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_idID 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_dataAction 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]hitOnly valid when the function returns 1. Set to non-zero (true) on table lookup hit and to zero (false) on table lookup miss.
Returns
0 when the table lookup operation is not yet completed, and 1 when the table lookup operation is completed. No other return values are allowed.

Definition at line 250 of file rte_swx_table.h.

◆ rte_swx_table_free_t

typedef void(* rte_swx_table_free_t) (void *table)

Table free

Parameters
[in]tableTable handle.

Definition at line 264 of file rte_swx_table.h.

Enumeration Type Documentation

◆ rte_swx_table_match_type

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 23 of file rte_swx_table.h.

Function Documentation

◆ RTE_TAILQ_HEAD()

RTE_TAILQ_HEAD ( rte_swx_table_entry_list  ,
rte_swx_table_entry   
)

List of table entries.