rte_fib6.h(3)

πŸ’– rte_fib6.h β€” Library Functions Manual πŸŽ€

okay bestie, gather round, because today we're reading the man page for rte_fib6.h, straight out of the DPDK library functions manual ✨ it's giving "IPv6 routing but make it glamorous" and honestly? we're obsessed.


🌸 NAME 🌸

rte_fib6.h β€” the header itself, the moment, the icon πŸ‘‘


✨ SYNOPSIS ✨

first, the pregame. you gotta pull in the headers:

#include <stdint.h>
#include <rte_common.h>
#include <rte_ip6.h>
#include <rte_rcu_qsbr.h>

🌈 Data Structures

  • struct rte_fib6_conf
  • struct rte_fib6_rcu_config

🌈 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_qsbr_mode { RTE_FIB6_QSBR_MODE_DQ = 0,
    RTE_FIB6_QSBR_MODE_SYNC }
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

void rte_fib6_free (struct rte_fib6 *fib)
struct rte_fib6 * rte_fib6_create (const char *name, int socket_id,
    struct rte_fib6_conf *conf) __rte_malloc __rte_dealloc(rte_fib6_free
struct rte_fib6 struct rte_fib6 * rte_fib6_find_existing (const char
    *name)
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)
__rte_experimental int rte_fib6_rcu_qsbr_add (struct rte_fib6 *fib,
    struct rte_fib6_rcu_config *cfg)

πŸ¦‹ Detailed Description πŸ¦‹

the RTE FIB6 library, bestie πŸ’…

it's the FIB (Forwarding information base) implementation for IPv6 Longest Prefix Match. yes that's a mouthful and yes it's iconic.

Definition in file rte_fib6.h.


πŸ’œ Macro Definition Documentation πŸ’œ

#define RTE_FIB6_MAXDEPTH (RTE_DEPRECATED(RTE_FIB6_MAXDEPTH) RTE_IPV6_MAX_DEPTH)

the maximum depth value possible for IPv6 FIB, fr fr.

Definition at line 30 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)

the Modify FIB function πŸ› οΈ obviously.

Definition at line 58 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)

the FIB bulk lookup function, she's the one doing the heavy lifting πŸ”

Definition at line 62 of file rte_fib6.h.


🌟 Enumeration Type Documentation 🌟

enum rte_fib6_qsbr_mode

RCU reclamation modes πŸ’€ reclaim responsibly.

Enumerator

  • RTE_FIB6_QSBR_MODE_DQ β€” create a defer queue for reclaim.
  • RTE_FIB6_QSBR_MODE_SYNC β€” use blocking mode reclaim. no defer queue created. periodt.

Definition at line 44 of file rte_fib6.h.

enum rte_fib6_type

type of FIB struct, lowkey important.

Enumerator

  • RTE_FIB6_DUMMY β€” RIB6 tree based FIB.
  • RTE_FIB6_TRIE β€” TRIE based fib ✨

Definition at line 52 of file rte_fib6.h.

enum rte_fib_trie_nh_sz

size of nexthop (1 << nh_sz) bits for TRIE based FIB. math? in my man page? more likely than you think πŸ“

Definition at line 72 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. she's adaptive, she's flexible πŸ’…
  • RTE_FIB6_LOOKUP_TRIE_SCALAR β€” scalar lookup function implementation.
  • RTE_FIB6_LOOKUP_TRIE_VECTOR_AVX512 β€” vector implementation using AVX512 πŸ”₯

Definition at line 79 of file rte_fib6.h.


🫢 Function Documentation 🫢

void rte_fib6_free (struct rte_fib6 * fib)

free an FIB object and let it rest πŸ•ŠοΈ

Parameters

  • fib β€” FIB object handle created by rte_fib6_create(). if fib is NULL, no operation is performed. no cap, she just doesn't care.

struct rte_fib6 * rte_fib6_create (const char * name, int socket_id, struct rte_fib6_conf * conf)

create FIB. birth of an icon 🌱

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. (yes "values", we're quoting the original, don't @ me 😭)

struct rte_fib6 struct rte_fib6 * rte_fib6_find_existing (const char * name)

find an existing FIB object and return a pointer to it, like spotting your bestie in a crowd πŸ«‚

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.

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. we love a clean slate πŸ’…

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. bulk queen behavior πŸ‘‘

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.

__rte_experimental int rte_fib6_rcu_qsbr_add (struct rte_fib6 * fib, struct rte_fib6_rcu_config * cfg)

associate an RCU QSBR variable with a FIB object πŸ”—

heads up bestie: this one is __rte_experimental, so it's giving "beta, use with care" energy πŸ™ˆ

Parameters

  • fib β€” FIB object handle
  • cfg β€” RCU QSBR configuration

Returns

0 on success, -EINVAL β€” invalid pointer, -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. shoutout to the robots πŸ€–πŸ’…


and that's the whole vibe check, bestie 🫢 this was rte_fib6.h(3) from DPDK, version 25.11.3 β€” go forth and route your IPv6 prefixes like the main character you are πŸŒΈβœ¨πŸ‘‘

πŸ“¦ where this page comes from