FD.io VPP  v19.08.3-2-gbabecb413
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...
 
vlib_log_class_t load_balance_map_logger
 the logger More...
 
static vlib_cli_command_t load_balance_map_show_command
 (constructor) VLIB_CLI_COMMAND (load_balance_map_show_command) More...
 

Macro Definition Documentation

◆ LOAD_BALANCE_MAP_DBG

#define LOAD_BALANCE_MAP_DBG (   _pl,
  _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug(load_balance_map_logger, \
"lbm:" _fmt, \
##_args); \
}
vlib_log_class_t load_balance_map_logger
the logger

Definition at line 79 of file load_balance_map.c.

Typedef Documentation

◆ load_balance_map_path_flags_t

◆ load_balance_map_path_t

Enumeration Type Documentation

◆ load_balance_map_path_flags_t_

Enumerator
LOAD_BALANCE_MAP_PATH_UP 
LOAD_BALANCE_MAP_PATH_USABLE 

Definition at line 38 of file load_balance_map.c.

Function Documentation

◆ format_load_balance_map()

u8* format_load_balance_map ( u8 s,
va_list *  ap 
)

Definition at line 93 of file load_balance_map.c.

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

◆ load_balance_map_add_or_lock()

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

Definition at line 437 of file load_balance_map.c.

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

◆ load_balance_map_alloc()

static load_balance_map_t* load_balance_map_alloc ( const load_balance_path_t paths)
static

Definition at line 386 of file load_balance_map.c.

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

◆ load_balance_map_db_find()

static index_t load_balance_map_db_find ( load_balance_map_t lbm)
static

Definition at line 201 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_db_get_from_hash_key()

static load_balance_map_t* load_balance_map_db_get_from_hash_key ( uword  key)
static

Definition at line 156 of file load_balance_map.c.

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

◆ load_balance_map_db_hash_key_2_index()

static uword load_balance_map_db_hash_key_2_index ( uword  key)
inlinestatic

Definition at line 149 of file load_balance_map.c.

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

◆ load_balance_map_db_hash_key_equal()

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

Definition at line 187 of file load_balance_map.c.

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

◆ load_balance_map_db_hash_key_from_index()

static uword load_balance_map_db_hash_key_from_index ( uword  index)
inlinestatic

Definition at line 137 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_db_hash_key_is_index()

static uword load_balance_map_db_hash_key_is_index ( uword  key)
inlinestatic

Definition at line 143 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_db_hash_key_sum()

static uword load_balance_map_db_hash_key_sum ( hash_t h,
uword  key 
)
static

Definition at line 176 of file load_balance_map.c.

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

◆ load_balance_map_db_insert()

static void load_balance_map_db_insert ( load_balance_map_t lbm)
static

Definition at line 216 of file load_balance_map.c.

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

◆ load_balance_map_db_remove()

static void load_balance_map_db_remove ( load_balance_map_t lbm)
static

Definition at line 259 of file load_balance_map.c.

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

◆ load_balance_map_destroy()

static void load_balance_map_destroy ( load_balance_map_t lbm)
static

Definition at line 429 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_fill()

static void load_balance_map_fill ( load_balance_map_t lbm)
static

from the paths that are usable, fill the Map.

Definition at line 289 of file load_balance_map.c.

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

◆ load_balance_map_get_index()

static index_t load_balance_map_get_index ( load_balance_map_t lbm)
static

Definition at line 87 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_hash()

static uword load_balance_map_hash ( load_balance_map_t lbm)
static

Definition at line 120 of file load_balance_map.c.

+ Here is the caller graph for this function:

◆ load_balance_map_init()

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 411 of file load_balance_map.c.

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

◆ load_balance_map_lock()

void load_balance_map_lock ( index_t  lbmi)

Definition at line 464 of file load_balance_map.c.

+ Here is the call graph for this function:

◆ load_balance_map_module_init()

void load_balance_map_module_init ( void  )

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

Definition at line 532 of file load_balance_map.c.

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

◆ load_balance_map_path_state_change()

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 513 of file load_balance_map.c.

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

◆ load_balance_map_path_state_change_walk()

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

Definition at line 495 of file load_balance_map.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this 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 
)
static

Definition at line 556 of file load_balance_map.c.

+ Here is the call graph for this function:

◆ load_balance_map_show_mem()

void load_balance_map_show_mem ( void  )

Definition at line 547 of file load_balance_map.c.

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

◆ load_balance_map_unlock()

void load_balance_map_unlock ( index_t  lbmi)

Definition at line 474 of file load_balance_map.c.

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

Variable Documentation

◆ lb_maps_by_path_index

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.

◆ load_balance_map_db

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_logger

vlib_log_class_t load_balance_map_logger

the logger

Definition at line 74 of file load_balance_map.c.

◆ load_balance_map_pool

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.

◆ load_balance_map_show_command

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 588 of file load_balance_map.c.