---
name: "rte_swx_table_selector_group_set"
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_selector.h"
---

# rte\_swx\_table\_selector\_group\_set(3)

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

## NAME

rte\_swx\_table\_selector.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_compat.h>`\
 `#include 'rte_swx_table.h'`\

### Data Structures

struct **rte\_swx\_table\_selector\_params**\
 struct **rte\_swx\_table\_selector\_member**\
 struct **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.

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.

### \_\_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

**Parameters**

*n\_groups\_max* Maximum number of groups. Must be non-zero. \
 *n\_members\_per\_group\_max* Maximum number of members per group. Must be non-zero.

**Returns**

Selector table memory footprint in bytes.

### \_\_rte\_experimental uint64\_t rte\_swx\_table\_selector\_mailbox\_size\_get (void)

Selector table mailbox size get

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.

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

**Parameters**

*params* Selector table creation parameters. \
 *groups* Groups to be added to the table at creation time. When NULL, it signifies that all groups are invalid, otherwise it points to a pre-allocated array of size *n\_groups\_max*, where a NULL element 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

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

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.

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.

**Parameters**

*table* Selector table handle. \
 *mailbox* Mailbox for the current operation. \
 *group\_id\_buffer* Buffer where the input group ID is located at offset *group\_id\_offset*. \
 *selector\_buffer* Buffer where the key to select a member within the identified group is located starting from offset *selector\_offset*. Its size must be equal to the table *selector\_size*. \
 *member\_id\_buffer* Buffer where the output member ID is to be placed at offset *member\_id\_offset*.

**Returns**

0 when the operation is not yet completed, and 1 when the operation is complete. No other return values are allowed.

### \_\_rte\_experimental void rte\_swx\_table\_selector\_free (void \* table)

Selector table free

**Parameters**

*table* Selector table handle.

## Author

Generated automatically by Doxygen for DPDK from the source code.
