#include <stdint.h>
#include <rte_compat.h>
Go to the source code of this file.
|
typedef int(* | rte_fib6_modify_fn_t) (struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop, int op) |
|
typedef void(* | rte_fib6_lookup_fn_t) (void *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, const unsigned int n) |
|
|
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 uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop) |
|
int | rte_fib6_delete (struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth) |
|
int | rte_fib6_lookup_bulk (struct rte_fib6 *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], 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 FIB6 library.
FIB (Forwarding information base) implementation for IPv6 Longest Prefix Match
Definition in file rte_fib6.h.
◆ RTE_FIB6_MAXDEPTH
#define RTE_FIB6_MAXDEPTH 128 |
Maximum depth value possible for IPv6 FIB.
Definition at line 28 of file rte_fib6.h.
◆ rte_fib6_modify_fn_t
typedef int(* rte_fib6_modify_fn_t) (struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop, int op) |
Modify FIB function
Definition at line 40 of file rte_fib6.h.
◆ rte_fib6_lookup_fn_t
typedef void(* rte_fib6_lookup_fn_t) (void *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, const unsigned int n) |
FIB bulk lookup function
Definition at line 44 of file rte_fib6.h.
◆ rte_fib6_type
Type of FIB struct
Enumerator |
---|
RTE_FIB6_DUMMY | RIB6 tree based FIB
|
RTE_FIB6_TRIE | TRIE based fib
|
Definition at line 34 of file rte_fib6.h.
◆ rte_fib_trie_nh_sz
Size of nexthop (1 << nh_sz) bits for TRIE based FIB
Definition at line 54 of file rte_fib6.h.
◆ 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 61 of file rte_fib6.h.
◆ rte_fib6_create()
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.
- Examples:
- examples/l3fwd/l3fwd_fib.c.
◆ rte_fib6_find_existing()
struct rte_fib6* rte_fib6_find_existing |
( |
const char * |
name | ) |
|
Find an existing FIB object and return a pointer to it.
- Parameters
-
- 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.
◆ rte_fib6_free()
void rte_fib6_free |
( |
struct rte_fib6 * |
fib | ) |
|
Free an FIB object.
- Parameters
-
◆ rte_fib6_add()
int rte_fib6_add |
( |
struct rte_fib6 * |
fib, |
|
|
const uint8_t |
ip[RTE_FIB6_IPV6_ADDR_SIZE], |
|
|
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
- Examples:
- examples/l3fwd/l3fwd_fib.c.
◆ rte_fib6_delete()
int rte_fib6_delete |
( |
struct rte_fib6 * |
fib, |
|
|
const uint8_t |
ip[RTE_FIB6_IPV6_ADDR_SIZE], |
|
|
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
◆ rte_fib6_lookup_bulk()
int rte_fib6_lookup_bulk |
( |
struct rte_fib6 * |
fib, |
|
|
uint8_t |
ips[][RTE_FIB6_IPV6_ADDR_SIZE], |
|
|
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
- Examples:
- examples/l3fwd/l3fwd_fib.c.
◆ rte_fib6_get_dp()
void* rte_fib6_get_dp |
( |
struct rte_fib6 * |
fib | ) |
|
Get pointer to the dataplane specific struct
- Parameters
-
- Returns
- Pointer on the dataplane struct on success NULL otherwise
◆ rte_fib6_get_rib()
struct rte_rib6* rte_fib6_get_rib |
( |
struct rte_fib6 * |
fib | ) |
|
Get pointer to the RIB6
- Parameters
-
- Returns
- Pointer on the RIB6 on success NULL otherwise
◆ rte_fib6_select_lookup()
Set lookup function based on type
- Parameters
-
fib | FIB object handle |
type | type of lookup function |
- Returns
- 0 on success -EINVAL on failure