FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
load_balance_map.c File Reference
+ Include dependency graph for load_balance_map.c:

Go to the source code of this file.

Data Structures

struct  load_balance_map_path_t_
 

Macros

#define LOAD_BALANCE_MAP_DBG(_pl, _fmt, _args...)
 

Typedefs

typedef enum load_balance_map_path_flags_t_ load_balance_map_path_flags_t
 
typedef struct load_balance_map_path_t_ load_balance_map_path_t
 

Enumerations

enum  load_balance_map_path_flags_t_ { LOAD_BALANCE_MAP_PATH_UP = (1 << 0), LOAD_BALANCE_MAP_PATH_USABLE = (1 << 1) }
 

Functions

static index_t load_balance_map_get_index (load_balance_map_t *lbm)
 
u8format_load_balance_map (u8 *s, va_list *ap)
 
static uword load_balance_map_hash (load_balance_map_t *lbm)
 
static uword load_balance_map_db_hash_key_from_index (uword index)
 
static uword load_balance_map_db_hash_key_is_index (uword key)
 
static uword load_balance_map_db_hash_key_2_index (uword key)
 
static load_balance_map_tload_balance_map_db_get_from_hash_key (uword key)
 
static uword load_balance_map_db_hash_key_sum (hash_t *h, uword key)
 
static uword load_balance_map_db_hash_key_equal (hash_t *h, uword key1, uword key2)
 
static index_t load_balance_map_db_find (load_balance_map_t *lbm)
 
static void load_balance_map_db_insert (load_balance_map_t *lbm)
 
static void load_balance_map_db_remove (load_balance_map_t *lbm)
 
static void load_balance_map_fill (load_balance_map_t *lbm)
 from the paths that are usable, fill the Map. More...
 
static load_balance_map_tload_balance_map_alloc (const load_balance_path_t *paths)
 
static load_balance_map_tload_balance_map_init (load_balance_map_t *lbm, u32 n_buckets, u32 sum_of_weights)
 
static void load_balance_map_destroy (load_balance_map_t *lbm)
 
index_t load_balance_map_add_or_lock (u32 n_buckets, u32 sum_of_weights, const load_balance_path_t *paths)
 
void load_balance_map_lock (index_t lbmi)
 
void load_balance_map_unlock (index_t lbmi)
 
static int load_balance_map_path_state_change_walk (fib_node_ptr_t *fptr, void *ctx)
 
void load_balance_map_path_state_change (fib_node_index_t path_index)
 the state of a path has changed (it has no doubt gone down). More...
 
void load_balance_map_module_init (void)
 Make/add a new or lock an existing Load-balance map. More...
 
void load_balance_map_show_mem (void)
 
static clib_error_tload_balance_map_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static uwordlb_maps_by_path_index
 A hash-table of load-balance maps by path index. More...
 
static uwordload_balance_map_db
 A hash-table of load-balance maps by set of paths. More...
 
load_balance_map_tload_balance_map_pool
 The global pool of LB maps. More...
 
static vlib_cli_command_t load_balance_map_show_command
 (constructor) VLIB_CLI_COMMAND (load_balance_map_show_command) More...
 

Macro Definition Documentation

#define LOAD_BALANCE_MAP_DBG (   _pl,
  _fmt,
  _args... 
)

Definition at line 81 of file load_balance_map.c.

Typedef Documentation

Enumeration Type Documentation

Enumerator
LOAD_BALANCE_MAP_PATH_UP 
LOAD_BALANCE_MAP_PATH_USABLE 

Definition at line 38 of file load_balance_map.c.

Function Documentation

u8* format_load_balance_map ( u8 s,
va_list *  ap 
)

Definition at line 91 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

index_t load_balance_map_add_or_lock ( u32  n_buckets,
u32  sum_of_weights,
const load_balance_path_t paths 
)

Definition at line 427 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static load_balance_map_t* load_balance_map_alloc ( const load_balance_path_t paths)
static

Definition at line 384 of file load_balance_map.c.

+ Here is the caller graph for this function:

static index_t load_balance_map_db_find ( load_balance_map_t lbm)
static

Definition at line 199 of file load_balance_map.c.

+ Here is the caller graph for this function:

static load_balance_map_t* load_balance_map_db_get_from_hash_key ( uword  key)
static

Definition at line 154 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword load_balance_map_db_hash_key_2_index ( uword  key)
inlinestatic

Definition at line 147 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 185 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword load_balance_map_db_hash_key_from_index ( uword  index)
inlinestatic

Definition at line 135 of file load_balance_map.c.

+ Here is the caller graph for this function:

static uword load_balance_map_db_hash_key_is_index ( uword  key)
inlinestatic

Definition at line 141 of file load_balance_map.c.

+ Here is the caller graph for this function:

static uword load_balance_map_db_hash_key_sum ( hash_t h,
uword  key 
)
static

Definition at line 174 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_balance_map_db_insert ( load_balance_map_t lbm)
static

Definition at line 214 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_balance_map_db_remove ( load_balance_map_t lbm)
static

Definition at line 257 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_balance_map_destroy ( load_balance_map_t lbm)
static

Definition at line 419 of file load_balance_map.c.

+ Here is the caller graph for this function:

static void load_balance_map_fill ( load_balance_map_t lbm)
static

from the paths that are usable, fill the Map.

Definition at line 287 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static index_t load_balance_map_get_index ( load_balance_map_t lbm)
static

Definition at line 85 of file load_balance_map.c.

+ Here is the caller graph for this function:

static uword load_balance_map_hash ( load_balance_map_t lbm)
static

Definition at line 118 of file load_balance_map.c.

+ Here is the caller graph for this function:

static load_balance_map_t* load_balance_map_init ( load_balance_map_t lbm,
u32  n_buckets,
u32  sum_of_weights 
)
static

Definition at line 404 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void load_balance_map_lock ( index_t  lbmi)

Definition at line 454 of file load_balance_map.c.

+ Here is the call graph for this function:

void load_balance_map_module_init ( void  )

Make/add a new or lock an existing Load-balance map.

Definition at line 522 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void load_balance_map_path_state_change ( fib_node_index_t  path_index)

the state of a path has changed (it has no doubt gone down).

This is the trigger to perform a PIC edge cutover and update the maps to exclude this path.

Definition at line 503 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int load_balance_map_path_state_change_walk ( fib_node_ptr_t fptr,
void *  ctx 
)
static

Definition at line 485 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 546 of file load_balance_map.c.

+ Here is the call graph for this function:

void load_balance_map_show_mem ( void  )

Definition at line 537 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void load_balance_map_unlock ( index_t  lbmi)

Definition at line 464 of file load_balance_map.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uword* lb_maps_by_path_index
static

A hash-table of load-balance maps by path index.

this provides the fast lookup of the LB map when a path goes down

Definition at line 27 of file load_balance_map.c.

uword* load_balance_map_db
static

A hash-table of load-balance maps by set of paths.

This provides the LB map sharing. LB maps do not necessarily use all the paths in the list, since the entry that is requesting the map, may not have an out-going label for each of the paths.

Definition at line 36 of file load_balance_map.c.

load_balance_map_t* load_balance_map_pool

The global pool of LB maps.

The encapsulation breakages are for fast DP access.

Definition at line 69 of file load_balance_map.c.

vlib_cli_command_t load_balance_map_show_command
static
Initial value:
= {
.path = "show load-balance-map",
.short_help = "show load-balance-map [<index>]",
.function = load_balance_map_show,
}
static clib_error_t * load_balance_map_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (load_balance_map_show_command)

Definition at line 578 of file load_balance_map.c.