---
name: "rte_fib6_select_lookup"
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_fib6.h"
---

# rte\_fib6\_select\_lookup(3)

Part of [rte\_fib6.h(3)](/rte_fib6.h/3.md).

## NAME

rte\_fib6.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_common.h>`\
 `#include <rte_ip6.h>`\

### Data Structures

struct **rte\_fib6\_conf**\

### Macros

\#define **RTE\_FIB6\_MAXDEPTH**   (**RTE\_DEPRECATED**(RTE\_FIB6\_MAXDEPTH) **RTE\_IPV6\_MAX\_DEPTH**)\

### Typedefs

**typedef** int(\* **rte\_fib6\_modify\_fn\_t**) (struct rte\_fib6 \*fib, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth, uint64\_t next\_hop, int op)\
 **typedef** void(\* **rte\_fib6\_lookup\_fn\_t**) (void \*fib, const struct **rte\_ipv6\_addr** \*ips, uint64\_t \*next\_hops, const unsigned int n)\

### Enumerations

enum **rte\_fib6\_type** { **RTE\_FIB6\_DUMMY**, **RTE\_FIB6\_TRIE** }\
 enum **rte\_fib\_trie\_nh\_sz** \
 enum **rte\_fib6\_lookup\_type** { **RTE\_FIB6\_LOOKUP\_DEFAULT**, **RTE\_FIB6\_LOOKUP\_TRIE\_SCALAR**, **RTE\_FIB6\_LOOKUP\_TRIE\_VECTOR\_AVX512** }\

### Functions

struct rte\_fib6 \* **rte\_fib6\_create** (const char \*name, int socket\_id, struct **rte\_fib6\_conf** \*conf)\
 struct rte\_fib6 \* **rte\_fib6\_find\_existing** (const char \*name)\
 void **rte\_fib6\_free** (struct rte\_fib6 \*fib)\
 int **rte\_fib6\_add** (struct rte\_fib6 \*fib, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth, uint64\_t next\_hop)\
 int **rte\_fib6\_delete** (struct rte\_fib6 \*fib, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth)\
 int **rte\_fib6\_lookup\_bulk** (struct rte\_fib6 \*fib, const struct **rte\_ipv6\_addr** \*ips, uint64\_t \*next\_hops, int n)\
 void \* **rte\_fib6\_get\_dp** (struct rte\_fib6 \*fib)\
 struct rte\_rib6 \* **rte\_fib6\_get\_rib** (struct rte\_fib6 \*fib)\
 int **rte\_fib6\_select\_lookup** (struct rte\_fib6 \*fib, enum **rte\_fib6\_lookup\_type** type)\

## Detailed Description

RTE FIB6 library.

FIB (Forwarding information base) implementation for IPv6 Longest Prefix Match

Definition in file **rte\_fib6.h**.

## Macro Definition Documentation

### #define RTE\_FIB6\_MAXDEPTH (RTE\_DEPRECATED(RTE\_FIB6\_MAXDEPTH) RTE\_IPV6\_MAX\_DEPTH)

Maximum depth value possible for IPv6 FIB.

Definition at line **29** of file **rte\_fib6.h**.

## Typedef Documentation

### typedef int(\* rte\_fib6\_modify\_fn\_t) (struct rte\_fib6 \*fib, const struct rte\_ipv6\_addr \*ip, uint8\_t depth, uint64\_t next\_hop, int op)

Modify FIB function

Definition at line **41** of file **rte\_fib6.h**.

### typedef void(\* rte\_fib6\_lookup\_fn\_t) (void \*fib, const struct rte\_ipv6\_addr \*ips, uint64\_t \*next\_hops, const unsigned int n)

FIB bulk lookup function

Definition at line **45** of file **rte\_fib6.h**.

## Enumeration Type Documentation

### enum rte\_fib6\_type

Type of FIB struct

**Enumerator**

- *RTE\_FIB6\_DUMMY*

  *RIB6 tree based FIB*

- *RTE\_FIB6\_TRIE*

  *TRIE based fib* \

*Definition at line* **35** *of file* **rte\_fib6.h***.*

### enum rte\_fib\_trie\_nh\_sz

*Size of nexthop (1 \<\< nh\_sz) bits for TRIE based FIB*

*Definition at line* **55** *of file* **rte\_fib6.h***.*

### enum rte\_fib6\_lookup\_type

*Type of lookup function implementation*

**Enumerator**

- *RTE\_FIB6\_LOOKUP\_DEFAULT*

  *Selects the best implementation based on the max simd bitwidth*

- *RTE\_FIB6\_LOOKUP\_TRIE\_SCALAR*

  *Scalar lookup function implementation*

- *RTE\_FIB6\_LOOKUP\_TRIE\_VECTOR\_AVX512*

  *Vector implementation using AVX512*

*Definition at line* **62** *of file* **rte\_fib6.h***.*

## Function Documentation

### struct rte\_fib6 \* rte\_fib6\_create (const char \* name, int socket\_id, struct rte\_fib6\_conf \* conf)

*Create FIB*

**Parameters**

*name FIB name* \
 *socket\_id NUMA socket ID for FIB table memory allocation* \
 *conf Structure containing the configuration*

**Returns**

*Handle to FIB object on success NULL otherwise with rte\_errno set to an appropriate values.*

### struct rte\_fib6 \* rte\_fib6\_find\_existing (const char \* name)

*Find an existing FIB object and return a pointer to it.*

**Parameters**

*name Name of the fib object as passed to* **rte\_fib6\_create()**

**Returns**

*Pointer to fib object or NULL if object not found with rte\_errno set appropriately. Possible rte\_errno values include:*

- •

  *ENOENT - required entry not available to return.*

### void rte\_fib6\_free (struct rte\_fib6 \* fib)

*Free an FIB object.*

**Parameters**

*fib FIB object handle created by* **rte\_fib6\_create()***. If fib is NULL, no operation is performed.*

### int rte\_fib6\_add (struct rte\_fib6 \* fib, const struct rte\_ipv6\_addr \* ip, uint8\_t depth, uint64\_t next\_hop)

*Add a route to the FIB.*

**Parameters**

*fib FIB object handle* \
 *ip IPv6 prefix address to be added to the FIB* \
 *depth Prefix length* \
 *next\_hop Next hop to be added to the FIB*

**Returns**

*0 on success, negative value otherwise*

### int rte\_fib6\_delete (struct rte\_fib6 \* fib, const struct rte\_ipv6\_addr \* ip, uint8\_t depth)

*Delete a rule from the FIB.*

**Parameters**

*fib FIB object handle* \
 *ip IPv6 prefix address to be deleted from the FIB* \
 *depth Prefix length*

**Returns**

*0 on success, negative value otherwise*

### int rte\_fib6\_lookup\_bulk (struct rte\_fib6 \* fib, const struct rte\_ipv6\_addr \* ips, uint64\_t \* next\_hops, int n)

*Lookup multiple IP addresses in the FIB.*

**Parameters**

*fib FIB object handle* \
 *ips Array of IPv6s to be looked up in the FIB* \
 *next\_hops Next hop of the most specific rule found for IP. This is an array of eight byte values. If the lookup for the given IP failed, then corresponding element would contain default nexthop value configured for a FIB.* \
 *n Number of elements in ips (and next\_hops) array to lookup.*

**Returns**

*-EINVAL for incorrect arguments, otherwise 0*

### void \* rte\_fib6\_get\_dp (struct rte\_fib6 \* fib)

*Get pointer to the dataplane specific struct*

**Parameters**

*fib FIB6 object handle*

**Returns**

*Pointer on the dataplane struct on success NULL otherwise*

### struct rte\_rib6 \* rte\_fib6\_get\_rib (struct rte\_fib6 \* fib)

*Get pointer to the RIB6*

**Parameters**

*fib FIB object handle*

**Returns**

*Pointer on the RIB6 on success NULL otherwise*

### int rte\_fib6\_select\_lookup (struct rte\_fib6 \* fib, enum rte\_fib6\_lookup\_type type)

*Set lookup function based on type*

**Parameters**

*fib FIB object handle* \
 *type type of lookup function*

**Returns**

*0 on success -EINVAL on failure*

## Author

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