---
name: "RTE_FIB_F_LOOKUP_NETWORK_ORDER"
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_fib.h"
---

# RTE\_FIB\_F\_LOOKUP\_NETWORK\_ORDER(3)

Part of [rte\_fib.h(3)](/rte_fib.h/3.md).

## NAME

rte\_fib.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_rcu_qsbr.h>`\

### Data Structures

struct **rte\_fib\_conf**\
 struct **rte\_fib\_rcu\_config**\

### Macros

\#define **RTE\_FIB\_MAXDEPTH**   32\
 \#define **RTE\_FIB\_F\_LOOKUP\_NETWORK\_ORDER**   1\

### Typedefs

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

### Enumerations

enum **rte\_fib\_qsbr\_mode** { **RTE\_FIB\_QSBR\_MODE\_DQ** = 0, **RTE\_FIB\_QSBR\_MODE\_SYNC** }\
 enum **rte\_fib\_type** { **RTE\_FIB\_DUMMY**, **RTE\_FIB\_DIR24\_8** }\
 enum **rte\_fib\_dir24\_8\_nh\_sz** \
 enum **rte\_fib\_lookup\_type** { **RTE\_FIB\_LOOKUP\_DEFAULT**, **RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_MACRO**, **RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_INLINE**, **RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_UNI**, **RTE\_FIB\_LOOKUP\_DIR24\_8\_VECTOR\_AVX512** }\

### Functions

struct rte\_fib \* **rte\_fib\_create** (const char \*name, int socket\_id, struct **rte\_fib\_conf** \*conf)\
 struct rte\_fib \* **rte\_fib\_find\_existing** (const char \*name)\
 void **rte\_fib\_free** (struct rte\_fib \*fib)\
 int **rte\_fib\_add** (struct rte\_fib \*fib, uint32\_t ip, uint8\_t depth, uint64\_t next\_hop)\
 int **rte\_fib\_delete** (struct rte\_fib \*fib, uint32\_t ip, uint8\_t depth)\
 int **rte\_fib\_lookup\_bulk** (struct rte\_fib \*fib, uint32\_t \*ips, uint64\_t \*next\_hops, int n)\
 void \* **rte\_fib\_get\_dp** (struct rte\_fib \*fib)\
 struct rte\_rib \* **rte\_fib\_get\_rib** (struct rte\_fib \*fib)\
 int **rte\_fib\_select\_lookup** (struct rte\_fib \*fib, enum **rte\_fib\_lookup\_type** type)\
 \_\_rte\_experimental int **rte\_fib\_rcu\_qsbr\_add** (struct rte\_fib \*fib, struct **rte\_fib\_rcu\_config** \*cfg)\

## Detailed Description

RTE FIB library.

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

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

## Macro Definition Documentation

### #define RTE\_FIB\_MAXDEPTH 32

Maximum depth value possible for IPv4 FIB.

Definition at line **30** of file **rte\_fib.h**.

### #define RTE\_FIB\_F\_LOOKUP\_NETWORK\_ORDER 1

If set, fib lookup is expecting IPv4 address in network byte order

Definition at line **91** of file **rte\_fib.h**.

## Typedef Documentation

### typedef int(\* rte\_fib\_modify\_fn\_t) (struct rte\_fib \*fib, uint32\_t ip, uint8\_t depth, uint64\_t next\_hop, int op)

Modify FIB function

Definition at line **52** of file **rte\_fib.h**.

### typedef void(\* rte\_fib\_lookup\_fn\_t) (void \*fib, const uint32\_t \*ips, uint64\_t \*next\_hops, const unsigned int n)

FIB bulk lookup function

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

## Enumeration Type Documentation

### enum rte\_fib\_qsbr\_mode

RCU reclamation modes

**Enumerator**

- *RTE\_FIB\_QSBR\_MODE\_DQ*

  *Create defer queue for reclaim.*

- *RTE\_FIB\_QSBR\_MODE\_SYNC*

  *Use blocking mode reclaim. No defer queue created.*

*Definition at line* **38** *of file* **rte\_fib.h***.*

### enum rte\_fib\_type

*Type of FIB struct*

**Enumerator**

- *RTE\_FIB\_DUMMY*

  *RIB tree based FIB*

- *RTE\_FIB\_DIR24\_8*

  *DIR24\_8 based FIB*

*Definition at line* **46** *of file* **rte\_fib.h***.*

### enum rte\_fib\_dir24\_8\_nh\_sz

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

*Definition at line* **64** *of file* **rte\_fib.h***.*

### enum rte\_fib\_lookup\_type

*Type of lookup function implementation*

**Enumerator**

- *RTE\_FIB\_LOOKUP\_DEFAULT*

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

- *RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_MACRO*

  *Macro based lookup function*

- *RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_INLINE*

  *Lookup implementation using inlined functions for different next hop sizes*

- *RTE\_FIB\_LOOKUP\_DIR24\_8\_SCALAR\_UNI*

  *Unified lookup function for all next hop sizes*

- *RTE\_FIB\_LOOKUP\_DIR24\_8\_VECTOR\_AVX512*

  *Vector implementation using AVX512*

*Definition at line* **72** *of file* **rte\_fib.h***.*

## Function Documentation

### struct rte\_fib \* rte\_fib\_create (const char \* name, int socket\_id, struct rte\_fib\_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 the FIB object on success NULL otherwise with rte\_errno set to an appropriate values.*

### struct rte\_fib \* rte\_fib\_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\_fib\_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\_fib\_free (struct rte\_fib \* fib)

*Free an FIB object.*

**Parameters**

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

### int rte\_fib\_add (struct rte\_fib \* fib, uint32\_t ip, uint8\_t depth, uint64\_t next\_hop)

*Add a route to the FIB.*

**Parameters**

*fib FIB object handle* \
 *ip IPv4 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\_fib\_delete (struct rte\_fib \* fib, uint32\_t ip, uint8\_t depth)

*Delete a rule from the FIB.*

**Parameters**

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

**Returns**

*0 on success, negative value otherwise*

### int rte\_fib\_lookup\_bulk (struct rte\_fib \* fib, uint32\_t \* ips, uint64\_t \* next\_hops, int n)

*Lookup multiple IP addresses in the FIB.*

**Parameters**

*fib FIB object handle* \
 *ips Array of IPs 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\_fib\_get\_dp (struct rte\_fib \* fib)

*Get pointer to the dataplane specific struct*

**Parameters**

*fib FIB object handle*

**Returns**

*Pointer on the dataplane struct on success NULL otherwise*

### struct rte\_rib \* rte\_fib\_get\_rib (struct rte\_fib \* fib)

*Get pointer to the RIB*

**Parameters**

*fib FIB object handle*

**Returns**

*Pointer on the RIB on success NULL otherwise*

### int rte\_fib\_select\_lookup (struct rte\_fib \* fib, enum rte\_fib\_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*

### \_\_rte\_experimental int rte\_fib\_rcu\_qsbr\_add (struct rte\_fib \* fib, struct rte\_fib\_rcu\_config \* cfg)

*Associate RCU QSBR variable with a FIB object.*

**Parameters**

*fib FIB object handle* \
 *cfg RCU QSBR configuration*

**Returns**

*0 on success Negative otherwise Possible error codes are:*

- •

  *-EINVAL - invalid parameters*

- •

  *-EEXIST - already added QSBR*

- •

  *-ENOMEM - memory allocation failure*

- •

  *-ENOTSUP - not supported by configured dataplane algorithm*

## Author

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