|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
79 #define LOAD_BALANCE_MAP_DBG(_pl, _fmt, _args...) \
81 vlib_log_debug(load_balance_map_logger, \
96 u32 indent = va_arg(*ap,
u32);
103 s =
format(s,
"load-balance-map: index:%d buckets:%d", lbmi, n_buckets);
105 for (ii = 0; ii < n_buckets; ii++)
110 for (ii = 0; ii < n_buckets; ii++)
122 u32 old_lbm_hash, new_lbm_hash, hash;
133 return (new_lbm_hash);
292 u32 n_buckets, bucket, ii, jj;
312 tmp_buckets[jj++] = bucket++;
320 _vec_len(tmp_buckets) = jj;
345 for (bucket = 0; bucket < n_buckets; bucket++)
374 jj = (jj + 1) %
vec_len(tmp_buckets);
589 .path =
"show load-balance-map",
590 .short_help =
"show load-balance-map [<index>]",
static uword load_balance_map_db_hash_key_equal(hash_t *h, uword key1, uword key2)
u32 lbm_locks
Number of locks.
void load_balance_map_unlock(index_t lbmi)
static load_balance_map_t * load_balance_map_get(index_t lbmi)
static uword load_balance_map_db_hash_key_sum(hash_t *h, uword key)
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).
static uword load_balance_map_db_hash_key_is_index(uword key)
#define hash_mix32(a0, b0, c0)
static uword load_balance_map_db_hash_key_from_index(uword index)
u32 fib_node_list_t
A list of FIB nodes.
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define FIB_NODE_INDEX_INVALID
void load_balance_map_lock(index_t lbmi)
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * load_balance_map_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static uword load_balance_map_hash(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.
u16 * lbm_buckets
The buckets of the map that provide the index to index translation.
#define dpo_pool_barrier_sync(VM, P, YESNO)
Barrier sync if a dpo pool is about to expand.
#define hash_create(elts, value_bytes)
#define hash_set(h, key, value)
#define LOAD_BALANCE_MAP_DBG(_pl, _fmt, _args...)
#define pool_foreach(VAR, POOL)
Iterate through pool.
load_balance_map_path_flags_t lbmp_flags
The sate of the path.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
@ LOAD_BALANCE_MAP_PATH_UP
u32 fib_node_index_t
A typedef of a node index.
#define vec_foreach_index(var, v)
Iterate over vector indices.
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
#define hash_create2(_elts, _user, _value_bytes, _key_sum, _key_equal, _format_pair, _format_pair_arg)
index_t load_balance_map_add_or_lock(u32 n_buckets, u32 sum_of_weights, const load_balance_path_t *paths)
static void load_balance_map_db_remove(load_balance_map_t *lbm)
static void load_balance_map_destroy(load_balance_map_t *lbm)
static uword load_balance_map_db_hash_key_2_index(uword key)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
@ FIB_NODE_TYPE_FIRST
Marker.
static load_balance_map_t * load_balance_map_db_get_from_hash_key(uword key)
#define ALWAYS_ASSERT(truth)
fib_node_index_t lbmp_index
Index of the path.
void load_balance_map_show_mem(void)
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
A representation of one pointer to another node.
vlib_log_class_t load_balance_map_logger
the logger
fib_node_index_t fnp_index
node's index
#define vec_free(V)
Free vector's memory (no header).
#define pool_len(p)
Number of elements in pool vector.
@ LOAD_BALANCE_MAP_PATH_USABLE
load_balance_map_t * load_balance_map_pool
The global pool of LB maps.
static uword * lb_maps_by_path_index
A hash-table of load-balance maps by path index.
static load_balance_map_t * load_balance_map_init(load_balance_map_t *lbm, u32 n_buckets, u32 sum_of_weights)
description fragment has unexpected format
static walk_rc_t load_balance_map_path_state_change_walk(fib_node_ptr_t *fptr, void *ctx)
static uword * load_balance_map_db
A hash-table of load-balance maps by set of paths.
void fib_node_list_remove(fib_node_list_t list, u32 sibling)
u8 * format_load_balance_map(u8 *s, va_list *ap)
#define vec_foreach(var, vec)
Vector iterator.
void fib_node_list_walk(fib_node_list_t list, fib_node_list_walk_cb_t fn, void *args)
Walk the list of node.
int fib_path_is_resolved(fib_node_index_t path_index)
static uword pool_elts(void *v)
Number of active elements in a pool.
#define hash_unset(h, key)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static load_balance_map_t * load_balance_map_alloc(const load_balance_path_t *paths)
u32 fib_node_list_push_front(fib_node_list_t list, int owner_id, fib_node_type_t type, fib_node_index_t index)
Insert an element at the from of the list.
fib_node_list_t fib_node_list_create(void)
Create a new node list.
static void load_balance_map_db_insert(load_balance_map_t *lbm)
#define uword_to_pointer(u, type)
enum load_balance_map_path_flags_t_ load_balance_map_path_flags_t
struct load_balance_map_path_t_ load_balance_map_path_t
static vlib_cli_command_t load_balance_map_show_command
(constructor) VLIB_CLI_COMMAND (load_balance_map_show_command)
static index_t load_balance_map_db_find(load_balance_map_t *lbm)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
load_balance_map_path_flags_t_
u32 lbm_sum_of_norm_weights
the sum of the normalised weights.
One path from an [EU]CMP set that the client wants to add to a load-balance object.
enum walk_rc_t_ walk_rc_t
Walk return code.
void load_balance_map_module_init(void)
Make/add a new or lock an existing Load-balance map.
struct load_balance_map_path_t_ * lbm_paths
the vector of paths this MAP represents
u32 lbmp_weight
the normalised wegiht of the path
#define dpo_pool_barrier_release(VM, YESNO)
Release barrier sync after dpo pool expansion.
static index_t load_balance_map_get_index(load_balance_map_t *lbm)
fib_node_index_t lbmp_sibling
Sibling Index in the list of all maps with this path index.