rte_fib.h(3)

✨ NAME ✨

rte_fib.h β€” bestie, this is a page from the DPDK Library Functions Manual, and it's literally the whole header for the RTE FIB library πŸ’– no cap, everything you need is right here.


🌸 SYNOPSIS 🌸

#include <stdint.h>
#include <rte_common.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

void rte_fib_free (struct rte_fib *fib)
struct rte_fib * rte_fib_create (const char *name, int socket_id, struct
    rte_fib_conf *conf) __rte_malloc __rte_dealloc(rte_fib_free
struct rte_fib struct rte_fib * rte_fib_find_existing (const char *name)
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

The maximum depth value possible for IPv4 FIB, bestie. That's the ceiling, fr fr.

Definition at line 34 of file rte_fib.h.

#define RTE_FIB_F_LOOKUP_NETWORK_ORDER 1

If this is set, fib lookup is expecting the IPv4 address in network byte order. iykyk.

Definition at line 95 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 56 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 59 of file rte_fib.h.


πŸ‘‘ Enumeration Type Documentation πŸ‘‘

enum rte_fib_qsbr_mode

RCU reclamation modes πŸŒ€

Enumerator

  • RTE_FIB_QSBR_MODE_DQ</strong> β€” create a defer queue for reclaim, slay.
  • RTE_FIB_QSBR_MODE_SYNC β€” use blocking mode reclaim. No defer queue created, periodt.

Definition at line 42 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 50 of file rte_fib.h.

enum rte_fib_dir24_8_nh_sz

Size of nexthop, which is (1 << nh_sz) bits, for the DIR24_8 based FIB πŸŽ€

Definition at line 68 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. iconic.

Definition at line 76 of file rte_fib.h.


πŸ› οΈ Function Documentation πŸ› οΈ

void rte_fib_free (struct rte_fib *fib)

Free an FIB object. 🫢 bye bestie.

Parameters

  • fib β€” FIB object handle created by rte_fib_create(). If fib is NULL, no operation is performed. Literally nothing happens, and that's on purpose.

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.

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 the corresponding element would contain the 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 an 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. the robot did it, not me 🫢


okay bestie that's literally the whole page πŸ’– stay slayful, keep your prefixes longest-matching, and remember: this lil doc came from DPDK, Version 25.11.3 β€” so if you're reading this in some other version, check the changelog, no cap πŸŽ€βœ¨

πŸ“¦ where this page comes from