FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
fib_path_list.c File Reference
+ Include dependency graph for fib_path_list.c:

Go to the source code of this file.

Data Structures

struct  fib_path_list_t_
 FIB path-list A representation of the list/set of path trough which a prefix is reachable. More...
 

Macros

#define FIB_PATH_LIST_POPULAR   64
 The magic number of child entries that make a path-list popular. More...
 
#define FIB_PATH_LIST_DBG(_pl, _fmt, _args...)
 

Typedefs

typedef struct fib_path_list_t_ fib_path_list_t
 FIB path-list A representation of the list/set of path trough which a prefix is reachable. More...
 

Functions

static fib_path_list_tfib_path_list_get (fib_node_index_t index)
 
static fib_node_tfib_path_list_get_node (fib_node_index_t index)
 
static fib_path_list_tfib_path_list_from_fib_node (fib_node_t *node)
 
static fib_node_index_t fib_path_list_get_index (fib_path_list_t *path_list)
 
u8format_fib_path_list (u8 *s, va_list *args)
 
u8fib_path_list_format (fib_node_index_t path_list_index, u8 *s)
 
static uword fib_path_list_hash (fib_path_list_t *path_list)
 
static uword fib_path_list_db_hash_key_from_index (uword index)
 
static uword fib_path_list_db_hash_key_is_index (uword key)
 
static uword fib_path_list_db_hash_key_2_index (uword key)
 
static fib_path_list_tfib_path_list_db_get_from_hash_key (uword key)
 
static uword fib_path_list_db_hash_key_sum (hash_t *h, uword key)
 
static uword fib_path_list_db_hash_key_equal (hash_t *h, uword key1, uword key2)
 
static fib_node_index_t fib_path_list_db_find (fib_path_list_t *path_list)
 
static void fib_path_list_db_insert (fib_node_index_t path_list_index)
 
static void fib_path_list_db_remove (fib_node_index_t path_list_index)
 
static void fib_path_list_destroy (fib_path_list_t *path_list)
 
static void fib_path_list_last_lock_gone (fib_node_t *node)
 
static load_balance_flags_t fib_path_list_fwd_flags_2_load_balance (fib_path_list_fwd_flags_t pl_flags)
 
static void fib_path_list_mk_lb (fib_path_list_t *path_list, fib_forward_chain_type_t fct, dpo_id_t *dpo, fib_path_list_fwd_flags_t flags)
 
static void fib_path_list_mk_urpf (fib_path_list_t *path_list)
 [re]build the path list's uRPF list More...
 
void fib_path_list_contribute_urpf (fib_node_index_t path_list_index, index_t urpf)
 Contribute (add) this path list's uRPF list. More...
 
index_t fib_path_list_get_urpf (fib_node_index_t path_list_index)
 Return the the child the RPF list pre-built for this path list. More...
 
void fib_path_list_back_walk (fib_node_index_t path_list_index, fib_node_back_walk_ctx_t *ctx)
 
static fib_node_back_walk_rc_t fib_path_list_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static void fib_path_list_memory_show (void)
 
static fib_path_list_tfib_path_list_alloc (fib_node_index_t *path_list_index)
 
static fib_path_list_tfib_path_list_resolve (fib_path_list_t *path_list)
 
u32 fib_path_list_get_n_paths (fib_node_index_t path_list_index)
 
u32 fib_path_list_get_resolving_interface (fib_node_index_t path_list_index)
 
dpo_proto_t fib_path_list_get_proto (fib_node_index_t path_list_index)
 
int fib_path_list_is_looped (fib_node_index_t path_list_index)
 
int fib_path_list_is_popular (fib_node_index_t path_list_index)
 
static fib_path_list_flags_t fib_path_list_flags_fixup (fib_path_list_flags_t flags)
 
fib_node_index_t fib_path_list_create (fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
 
static fib_path_cfg_flags_t fib_path_list_flags_2_path_flags (fib_path_list_flags_t plf)
 
fib_node_index_t fib_path_list_create_special (dpo_proto_t nh_proto, fib_path_list_flags_t flags, const dpo_id_t *dpo)
 
u32 fib_path_list_find_rpath (fib_node_index_t path_list_index, const fib_route_path_t *rpath)
 
fib_node_index_tfib_path_list_paths_add (fib_node_index_t path_list_index, const fib_route_path_t *rpaths)
 
fib_node_index_t fib_path_list_copy_and_path_add (fib_node_index_t orig_path_list_index, fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
 
fib_node_index_tfib_path_list_paths_remove (fib_node_index_t path_list_index, const fib_route_path_t *rpaths)
 
fib_node_index_t fib_path_list_copy_and_path_remove (fib_node_index_t orig_path_list_index, fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
 
void fib_path_list_contribute_forwarding (fib_node_index_t path_list_index, fib_forward_chain_type_t fct, fib_path_list_fwd_flags_t flags, dpo_id_t *dpo)
 
adj_index_t fib_path_list_get_adj (fib_node_index_t path_list_index, fib_forward_chain_type_t type)
 
int fib_path_list_recursive_loop_detect (fib_node_index_t path_list_index, fib_node_index_t **entry_indicies)
 
u32 fib_path_list_child_add (fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index)
 
void fib_path_list_child_remove (fib_node_index_t path_list_index, u32 si)
 
void fib_path_list_lock (fib_node_index_t path_list_index)
 
void fib_path_list_unlock (fib_node_index_t path_list_index)
 
u32 fib_path_list_pool_size (void)
 
u32 fib_path_list_db_size (void)
 
void fib_path_list_walk (fib_node_index_t path_list_index, fib_path_list_walk_fn_t func, void *ctx)
 
void fib_path_list_walk_w_ext (fib_node_index_t path_list_index, const fib_path_ext_list_t *ext_list, fib_path_list_walk_w_ext_fn_t func, void *ctx)
 
void fib_path_list_module_init (void)
 
static clib_error_tshow_fib_path_list_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static const char * fib_path_list_attr_names [] = FIB_PATH_LIST_ATTRIBUTES
 
static fib_path_list_tfib_path_list_pool
 
static uwordfib_path_list_db
 
vlib_log_class_t fib_path_list_logger
 the logger More...
 
static const fib_node_vft_t fib_path_list_vft
 
static vlib_cli_command_t show_fib_path_list
 (constructor) VLIB_CLI_COMMAND (show_fib_path_list) More...
 

Macro Definition Documentation

◆ FIB_PATH_LIST_DBG

#define FIB_PATH_LIST_DBG (   _pl,
  _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug(fib_path_list_logger, \
"[%U]:" _fmt, \
##_args); \
}

Definition at line 90 of file fib_path_list.c.

◆ FIB_PATH_LIST_POPULAR

#define FIB_PATH_LIST_POPULAR   64

The magic number of child entries that make a path-list popular.

There's a trade-off here between convergence and forwarding speed. Popular path-lists generate load-balance maps for the entries that use them. If the map is present there is a switch path cost to indirect through the map - this indirection provides the fast convergence - so without the map convergence is slower.

Definition at line 38 of file fib_path_list.c.

Typedef Documentation

◆ fib_path_list_t

FIB path-list A representation of the list/set of path trough which a prefix is reachable.

Function Documentation

◆ fib_path_list_alloc()

static fib_path_list_t* fib_path_list_alloc ( fib_node_index_t path_list_index)
inlinestatic

Definition at line 542 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_back_walk()

void fib_path_list_back_walk ( fib_node_index_t  path_list_index,
fib_node_back_walk_ctx_t ctx 
)

Definition at line 465 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_back_walk_notify()

static fib_node_back_walk_rc_t fib_path_list_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 505 of file fib_path_list.c.

◆ fib_path_list_child_add()

u32 fib_path_list_child_add ( fib_node_index_t  path_list_index,
fib_node_type_t  child_type,
fib_node_index_t  child_index 
)

Definition at line 1296 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_child_remove()

void fib_path_list_child_remove ( fib_node_index_t  path_list_index,
u32  si 
)

Definition at line 1335 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_contribute_forwarding()

void fib_path_list_contribute_forwarding ( fib_node_index_t  path_list_index,
fib_forward_chain_type_t  fct,
fib_path_list_fwd_flags_t  flags,
dpo_id_t dpo 
)

Definition at line 1211 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_contribute_urpf()

void fib_path_list_contribute_urpf ( fib_node_index_t  path_list_index,
index_t  urpf 
)

Contribute (add) this path list's uRPF list.

This allows the child to construct an aggregate list.

Definition at line 435 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_copy_and_path_add()

fib_node_index_t fib_path_list_copy_and_path_add ( fib_node_index_t  orig_path_list_index,
fib_path_list_flags_t  flags,
const fib_route_path_t rpaths 
)

Definition at line 907 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_copy_and_path_remove()

fib_node_index_t fib_path_list_copy_and_path_remove ( fib_node_index_t  orig_path_list_index,
fib_path_list_flags_t  flags,
const fib_route_path_t rpaths 
)

Definition at line 1086 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_create()

fib_node_index_t fib_path_list_create ( fib_path_list_flags_t  flags,
const fib_route_path_t rpaths 
)

Definition at line 682 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_create_special()

fib_node_index_t fib_path_list_create_special ( dpo_proto_t  nh_proto,
fib_path_list_flags_t  flags,
const dpo_id_t dpo 
)

Definition at line 774 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_find()

static fib_node_index_t fib_path_list_db_find ( fib_path_list_t path_list)
static

Definition at line 262 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_db_get_from_hash_key()

static fib_path_list_t* fib_path_list_db_get_from_hash_key ( uword  key)
static

Definition at line 217 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_hash_key_2_index()

static uword fib_path_list_db_hash_key_2_index ( uword  key)
inlinestatic

Definition at line 210 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_hash_key_equal()

static uword fib_path_list_db_hash_key_equal ( hash_t h,
uword  key1,
uword  key2 
)
static

Definition at line 248 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_hash_key_from_index()

static uword fib_path_list_db_hash_key_from_index ( uword  index)
inlinestatic

Definition at line 198 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_db_hash_key_is_index()

static uword fib_path_list_db_hash_key_is_index ( uword  key)
inlinestatic

Definition at line 204 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_db_hash_key_sum()

static uword fib_path_list_db_hash_key_sum ( hash_t h,
uword  key 
)
static

Definition at line 237 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_insert()

static void fib_path_list_db_insert ( fib_node_index_t  path_list_index)
static

Definition at line 277 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_remove()

static void fib_path_list_db_remove ( fib_node_index_t  path_list_index)
static

Definition at line 293 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_db_size()

u32 fib_path_list_db_size ( void  )

Definition at line 1376 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_destroy()

static void fib_path_list_destroy ( fib_path_list_t path_list)
static

Definition at line 308 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_find_rpath()

u32 fib_path_list_find_rpath ( fib_node_index_t  path_list_index,
const fib_route_path_t rpath 
)

Definition at line 804 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_flags_2_path_flags()

static fib_path_cfg_flags_t fib_path_list_flags_2_path_flags ( fib_path_list_flags_t  plf)
static

Definition at line 753 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_flags_fixup()

static fib_path_list_flags_t fib_path_list_flags_fixup ( fib_path_list_flags_t  flags)
static

Definition at line 667 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_format()

u8* fib_path_list_format ( fib_node_index_t  path_list_index,
u8 s 
)

Definition at line 165 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_from_fib_node()

static fib_path_list_t* fib_path_list_from_fib_node ( fib_node_t node)
static

Definition at line 112 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_fwd_flags_2_load_balance()

static load_balance_flags_t fib_path_list_fwd_flags_2_load_balance ( fib_path_list_fwd_flags_t  pl_flags)
static

Definition at line 343 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_get()

static fib_path_list_t* fib_path_list_get ( fib_node_index_t  index)
static

Definition at line 100 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_get_adj()

adj_index_t fib_path_list_get_adj ( fib_node_index_t  path_list_index,
fib_forward_chain_type_t  type 
)

Definition at line 1242 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_get_index()

static fib_node_index_t fib_path_list_get_index ( fib_path_list_t path_list)
static

Definition at line 119 of file fib_path_list.c.

+ Here is the caller graph for this function:

◆ fib_path_list_get_n_paths()

u32 fib_path_list_get_n_paths ( fib_node_index_t  path_list_index)

Definition at line 595 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_get_node()

static fib_node_t* fib_path_list_get_node ( fib_node_index_t  index)
static

Definition at line 106 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_get_proto()

dpo_proto_t fib_path_list_get_proto ( fib_node_index_t  path_list_index)

Definition at line 633 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_get_resolving_interface()

u32 fib_path_list_get_resolving_interface ( fib_node_index_t  path_list_index)

Definition at line 611 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_get_urpf()

index_t fib_path_list_get_urpf ( fib_node_index_t  path_list_index)

Return the the child the RPF list pre-built for this path list.

Definition at line 449 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_hash()

static uword fib_path_list_hash ( fib_path_list_t path_list)
static

Definition at line 172 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_is_looped()

int fib_path_list_is_looped ( fib_node_index_t  path_list_index)

Definition at line 647 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_is_popular()

int fib_path_list_is_popular ( fib_node_index_t  path_list_index)

Definition at line 657 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_last_lock_gone()

static void fib_path_list_last_lock_gone ( fib_node_t node)
static

Definition at line 327 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_lock()

void fib_path_list_lock ( fib_node_index_t  path_list_index)

Definition at line 1344 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_memory_show()

static void fib_path_list_memory_show ( void  )
static

Definition at line 522 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_mk_lb()

static void fib_path_list_mk_lb ( fib_path_list_t path_list,
fib_forward_chain_type_t  fct,
dpo_id_t dpo,
fib_path_list_fwd_flags_t  flags 
)
static

Definition at line 361 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_mk_urpf()

static void fib_path_list_mk_urpf ( fib_path_list_t path_list)
static

[re]build the path list's uRPF list

Definition at line 408 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_module_init()

void fib_path_list_module_init ( void  )

Definition at line 1425 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_paths_add()

fib_node_index_t* fib_path_list_paths_add ( fib_node_index_t  path_list_index,
const fib_route_path_t rpaths 
)

Definition at line 831 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_paths_remove()

fib_node_index_t* fib_path_list_paths_remove ( fib_node_index_t  path_list_index,
const fib_route_path_t rpaths 
)

Definition at line 1025 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_pool_size()

u32 fib_path_list_pool_size ( void  )

Definition at line 1370 of file fib_path_list.c.

+ Here is the call graph for this function:

◆ fib_path_list_recursive_loop_detect()

int fib_path_list_recursive_loop_detect ( fib_node_index_t  path_list_index,
fib_node_index_t **  entry_indicies 
)

Definition at line 1252 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_resolve()

static fib_path_list_t* fib_path_list_resolve ( fib_path_list_t path_list)
static

Definition at line 562 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_unlock()

void fib_path_list_unlock ( fib_node_index_t  path_list_index)

Definition at line 1357 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_walk()

void fib_path_list_walk ( fib_node_index_t  path_list_index,
fib_path_list_walk_fn_t  func,
void *  ctx 
)

Definition at line 1382 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fib_path_list_walk_w_ext()

void fib_path_list_walk_w_ext ( fib_node_index_t  path_list_index,
const fib_path_ext_list_t ext_list,
fib_path_list_walk_w_ext_fn_t  func,
void *  ctx 
)

Definition at line 1401 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_fib_path_list()

u8* format_fib_path_list ( u8 s,
va_list *  args 
)

Definition at line 125 of file fib_path_list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_fib_path_list_command()

static clib_error_t* show_fib_path_list_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1440 of file fib_path_list.c.

+ Here is the call graph for this function:

Variable Documentation

◆ fib_path_list_attr_names

const char* fib_path_list_attr_names[] = FIB_PATH_LIST_ATTRIBUTES
static

Definition at line 70 of file fib_path_list.c.

◆ fib_path_list_db

uword* fib_path_list_db
static

Definition at line 80 of file fib_path_list.c.

◆ fib_path_list_logger

vlib_log_class_t fib_path_list_logger

the logger

Definition at line 85 of file fib_path_list.c.

◆ fib_path_list_pool

fib_path_list_t* fib_path_list_pool
static

Definition at line 75 of file fib_path_list.c.

◆ fib_path_list_vft

const fib_node_vft_t fib_path_list_vft
static
Initial value:
= {
.fnv_last_lock = fib_path_list_last_lock_gone,
.fnv_mem_show = fib_path_list_memory_show,
}

Definition at line 534 of file fib_path_list.c.

◆ show_fib_path_list

vlib_cli_command_t show_fib_path_list
static
Initial value:
= {
.path = "show fib path-lists",
.short_help = "show fib path-lists",
}

(constructor) VLIB_CLI_COMMAND (show_fib_path_list)

Definition at line 1480 of file fib_path_list.c.

fib_path_list_last_lock_gone
static void fib_path_list_last_lock_gone(fib_node_t *node)
Definition: fib_path_list.c:327
show_fib_path_list_command
static clib_error_t * show_fib_path_list_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: fib_path_list.c:1440
fib_path_list_memory_show
static void fib_path_list_memory_show(void)
Definition: fib_path_list.c:522
format_fib_path_list
u8 * format_fib_path_list(u8 *s, va_list *args)
Definition: fib_path_list.c:125
fib_path_list_get_node
static fib_node_t * fib_path_list_get_node(fib_node_index_t index)
Definition: fib_path_list.c:106
fib_path_list_get_index
static fib_node_index_t fib_path_list_get_index(fib_path_list_t *path_list)
Definition: fib_path_list.c:119
fib_path_list_back_walk_notify
static fib_node_back_walk_rc_t fib_path_list_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Definition: fib_path_list.c:505
fib_path_list_logger
vlib_log_class_t fib_path_list_logger
the logger
Definition: fib_path_list.c:85