FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
kp.c File Reference
+ Include dependency graph for kp.c:

Go to the source code of this file.

Data Structures

struct  kp_pseudorand_t
 

Macros

#define KP_GARBAGE_RUN   60
 
#define KP_CONCURRENCY_TIMEOUT   10
 
#define kp_get_writer_lock()   do {} while(__sync_lock_test_and_set (kp_main.writer_lock, 1))
 
#define kp_put_writer_lock()   kp_main.writer_lock[0] = 0
 

Functions

static void kp_pod_stack (kp_pod_t *pod)
 
void ip46_prefix_normalize (ip46_address_t *prefix, u8 plen)
 
uword unformat_ip46_prefix (unformat_input_t *input, va_list *args)
 
u8format_ip46_prefix (u8 *s, va_list *args)
 
u32 kp_hash_time_now (vlib_main_t *vm)
 
u8format_kp_main (u8 *s, va_list *args)
 
u8format_kp_vip_type (u8 *s, va_list *args)
 
uword unformat_kp_vip_type (unformat_input_t *input, va_list *args)
 
u8format_kp_vip (u8 *s, va_list *args)
 
u8format_kp_pod (u8 *s, va_list *args)
 
u8format_kp_vip_detailed (u8 *s, va_list *args)
 
static int kp_pseudorand_compare (void *a, void *b)
 
static void kp_vip_garbage_collection (kp_vip_t *vip)
 
void kp_garbage_collection ()
 
static void kp_vip_update_new_flow_table (kp_vip_t *vip)
 
int kp_conf (u32 per_cpu_sticky_buckets, u32 flow_timeout)
 Fix global kube-proxy parameters. More...
 
static int kp_vip_find_index_with_lock (ip46_address_t *prefix, u8 plen, u32 *vip_index)
 
int kp_vip_find_index (ip46_address_t *prefix, u8 plen, u32 *vip_index)
 
static int kp_pod_find_index_vip (kp_vip_t *vip, ip46_address_t *address, u32 *pod_index)
 
int kp_vip_add_pods (u32 vip_index, ip46_address_t *addresses, u32 n)
 
int kp_vip_del_pods_withlock (u32 vip_index, ip46_address_t *addresses, u32 n)
 
int kp_vip_del_pods (u32 vip_index, ip46_address_t *addresses, u32 n)
 
static void kp_vip_add_adjacency (kp_main_t *kpm, kp_vip_t *vip)
 Add the VIP adjacency to the ip4 or ip6 fib. More...
 
static void kp_vip_del_adjacency (kp_main_t *kpm, kp_vip_t *vip)
 Deletes the adjacency podsociated with the VIP. More...
 
int kp_vip_add (ip46_address_t *prefix, u8 plen, kp_vip_type_t type, u32 new_length, u32 *vip_index, u16 port, u16 target_port, u16 node_port)
 
int kp_vip_del (u32 vip_index)
 
 VLIB_PLUGIN_REGISTER ()
 
u8format_kp_dpo (u8 *s, va_list *va)
 
static void kp_dpo_lock (dpo_id_t *dpo)
 
static void kp_dpo_unlock (dpo_id_t *dpo)
 
static fib_node_tkp_fib_node_get_node (fib_node_index_t index)
 
static void kp_fib_node_last_lock_gone (fib_node_t *node)
 
static kp_pod_tkp_pod_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t kp_fib_node_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
int kp_nat4_interface_add_del (u32 sw_if_index, int is_del)
 
clib_error_tkp_init (vlib_main_t *vm)
 

Variables

kp_main_t kp_main
 
static const char *const kp_dpo_nat4_ip4 [] = { "kp4-nat4" , NULL }
 
static const char *const kp_dpo_nat4_ip6 [] = { "kp6-nat4" , NULL }
 
static const char *const *const kp_dpo_nat4_nodes [DPO_PROTO_NUM]
 
static const char *const kp_dpo_nat6_ip4 [] = { "kp4-nat6" , NULL }
 
static const char *const kp_dpo_nat6_ip6 [] = { "kp6-nat6" , NULL }
 
static const char *const *const kp_dpo_nat6_nodes [DPO_PROTO_NUM]
 
static char * kp_vip_type_strings []
 

Macro Definition Documentation

#define KP_CONCURRENCY_TIMEOUT   10

Definition at line 26 of file kp.c.

#define KP_GARBAGE_RUN   60

Definition at line 23 of file kp.c.

#define kp_get_writer_lock ( )    do {} while(__sync_lock_test_and_set (kp_main.writer_lock, 1))

Definition at line 30 of file kp.c.

#define kp_put_writer_lock ( )    kp_main.writer_lock[0] = 0

Definition at line 31 of file kp.c.

Function Documentation

u8* format_ip46_prefix ( u8 s,
va_list *  args 
)

Definition at line 71 of file kp.c.

+ Here is the caller graph for this function:

u8* format_kp_dpo ( u8 s,
va_list *  va 
)

Definition at line 854 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_kp_main ( u8 s,
va_list *  args 
)

Definition at line 111 of file kp.c.

+ Here is the call graph for this function:

u8* format_kp_pod ( u8 s,
va_list *  args 
)

Definition at line 175 of file kp.c.

+ Here is the call graph for this function:

u8* format_kp_vip ( u8 s,
va_list *  args 
)

Definition at line 161 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_kp_vip_detailed ( u8 s,
va_list *  args 
)

Definition at line 183 of file kp.c.

+ Here is the call graph for this function:

u8* format_kp_vip_type ( u8 s,
va_list *  args 
)

Definition at line 139 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip46_prefix_normalize ( ip46_address_t *  prefix,
u8  plen 
)

Definition at line 35 of file kp.c.

+ Here is the caller graph for this function:

int kp_conf ( u32  sticky_buckets,
u32  flow_timeout 
)

Fix global kube-proxy parameters.

Returns
0 on success. VNET_KP_ERR_XXX on error

Definition at line 421 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void kp_dpo_lock ( dpo_id_t dpo)
static

Definition at line 863 of file kp.c.

+ Here is the caller graph for this function:

static void kp_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 864 of file kp.c.

+ Here is the caller graph for this function:

static fib_node_back_walk_rc_t kp_fib_node_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 899 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_t* kp_fib_node_get_node ( fib_node_index_t  index)
static

Definition at line 867 of file kp.c.

+ Here is the caller graph for this function:

static void kp_fib_node_last_lock_gone ( fib_node_t node)
static

Definition at line 875 of file kp.c.

+ Here is the caller graph for this function:

void kp_garbage_collection ( )

Definition at line 292 of file kp.c.

+ Here is the caller graph for this function:

u32 kp_hash_time_now ( vlib_main_t vm)

Definition at line 106 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* kp_init ( vlib_main_t vm)

Definition at line 923 of file kp.c.

+ Here is the call graph for this function:

int kp_nat4_interface_add_del ( u32  sw_if_index,
int  is_del 
)

Definition at line 906 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int kp_pod_find_index_vip ( kp_vip_t vip,
ip46_address_t *  address,
u32 pod_index 
)
static

Definition at line 463 of file kp.c.

+ Here is the caller graph for this function:

static kp_pod_t* kp_pod_from_fib_node ( fib_node_t node)
static

Definition at line 880 of file kp.c.

+ Here is the caller graph for this function:

static void kp_pod_stack ( kp_pod_t pod)
static

Definition at line 887 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 253 of file kp.c.

int kp_vip_add ( ip46_address_t *  prefix,
u8  plen,
kp_vip_type_t  type,
u32  new_length,
u32 vip_index,
u16  port,
u16  target_port,
u16  node_port 
)

Definition at line 725 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void kp_vip_add_adjacency ( kp_main_t kpm,
kp_vip_t vip 
)
static

Add the VIP adjacency to the ip4 or ip6 fib.

Definition at line 681 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 481 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int kp_vip_del ( u32  vip_index)

Definition at line 810 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void kp_vip_del_adjacency ( kp_main_t kpm,
kp_vip_t vip 
)
static

Deletes the adjacency podsociated with the VIP.

Definition at line 710 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 670 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 620 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 454 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 436 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void kp_vip_garbage_collection ( kp_vip_t vip)
static

Definition at line 262 of file kp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void kp_vip_update_new_flow_table ( kp_vip_t vip)
static

Definition at line 317 of file kp.c.

+ Here is the caller graph for this function:

uword unformat_ip46_prefix ( unformat_input_t input,
va_list *  args 
)

Definition at line 49 of file kp.c.

+ Here is the caller graph for this function:

uword unformat_kp_vip_type ( unformat_input_t input,
va_list *  args 
)

Definition at line 149 of file kp.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 kp_dpo_nat4_ip4[] = { "kp4-nat4" , NULL }
static

Definition at line 90 of file kp.c.

const char* const kp_dpo_nat4_ip6[] = { "kp6-nat4" , NULL }
static

Definition at line 91 of file kp.c.

const char* const* const kp_dpo_nat4_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const kp_dpo_nat4_ip4[]
Definition: kp.c:90
static const char *const kp_dpo_nat4_ip6[]
Definition: kp.c:91

Definition at line 92 of file kp.c.

const char* const kp_dpo_nat6_ip4[] = { "kp4-nat6" , NULL }
static

Definition at line 98 of file kp.c.

const char* const kp_dpo_nat6_ip6[] = { "kp6-nat6" , NULL }
static

Definition at line 99 of file kp.c.

const char* const* const kp_dpo_nat6_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const kp_dpo_nat6_ip6[]
Definition: kp.c:99
static const char *const kp_dpo_nat6_ip4[]
Definition: kp.c:98

Definition at line 100 of file kp.c.

kp_main_t kp_main

Definition at line 28 of file kp.c.

char* kp_vip_type_strings[]
static
Initial value:

Definition at line 132 of file kp.c.