FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
lisp_gpe_adjacency.c File Reference

Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys. More...

+ Include dependency graph for lisp_gpe_adjacency.c:

Go to the source code of this file.

Macros

#define LISP_ADJ_SET_KEY(_key, _itf, _nh)
 
#define is_v4_packet(_h)   ((*(u8*) _h) & 0xF0) == 0x40
 
#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS   (256)
 
#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE   (1<<20)
 

Functions

static index_t lisp_adj_find (const ip_address_t *addr, u32 sw_if_index)
 
static void lisp_adj_insert (const ip_address_t *addr, u32 sw_if_index, index_t ai)
 
static void lisp_adj_remove (const ip_address_t *addr, u32 sw_if_index)
 
static lisp_gpe_adjacency_tlisp_gpe_adjacency_get_i (index_t lai)
 
fib_forward_chain_type_t lisp_gpe_adj_get_fib_chain_type (const lisp_gpe_adjacency_t *ladj)
 
static void ip46_address_to_ip_address (const ip46_address_t *a, ip_address_t *b)
 
static void lisp_gpe_adj_stack_one (lisp_gpe_adjacency_t *ladj, adj_index_t ai)
 Stack the tunnel's midchain on the IP forwarding chain of the via. More...
 
static adj_walk_rc_t lisp_gpe_adj_walk_cb (adj_index_t ai, void *ctx)
 Call back when restacking all adjacencies on a GRE interface. More...
 
static void lisp_gpe_adj_stack (lisp_gpe_adjacency_t *ladj)
 
static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type (vnet_link_t linkt)
 
static lisp_afi_e lisp_afi_from_vnet_link_type (vnet_link_t link)
 
static void lisp_gpe_increment_stats_counters (lisp_cp_main_t *lcm, ip_adjacency_t *adj, vlib_buffer_t *b)
 
static void lisp_gpe_fixup (vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b)
 
void lisp_gpe_update_adjacency (vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
 The LISP-GPE interface registered function to update, i.e. More...
 
u8lisp_gpe_build_rewrite (vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
 
index_t lisp_gpe_adjacency_find_or_create_and_lock (const locator_pair_t *pair, u32 overlay_table_id, u32 vni)
 
static lisp_gpe_adjacency_tlisp_gpe_adjacency_from_fib_node (const fib_node_t *node)
 Get a pointer to a tunnel from a pointer to a FIB node. More...
 
static void lisp_gpe_adjacency_last_lock_gone (lisp_gpe_adjacency_t *ladj)
 
void lisp_gpe_adjacency_unlock (index_t lai)
 
const lisp_gpe_adjacency_tlisp_gpe_adjacency_get (index_t lai)
 
static fib_node_back_walk_rc_t lisp_gpe_adjacency_back_walk (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 LISP GPE tunnel back walk. More...
 
static fib_node_tlisp_gpe_adjacency_get_fib_node (fib_node_index_t index)
 
static void lisp_gpe_adjacency_last_fib_lock_gone (fib_node_t *node)
 
u8format_lisp_gpe_adjacency (u8 *s, va_list *args)
 
static clib_error_tlisp_gpe_adjacency_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tlisp_gpe_adj_module_init (vlib_main_t *vm)
 

Variables

static lisp_gpe_adjacency_tlisp_adj_pool
 Memory pool of all adjacencies. More...
 
static lisp_adj_db
 Hash table of all adjacencies. More...
 
static const fib_node_vft_t lisp_gpe_tuennel_vft
 
static vlib_cli_command_t show_lisp_gpe_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_lisp_gpe_tunnel_command) More...
 

Detailed Description

Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.

Definition in file lisp_gpe_adjacency.c.

Macro Definition Documentation

#define is_v4_packet (   _h)    ((*(u8*) _h) & 0xF0) == 0x40

Definition at line 225 of file lisp_gpe_adjacency.c.

#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE   (1<<20)

Definition at line 613 of file lisp_gpe_adjacency.c.

#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS   (256)

Definition at line 612 of file lisp_gpe_adjacency.c.

#define LISP_ADJ_SET_KEY (   _key,
  _itf,
  _nh 
)
Value:
{ \
_key.key[0] = (_nh)->ip.v6.as_u64[0]; \
_key.key[1] = (_nh)->ip.v6.as_u64[1]; \
_key.key[2] = (_itf); \
}

Definition at line 47 of file lisp_gpe_adjacency.c.

Function Documentation

u8* format_lisp_gpe_adjacency ( u8 s,
va_list *  args 
)

Definition at line 537 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip46_address_to_ip_address ( const ip46_address_t *  a,
ip_address_t *  b 
)
static

Definition at line 114 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static index_t lisp_adj_find ( const ip_address_t *  addr,
u32  sw_if_index 
)
static

Definition at line 54 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_adj_insert ( const ip_address_t *  addr,
u32  sw_if_index,
index_t  ai 
)
static

Definition at line 71 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_adj_remove ( const ip_address_t *  addr,
u32  sw_if_index 
)
static

Definition at line 82 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static lisp_afi_e lisp_afi_from_vnet_link_type ( vnet_link_t  link)
static

Definition at line 228 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

fib_forward_chain_type_t lisp_gpe_adj_get_fib_chain_type ( const lisp_gpe_adjacency_t ladj)

Definition at line 98 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

static clib_error_t* lisp_gpe_adj_module_init ( vlib_main_t vm)
static

Definition at line 616 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type ( vnet_link_t  linkt)
static

Definition at line 207 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

static void lisp_gpe_adj_stack ( lisp_gpe_adjacency_t ladj)
static

Definition at line 192 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_adj_stack_one ( lisp_gpe_adjacency_t ladj,
adj_index_t  ai 
)
static

Stack the tunnel's midchain on the IP forwarding chain of the via.

Definition at line 131 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static adj_walk_rc_t lisp_gpe_adj_walk_cb ( adj_index_t  ai,
void *  ctx 
)
static

Call back when restacking all adjacencies on a GRE interface.

Definition at line 182 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_back_walk_rc_t lisp_gpe_adjacency_back_walk ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

LISP GPE tunnel back walk.

The FIB entry through which this tunnel resolves has been updated. re-stack the midchain on the new forwarding.

Definition at line 507 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

index_t lisp_gpe_adjacency_find_or_create_and_lock ( const locator_pair_t pair,
u32  overlay_table_id,
u32  vni 
)

Definition at line 371 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static lisp_gpe_adjacency_t* lisp_gpe_adjacency_from_fib_node ( const fib_node_t node)
static

Get a pointer to a tunnel from a pointer to a FIB node.

Definition at line 447 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

const lisp_gpe_adjacency_t* lisp_gpe_adjacency_get ( index_t  lai)

Definition at line 494 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_t* lisp_gpe_adjacency_get_fib_node ( fib_node_index_t  index)
static

Definition at line 516 of file lisp_gpe_adjacency.c.

static lisp_gpe_adjacency_t* lisp_gpe_adjacency_get_i ( index_t  lai)
static

Definition at line 92 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

static void lisp_gpe_adjacency_last_fib_lock_gone ( fib_node_t node)
static

Definition at line 525 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

static void lisp_gpe_adjacency_last_lock_gone ( lisp_gpe_adjacency_t ladj)
static

Definition at line 455 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* lisp_gpe_adjacency_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 573 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

void lisp_gpe_adjacency_unlock ( index_t  lai)

Definition at line 479 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* lisp_gpe_build_rewrite ( vnet_main_t vnm,
u32  sw_if_index,
vnet_link_t  link_type,
const void *  dst_address 
)

Definition at line 362 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

static void lisp_gpe_fixup ( vlib_main_t vm,
ip_adjacency_t adj,
vlib_buffer_t b 
)
static

Definition at line 310 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_increment_stats_counters ( lisp_cp_main_t lcm,
ip_adjacency_t adj,
vlib_buffer_t b 
)
static

Definition at line 244 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lisp_gpe_update_adjacency ( vnet_main_t vnm,
u32  sw_if_index,
adj_index_t  ai 
)

The LISP-GPE interface registered function to update, i.e.

provide an rewrite string for, an adjacency.

Definition at line 327 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

lisp_adj_db
static

Hash table of all adjacencies.

key:{nh, itf} We never have an all zeros address since the interfaces are multi-access, therefore there is no ambiguity between a v4 and v6 next-hop, so we don't need to add the protocol to the key.

Definition at line 45 of file lisp_gpe_adjacency.c.

lisp_gpe_adjacency_t* lisp_adj_pool
static

Memory pool of all adjacencies.

Definition at line 35 of file lisp_gpe_adjacency.c.

const fib_node_vft_t lisp_gpe_tuennel_vft
static
Initial value:
= {
.fnv_back_walk = lisp_gpe_adjacency_back_walk,
}
static fib_node_t * lisp_gpe_adjacency_get_fib_node(fib_node_index_t index)
static fib_node_back_walk_rc_t lisp_gpe_adjacency_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
LISP GPE tunnel back walk.
static void lisp_gpe_adjacency_last_fib_lock_gone(fib_node_t *node)

Definition at line 530 of file lisp_gpe_adjacency.c.

vlib_cli_command_t show_lisp_gpe_tunnel_command
static
Initial value:
=
{
.path = "show gpe adjacency",
}
static clib_error_t * lisp_gpe_adjacency_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (show_lisp_gpe_tunnel_command)

Definition at line 605 of file lisp_gpe_adjacency.c.