FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
lb.c File Reference
+ Include dependency graph for lb.c:

Go to the source code of this file.

Data Structures

struct  lb_pseudorand_t
 

Macros

#define LB_GARBAGE_RUN   60
 
#define LB_CONCURRENCY_TIMEOUT   10
 
#define lb_get_writer_lock()   do {} while(__sync_lock_test_and_set (lb_main.writer_lock, 1))
 
#define lb_put_writer_lock()   lb_main.writer_lock[0] = 0
 

Functions

static void lb_as_stack (lb_as_t *as)
 
u32 lb_hash_time_now (vlib_main_t *vm)
 
u8format_lb_main (u8 *s, va_list *args)
 
u8format_lb_vip_type (u8 *s, va_list *args)
 
uword unformat_lb_vip_type (unformat_input_t *input, va_list *args)
 
u8format_lb_vip (u8 *s, va_list *args)
 
u8format_lb_as (u8 *s, va_list *args)
 
u8format_lb_vip_detailed (u8 *s, va_list *args)
 
static int lb_pseudorand_compare (void *a, void *b)
 
static void lb_vip_garbage_collection (lb_vip_t *vip)
 
void lb_garbage_collection ()
 
static void lb_vip_update_new_flow_table (lb_vip_t *vip)
 
int lb_conf (ip4_address_t *ip4_address, ip6_address_t *ip6_address, u32 per_cpu_sticky_buckets, u32 flow_timeout)
 Fix global load-balancer parameters. More...
 
static int lb_vip_find_index_with_lock (ip46_address_t *prefix, u8 plen, u32 *vip_index)
 
int lb_vip_find_index (ip46_address_t *prefix, u8 plen, u32 *vip_index)
 
static int lb_as_find_index_vip (lb_vip_t *vip, ip46_address_t *address, u32 *as_index)
 
int lb_vip_add_ass (u32 vip_index, ip46_address_t *addresses, u32 n)
 
int lb_vip_del_ass_withlock (u32 vip_index, ip46_address_t *addresses, u32 n)
 
int lb_vip_del_ass (u32 vip_index, ip46_address_t *addresses, u32 n)
 
static void lb_vip_add_adjacency (lb_main_t *lbm, lb_vip_t *vip)
 Add the VIP adjacency to the ip4 or ip6 fib. More...
 
static void lb_vip_del_adjacency (lb_main_t *lbm, lb_vip_t *vip)
 Deletes the adjacency associated with the VIP. More...
 
int lb_vip_add (lb_vip_add_args_t args, u32 *vip_index)
 
int lb_vip_del (u32 vip_index)
 
 VLIB_PLUGIN_REGISTER ()
 
u8format_lb_dpo (u8 *s, va_list *va)
 
static void lb_dpo_lock (dpo_id_t *dpo)
 
static void lb_dpo_unlock (dpo_id_t *dpo)
 
static fib_node_tlb_fib_node_get_node (fib_node_index_t index)
 
static void lb_fib_node_last_lock_gone (fib_node_t *node)
 
static lb_as_tlb_as_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t lb_fib_node_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
int lb_nat4_interface_add_del (u32 sw_if_index, int is_del)
 
int lb_nat6_interface_add_del (u32 sw_if_index, int is_del)
 
clib_error_tlb_init (vlib_main_t *vm)
 

Variables

lb_main_t lb_main
 
static const char *const lb_dpo_gre4_ip4 [] = { "lb4-gre4" , NULL }
 
static const char *const lb_dpo_gre4_ip6 [] = { "lb6-gre4" , NULL }
 
static const char *const *const lb_dpo_gre4_nodes [DPO_PROTO_NUM]
 
static const char *const lb_dpo_gre6_ip4 [] = { "lb4-gre6" , NULL }
 
static const char *const lb_dpo_gre6_ip6 [] = { "lb6-gre6" , NULL }
 
static const char *const *const lb_dpo_gre6_nodes [DPO_PROTO_NUM]
 
static const char *const lb_dpo_l3dsr_ip4 [] = { "lb4-l3dsr" , NULL }
 
static const char *const *const lb_dpo_l3dsr_nodes [DPO_PROTO_NUM]
 
static const char *const lb_dpo_nat4_ip4 [] = { "lb4-nat4" , NULL }
 
static const char *const *const lb_dpo_nat4_nodes [DPO_PROTO_NUM]
 
static const char *const lb_dpo_nat6_ip6 [] = { "lb6-nat6" , NULL }
 
static const char *const *const lb_dpo_nat6_nodes [DPO_PROTO_NUM]
 
static char * lb_vip_type_strings []
 

Macro Definition Documentation

#define LB_CONCURRENCY_TIMEOUT   10

Definition at line 26 of file lb.c.

#define LB_GARBAGE_RUN   60

Definition at line 23 of file lb.c.

#define lb_get_writer_lock ( )    do {} while(__sync_lock_test_and_set (lb_main.writer_lock, 1))

Definition at line 30 of file lb.c.

#define lb_put_writer_lock ( )    lb_main.writer_lock[0] = 0

Definition at line 31 of file lb.c.

Function Documentation

u8* format_lb_as ( u8 s,
va_list *  args 
)

Definition at line 160 of file lb.c.

+ Here is the call graph for this function:

u8* format_lb_dpo ( u8 s,
va_list *  va 
)

Definition at line 980 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_lb_main ( u8 s,
va_list *  args 
)

Definition at line 75 of file lb.c.

+ Here is the call graph for this function:

u8* format_lb_vip ( u8 s,
va_list *  args 
)

Definition at line 130 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_lb_vip_detailed ( u8 s,
va_list *  args 
)

Definition at line 168 of file lb.c.

+ Here is the call graph for this function:

u8* format_lb_vip_type ( u8 s,
va_list *  args 
)

Definition at line 108 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int lb_as_find_index_vip ( lb_vip_t vip,
ip46_address_t *  address,
u32 as_index 
)
static

Definition at line 509 of file lb.c.

+ Here is the caller graph for this function:

static lb_as_t* lb_as_from_fib_node ( fib_node_t node)
static

Definition at line 1006 of file lb.c.

+ Here is the caller graph for this function:

static void lb_as_stack ( lb_as_t as)
static

Definition at line 1013 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_conf ( ip4_address_t ip4_address,
ip6_address_t ip6_address,
u32  sticky_buckets,
u32  flow_timeout 
)

Fix global load-balancer parameters.

Parameters
ip4_addressIPv4 source address used for encapsulated traffic
ip6_addressIPv6 source address used for encapsulated traffic
Returns
0 on success. VNET_LB_ERR_XXX on error

Definition at line 464 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lb_dpo_lock ( dpo_id_t dpo)
static

Definition at line 989 of file lb.c.

+ Here is the caller graph for this function:

static void lb_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 990 of file lb.c.

+ Here is the caller graph for this function:

static fib_node_back_walk_rc_t lb_fib_node_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 1038 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_t* lb_fib_node_get_node ( fib_node_index_t  index)
static

Definition at line 993 of file lb.c.

+ Here is the caller graph for this function:

static void lb_fib_node_last_lock_gone ( fib_node_t node)
static

Definition at line 1001 of file lb.c.

+ Here is the caller graph for this function:

void lb_garbage_collection ( )

Definition at line 335 of file lb.c.

+ Here is the caller graph for this function:

u32 lb_hash_time_now ( vlib_main_t vm)

Definition at line 70 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* lb_init ( vlib_main_t vm)

Definition at line 1078 of file lb.c.

+ Here is the call graph for this function:

int lb_nat4_interface_add_del ( u32  sw_if_index,
int  is_del 
)

Definition at line 1045 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_nat6_interface_add_del ( u32  sw_if_index,
int  is_del 
)

Definition at line 1061 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int lb_pseudorand_compare ( void *  a,
void *  b 
)
static

Definition at line 257 of file lb.c.

int lb_vip_add ( lb_vip_add_args_t  args,
u32 vip_index 
)

Definition at line 823 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lb_vip_add_adjacency ( lb_main_t lbm,
lb_vip_t vip 
)
static

Add the VIP adjacency to the ip4 or ip6 fib.

Definition at line 766 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_vip_add_ass ( u32  vip_index,
ip46_address_t *  addresses,
u32  n 
)

Definition at line 527 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_vip_del ( u32  vip_index)

Definition at line 936 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lb_vip_del_adjacency ( lb_main_t lbm,
lb_vip_t vip 
)
static

Deletes the adjacency associated with the VIP.

Definition at line 808 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_vip_del_ass ( u32  vip_index,
ip46_address_t *  addresses,
u32  n 
)

Definition at line 755 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_vip_del_ass_withlock ( u32  vip_index,
ip46_address_t *  addresses,
u32  n 
)

Definition at line 705 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_vip_find_index ( ip46_address_t *  prefix,
u8  plen,
u32 vip_index 
)

Definition at line 500 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int lb_vip_find_index_with_lock ( ip46_address_t *  prefix,
u8  plen,
u32 vip_index 
)
static

Definition at line 482 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lb_vip_garbage_collection ( lb_vip_t vip)
static

Definition at line 266 of file lb.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lb_vip_update_new_flow_table ( lb_vip_t vip)
static

Definition at line 360 of file lb.c.

+ Here is the caller graph for this function:

uword unformat_lb_vip_type ( unformat_input_t input,
va_list *  args 
)

Definition at line 118 of file lb.c.

+ Here is the call graph for this function:

VLIB_PLUGIN_REGISTER ( )

+ Here is the caller graph for this function:

Variable Documentation

const char* const lb_dpo_gre4_ip4[] = { "lb4-gre4" , NULL }
static

Definition at line 36 of file lb.c.

const char* const lb_dpo_gre4_ip6[] = { "lb6-gre4" , NULL }
static

Definition at line 37 of file lb.c.

const char* const* const lb_dpo_gre4_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lb_dpo_gre4_ip4[]
Definition: lb.c:36
static const char *const lb_dpo_gre4_ip6[]
Definition: lb.c:37

Definition at line 38 of file lb.c.

const char* const lb_dpo_gre6_ip4[] = { "lb4-gre6" , NULL }
static

Definition at line 44 of file lb.c.

const char* const lb_dpo_gre6_ip6[] = { "lb6-gre6" , NULL }
static

Definition at line 45 of file lb.c.

const char* const* const lb_dpo_gre6_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lb_dpo_gre6_ip4[]
Definition: lb.c:44
static const char *const lb_dpo_gre6_ip6[]
Definition: lb.c:45

Definition at line 46 of file lb.c.

const char* const lb_dpo_l3dsr_ip4[] = { "lb4-l3dsr" , NULL }
static

Definition at line 52 of file lb.c.

const char* const* const lb_dpo_l3dsr_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lb_dpo_l3dsr_ip4[]
Definition: lb.c:52

Definition at line 53 of file lb.c.

const char* const lb_dpo_nat4_ip4[] = { "lb4-nat4" , NULL }
static

Definition at line 58 of file lb.c.

const char* const* const lb_dpo_nat4_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lb_dpo_nat4_ip4[]
Definition: lb.c:58

Definition at line 59 of file lb.c.

const char* const lb_dpo_nat6_ip6[] = { "lb6-nat6" , NULL }
static

Definition at line 64 of file lb.c.

const char* const* const lb_dpo_nat6_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lb_dpo_nat6_ip6[]
Definition: lb.c:64

Definition at line 65 of file lb.c.

lb_main_t lb_main

Definition at line 28 of file lb.c.

char* lb_vip_type_strings[]
static
Initial value:

Definition at line 98 of file lb.c.