---
name: "RTE_SWX_TABLE_MATCH_WILDCARD"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_swx_table.h"
---

# RTE\_SWX\_TABLE\_MATCH\_WILDCARD(3)

Part of [rte\_swx\_table.h(3)](/rte_swx_table.h/3.md).

## NAME

rte\_swx\_table.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_os.h>`\
 `#include 'rte_swx_hash_func.h'`\

### 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**)\

## Detailed Description

RTE SWX Table

Table interface.

Definition in file **rte\_swx\_table.h**.

## Typedef Documentation

### 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**

*params* Table create parameters. \
 *entries* Table entries. \
 *args* Any additional table create arguments. It may be NULL.

**Returns**

Table memory footprint in bytes, if successful, or zero, on error.

Definition at line **133** 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.

**Returns**

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

Definition at line **148** 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

**Parameters**

*params* Table creation parameters. \
 *entries* Entries to be added to the table at creation time. \
 *args* Any additional table create arguments. It may be NULL. \
 *numa\_node* Non-Uniform Memory Access (NUMA) node.

**Returns**

Table handle, on success, or NULL, on error.

Definition at line **165** of file **rte\_swx\_table.h**.

### typedef int(\* rte\_swx\_table\_add\_t) (void \*table, struct rte\_swx\_table\_entry \*entry)

Table entry add

**Parameters**

*table* Table handle. \
 *entry* Entry 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 **183** of file **rte\_swx\_table.h**.

### typedef int(\* rte\_swx\_table\_delete\_t) (void \*table, struct rte\_swx\_table\_entry \*entry)

Table entry delete

**Parameters**

*table* Table handle. \
 *entry* Entry 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 **200** 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.

**Parameters**

*table* Table handle. \
 *mailbox* Mailbox for the current table lookup operation. \
 *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. \
 *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. \
 *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. \
 *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. \
 *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.

**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 **265** of file **rte\_swx\_table.h**.

### typedef void(\* rte\_swx\_table\_free\_t) (void \*table)

Table free

**Parameters**

*table* Table handle.

Definition at line **280** of file **rte\_swx\_table.h**.

## Enumeration Type Documentation

### enum 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* **21** *of file* **rte\_swx\_table.h***.*

## Function Documentation

### RTE\_TAILQ\_HEAD (rte\_swx\_table\_entry\_list, rte\_swx\_table\_entry)

*List of table entries.*

## Author

*Generated automatically by Doxygen for DPDK from the source code.*
