32 #ifndef __LOAD_BALANCE_H__ 33 #define __LOAD_BALANCE_H__ 56 #define LB_NUM_INLINE_BUCKETS 4 145 "A load_balance object size exceeds one cachline");
198 #define LB_HAS_INLINE_BUCKETS(_lb) \ 199 ((_lb)->lb_n_buckets <= LB_NUM_INLINE_BUCKETS) 205 ASSERT(bucket < lb->lb_n_buckets);
u16 lb_n_buckets
number of buckets in the load-balance.
index_t load_balance_get_urpf(index_t lbi)
dpo_id_t * lb_buckets
Vector of buckets containing the next DPOs, sized as lbo_num.
void load_balance_multipath_update(const dpo_id_t *dpo, const load_balance_path_t *raw_next_hops, load_balance_flags_t flags)
vlib_combined_counter_main_t lbm_to_counters
fib_entry_flag_t lb_fib_entry_flags
Flags from the load-balance's associated fib_entry_t.
STATIC_ASSERT(sizeof(load_balance_t)<=CLIB_CACHE_LINE_BYTES,"A load_balance object size exceeds one cachline")
fib_node_index_t path_index
The index of the FIB path.
dpo_id_t path_dpo
ID of the Data-path object.
void load_balance_module_init(void)
load_balance_main_t load_balance_main
The one instance of load-balance main.
enum load_balance_format_flags_t_ load_balance_format_flags_t
Flags controlling load-balance formatting/display.
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
f64 load_balance_get_multipath_tolerance(void)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
void load_balance_set_bucket(index_t lbi, u32 bucket, const dpo_id_t *next)
load_balance_format_flags_t_
Flags controlling load-balance formatting/display.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
void load_balance_set_fib_entry_flags(index_t lbi, fib_entry_flag_t flags)
const dpo_id_t * load_balance_get_bucket(index_t lbi, u32 bucket)
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
load_balance_flags_t_
Flags controlling load-balance creation and modification.
void load_balance_set_urpf(index_t lbi, index_t urpf)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
dpo_proto_t lb_proto
The protocol of packets that traverse this LB.
struct load_balance_main_t_ load_balance_main_t
The load-balance object represents an ECMP choice.
The load-balance object represents an ECMP choice.
dpo_id_t lb_buckets_inline[LB_NUM_INLINE_BUCKETS]
The rest of the cache line is used for buckets.
enum load_balance_flags_t_ load_balance_flags_t
Flags controlling load-balance creation and modification.
u32 fib_node_index_t
A typedef of a node index.
index_t load_balance_create(u32 num_buckets, dpo_proto_t lb_proto, flow_hash_config_t fhc)
#define LB_NUM_INLINE_BUCKETS
The number of buckets that a load-balance object can have and still fit in one cache-line.
vlib_combined_counter_main_t lbm_via_counters
enum fib_entry_flag_t_ fib_entry_flag_t
u8 * format_load_balance(u8 *s, va_list *args)
index_t lb_urpf
This is the index of the uRPF list for this LB.
static load_balance_t * load_balance_get(index_t lbi)
load_balance_t * load_balance_pool
The encapsulation breakages are for fast DP access.
u32 lb_locks
The number of locks, which is approximately the number of users, of this load-balance.
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.
struct load_balance_t_ load_balance_t
The FIB DPO provieds;.
#define LB_HAS_INLINE_BUCKETS(_lb)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
u32 path_weight
weight for the path.
One path from an [EU]CMP set that the client wants to add to a load-balance object.
A collection of combined counters.
index_t lb_map
index of the load-balance map, INVALID if this LB does not use one
#define CLIB_CACHE_LINE_BYTES
int load_balance_is_drop(const dpo_id_t *dpo)