.TH "rte_fib.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_fib.h
.SH SYNOPSIS
.br
.PP
\fR#include <stdint\&.h>\fP
.br
\fR#include <rte_common\&.h>\fP
.br
\fR#include <rte_rcu_qsbr\&.h>\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_fib_conf\fP"
.br
.ti -1c
.RI "struct \fBrte_fib_rcu_config\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_FIB_MAXDEPTH\fP   32"
.br
.ti -1c
.RI "#define \fBRTE_FIB_F_LOOKUP_NETWORK_ORDER\fP   1"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "\fBtypedef\fP int(* \fBrte_fib_modify_fn_t\fP) (struct rte_fib *fib, uint32_t ip, uint8_t depth, uint64_t next_hop, int op)"
.br
.ti -1c
.RI "\fBtypedef\fP void(* \fBrte_fib_lookup_fn_t\fP) (void *fib, const uint32_t *ips, uint64_t *next_hops, const unsigned int n)"
.br
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBrte_fib_qsbr_mode\fP { \fBRTE_FIB_QSBR_MODE_DQ\fP = 0, \fBRTE_FIB_QSBR_MODE_SYNC\fP }"
.br
.ti -1c
.RI "enum \fBrte_fib_type\fP { \fBRTE_FIB_DUMMY\fP, \fBRTE_FIB_DIR24_8\fP }"
.br
.ti -1c
.RI "enum \fBrte_fib_dir24_8_nh_sz\fP "
.br
.ti -1c
.RI "enum \fBrte_fib_lookup_type\fP { \fBRTE_FIB_LOOKUP_DEFAULT\fP, \fBRTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO\fP, \fBRTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE\fP, \fBRTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI\fP, \fBRTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512\fP }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBrte_fib_free\fP (struct rte_fib *fib)"
.br
.ti -1c
.RI "struct rte_fib * \fBrte_fib_create\fP (const char *name, int socket_id, struct \fBrte_fib_conf\fP *conf) \fB__rte_malloc\fP \fB__rte_dealloc\fP(\fBrte_fib_free\fP"
.br
.ti -1c
.RI "struct rte_fib struct rte_fib * \fBrte_fib_find_existing\fP (const char *name)"
.br
.ti -1c
.RI "int \fBrte_fib_add\fP (struct rte_fib *fib, uint32_t ip, uint8_t depth, uint64_t next_hop)"
.br
.ti -1c
.RI "int \fBrte_fib_delete\fP (struct rte_fib *fib, uint32_t ip, uint8_t depth)"
.br
.ti -1c
.RI "int \fBrte_fib_lookup_bulk\fP (struct rte_fib *fib, uint32_t *ips, uint64_t *next_hops, int n)"
.br
.ti -1c
.RI "void * \fBrte_fib_get_dp\fP (struct rte_fib *fib)"
.br
.ti -1c
.RI "struct rte_rib * \fBrte_fib_get_rib\fP (struct rte_fib *fib)"
.br
.ti -1c
.RI "int \fBrte_fib_select_lookup\fP (struct rte_fib *fib, enum \fBrte_fib_lookup_type\fP type)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_fib_rcu_qsbr_add\fP (struct rte_fib *fib, struct \fBrte_fib_rcu_config\fP *cfg)"
.br
.in -1c
.SH "Detailed Description"
.PP 
RTE FIB library\&.

.PP
FIB (Forwarding information base) implementation for IPv4 Longest Prefix Match 
.PP
Definition in file \fBrte_fib\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#define RTE_FIB_MAXDEPTH   32"
Maximum depth value possible for IPv4 FIB\&. 
.PP
Definition at line \fB34\fP of file \fBrte_fib\&.h\fP\&.
.SS "#define RTE_FIB_F_LOOKUP_NETWORK_ORDER   1"
If set, fib lookup is expecting IPv4 address in network byte order 
.PP
Definition at line \fB95\fP of file \fBrte_fib\&.h\fP\&.
.SH "Typedef Documentation"
.PP 
.SS "\fBtypedef\fP 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 
.PP
Definition at line \fB56\fP of file \fBrte_fib\&.h\fP\&.
.SS "\fBtypedef\fP void(* rte_fib_lookup_fn_t) (void *fib, const uint32_t *ips, uint64_t *next_hops, const unsigned int n)"
FIB bulk lookup function 
.PP
Definition at line \fB59\fP of file \fBrte_fib\&.h\fP\&.
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBrte_fib_qsbr_mode\fP"
RCU reclamation modes 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_FIB_QSBR_MODE_DQ \fP
Create defer queue for reclaim\&. 
.TP
\f(BIRTE_FIB_QSBR_MODE_SYNC \fP
Use blocking mode reclaim\&. No defer queue created\&. 
.PP
Definition at line \fB42\fP of file \fBrte_fib\&.h\fP\&.
.SS "enum \fBrte_fib_type\fP"
Type of FIB struct 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_FIB_DUMMY \fP
RIB tree based FIB 
.TP
\f(BIRTE_FIB_DIR24_8 \fP
DIR24_8 based FIB 
.PP
Definition at line \fB50\fP of file \fBrte_fib\&.h\fP\&.
.SS "enum \fBrte_fib_dir24_8_nh_sz\fP"
Size of nexthop (1 << nh_sz) bits for DIR24_8 based FIB 
.PP
Definition at line \fB68\fP of file \fBrte_fib\&.h\fP\&.
.SS "enum \fBrte_fib_lookup_type\fP"
Type of lookup function implementation 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_FIB_LOOKUP_DEFAULT \fP
Selects the best implementation based on the max simd bitwidth 
.TP
\f(BIRTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO \fP
Macro based lookup function 
.TP
\f(BIRTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE \fP
Lookup implementation using inlined functions for different next hop sizes 
.TP
\f(BIRTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI \fP
Unified lookup function for all next hop sizes 
.TP
\f(BIRTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512 \fP
Vector implementation using AVX512 
.PP
Definition at line \fB76\fP of file \fBrte_fib\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "void rte_fib_free (struct rte_fib * fib)"
Free an FIB object\&.

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle created by \fBrte_fib_create()\fP\&. If fib is NULL, no operation is performed\&. 
.RE
.PP

.SS "struct rte_fib * rte_fib_create (const char * name, int socket_id, struct \fBrte_fib_conf\fP * conf)"
Create FIB

.PP
\fBParameters\fP
.RS 4
\fIname\fP FIB name 
.br
\fIsocket_id\fP NUMA socket ID for FIB table memory allocation 
.br
\fIconf\fP Structure containing the configuration 
.RE
.PP
\fBReturns\fP
.RS 4
Handle to the FIB object on success NULL otherwise with rte_errno set to an appropriate values\&. 
.RE
.PP

.SS "struct rte_fib struct rte_fib * rte_fib_find_existing (const char * name)"
Find an existing FIB object and return a pointer to it\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Name of the fib object as passed to \fBrte_fib_create()\fP 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer to fib object or NULL if object not found with rte_errno set appropriately\&. Possible rte_errno values include:
.IP "\(bu" 2
ENOENT - required entry not available to return\&. 
.PP
.RE
.PP

.SS "int rte_fib_add (struct rte_fib * fib, uint32_t ip, uint8_t depth, uint64_t next_hop)"
Add a route to the FIB\&.

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.br
\fIip\fP IPv4 prefix address to be added to the FIB 
.br
\fIdepth\fP Prefix length 
.br
\fInext_hop\fP Next hop to be added to the FIB 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, negative value otherwise 
.RE
.PP

.SS "int rte_fib_delete (struct rte_fib * fib, uint32_t ip, uint8_t depth)"
Delete a rule from the FIB\&.

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.br
\fIip\fP IPv4 prefix address to be deleted from the FIB 
.br
\fIdepth\fP Prefix length 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, negative value otherwise 
.RE
.PP

.SS "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\&.

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.br
\fIips\fP Array of IPs to be looked up in the FIB 
.br
\fInext_hops\fP 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\&. 
.br
\fIn\fP Number of elements in ips (and next_hops) array to lookup\&. 
.RE
.PP
\fBReturns\fP
.RS 4
-EINVAL for incorrect arguments, otherwise 0 
.RE
.PP

.SS "void * rte_fib_get_dp (struct rte_fib * fib)"
Get pointer to the dataplane specific struct

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer on the dataplane struct on success NULL otherwise 
.RE
.PP

.SS "struct rte_rib * rte_fib_get_rib (struct rte_fib * fib)"
Get pointer to the RIB

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer on the RIB on success NULL otherwise 
.RE
.PP

.SS "int rte_fib_select_lookup (struct rte_fib * fib, enum \fBrte_fib_lookup_type\fP type)"
Set lookup function based on type

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.br
\fItype\fP type of lookup function
.RE
.PP
\fBReturns\fP
.RS 4
0 on success -EINVAL on failure 
.RE
.PP

.SS "__rte_experimental int rte_fib_rcu_qsbr_add (struct rte_fib * fib, struct \fBrte_fib_rcu_config\fP * cfg)"
Associate RCU QSBR variable with a FIB object\&.

.PP
\fBParameters\fP
.RS 4
\fIfib\fP FIB object handle 
.br
\fIcfg\fP RCU QSBR configuration 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success Negative otherwise Possible error codes are:
.IP "\(bu" 2
-EINVAL - invalid parameters
.IP "\(bu" 2
-EEXIST - already added QSBR
.IP "\(bu" 2
-ENOMEM - memory allocation failure
.IP "\(bu" 2
-ENOTSUP - not supported by configured dataplane algorithm 
.PP
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
