|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
32 #ifndef __LOAD_BALANCE_H__
33 #define __LOAD_BALANCE_H__
56 #define LB_NUM_INLINE_BUCKETS 4
87 #define LOAD_BALANCE_ATTR_NAMES { \
88 [LOAD_BALANCE_ATTR_USES_MAP] = "uses-map", \
89 [LOAD_BALANCE_ATTR_STICKY] = "sticky", \
92 #define FOR_EACH_LOAD_BALANCE_ATTR(_attr) \
93 for (_attr = 0; _attr <= LOAD_BALANCE_ATTR_STICKY; _attr++)
178 "A load_balance object size exceeds one cacheline");
225 #define LB_HAS_INLINE_BUCKETS(_lb) \
226 ((_lb)->lb_n_buckets <= LB_NUM_INLINE_BUCKETS)
232 ASSERT(bucket < lb->lb_n_buckets);
struct load_balance_path_t_ load_balance_path_t
One path from an [EU]CMP set that the client wants to add to a load-balance object.
void load_balance_set_bucket(index_t lbi, u32 bucket, const dpo_id_t *next)
u16 lb_n_buckets
number of buckets in the load-balance.
void load_balance_multipath_update(const dpo_id_t *dpo, const load_balance_path_t *raw_next_hops, load_balance_flags_t flags)
void load_balance_set_fib_entry_flags(index_t lbi, fib_entry_flag_t flags)
u32 path_weight
weight for the path.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
load_balance_format_flags_t_
Flags controlling load-balance formatting/display.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
const dpo_id_t * load_balance_get_bucket(index_t lbi, u32 bucket)
index_t load_balance_get_urpf(index_t lbi)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
enum load_balance_format_flags_t_ load_balance_format_flags_t
Flags controlling load-balance formatting/display.
index_t lb_map
index of the load-balance map, INVALID if this LB does not use one
vlib_combined_counter_main_t lbm_via_counters
void load_balance_module_init(void)
struct load_balance_main_t_ load_balance_main_t
The load-balance object represents an ECMP choice.
f64 load_balance_get_multipath_tolerance(void)
@ LOAD_BALANCE_FORMAT_DETAIL
enum fib_entry_flag_t_ fib_entry_flag_t
fib_node_index_t path_index
The index of the FIB path.
enum load_balance_flags_t_ load_balance_flags_t
load_balance_attr_t_
Flags controlling load-balance creation and modification.
void load_balance_set_urpf(index_t lbi, index_t urpf)
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
fib_entry_flag_t lb_fib_entry_flags
Flags from the load-balance's associated fib_entry_t.
u32 fib_node_index_t
A typedef of a node index.
@ LOAD_BALANCE_FLAG_USES_MAP
@ LOAD_BALANCE_FORMAT_NONE
u8 * format_load_balance(u8 *s, va_list *args)
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
@ LOAD_BALANCE_ATTR_USES_MAP
load_balance_t * load_balance_pool
The encapsulation breakages are for fast DP access.
#define CLIB_CACHE_LINE_BYTES
#define LB_HAS_INLINE_BUCKETS(_lb)
#define LB_NUM_INLINE_BUCKETS
The number of buckets that a load-balance object can have and still fit in one cache-line.
@ LOAD_BALANCE_FLAG_STICKY
enum load_balance_attr_t_ load_balance_attr_t
Flags controlling load-balance creation and modification.
load_balance_flags_t lb_flags
Flags concenring the LB's creation and modification.
vlib_combined_counter_main_t lbm_to_counters
index_t load_balance_create(u32 num_buckets, dpo_proto_t lb_proto, flow_hash_config_t fhc)
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
required for pool_get_aligned.
A collection of combined counters.
flow_hash_config_t load_balance_get_default_flow_hash(dpo_proto_t lb_proto)
STATIC_ASSERT(sizeof(load_balance_t)<=CLIB_CACHE_LINE_BYTES, "A load_balance object size exceeds one cacheline")
struct load_balance_t_ load_balance_t
The FIB DPO provieds;.
static load_balance_t * load_balance_get(index_t lbi)
@ LOAD_BALANCE_ATTR_STICKY
dpo_id_t * lb_buckets
Vector of buckets containing the next DPOs, sized as lbo_num.
dpo_proto_t lb_proto
The protocol of packets that traverse this LB.
dpo_id_t lb_buckets_inline[LB_NUM_INLINE_BUCKETS]
The rest of the cache line is used for buckets.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
dpo_id_t path_dpo
ID of the Data-path object.
index_t lb_urpf
This is the index of the uRPF list for this LB.
The load-balance object represents an ECMP choice.
int load_balance_is_drop(const dpo_id_t *dpo)
u32 lb_locks
The number of locks, which is approximately the number of users, of this load-balance.
One path from an [EU]CMP set that the client wants to add to a load-balance object.
load_balance_main_t load_balance_main
The one instance of load-balance main.
u16 load_balance_n_buckets(index_t lbi)
vl_api_wireguard_peer_flags_t flags