FD.io VPP  v20.05.1-6-gf53edbc3b
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, const ip_adjacency_t *adj, vlib_buffer_t *b)
 
static void lisp_gpe_fixup (vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
 
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

◆ is_v4_packet

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

Definition at line 190 of file lisp_gpe_adjacency.c.

◆ LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE

#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE   (1<<20)

Definition at line 583 of file lisp_gpe_adjacency.c.

◆ LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS

#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS   (256)

Definition at line 582 of file lisp_gpe_adjacency.c.

◆ LISP_ADJ_SET_KEY

#define LISP_ADJ_SET_KEY (   _key,
  _itf,
  _nh 
)
Value:
{ \
_key.key[0] = ip_addr_v6((_nh)).as_u64[0]; \
_key.key[1] = ip_addr_v6((_nh)).as_u64[1]; \
_key.key[2] = (_itf); \
}
#define ip_addr_v6(_a)
Definition: ip_types.h:59

Definition at line 47 of file lisp_gpe_adjacency.c.

Function Documentation

◆ format_lisp_gpe_adjacency()

u8* format_lisp_gpe_adjacency ( u8 s,
va_list *  args 
)

Definition at line 507 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip46_address_to_ip_address()

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:

◆ lisp_adj_find()

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:

◆ lisp_adj_insert()

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:

◆ lisp_adj_remove()

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:

◆ lisp_afi_from_vnet_link_type()

static lisp_afi_e lisp_afi_from_vnet_link_type ( vnet_link_t  link)
static

Definition at line 193 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

◆ lisp_gpe_adj_get_fib_chain_type()

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:

◆ lisp_gpe_adj_module_init()

static clib_error_t* lisp_gpe_adj_module_init ( vlib_main_t vm)
static

Definition at line 586 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

◆ lisp_gpe_adj_proto_from_vnet_link_type()

static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type ( vnet_link_t  linkt)
static

Definition at line 172 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

◆ lisp_gpe_adj_stack()

static void lisp_gpe_adj_stack ( lisp_gpe_adjacency_t ladj)
static

Definition at line 157 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_adj_stack_one()

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:

◆ lisp_gpe_adj_walk_cb()

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 147 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_adjacency_back_walk()

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 477 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

◆ lisp_gpe_adjacency_find_or_create_and_lock()

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

Definition at line 341 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_adjacency_from_fib_node()

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 417 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

◆ lisp_gpe_adjacency_get()

const lisp_gpe_adjacency_t* lisp_gpe_adjacency_get ( index_t  lai)

Definition at line 464 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_adjacency_get_fib_node()

static fib_node_t* lisp_gpe_adjacency_get_fib_node ( fib_node_index_t  index)
static

Definition at line 486 of file lisp_gpe_adjacency.c.

◆ lisp_gpe_adjacency_get_i()

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:

◆ lisp_gpe_adjacency_last_fib_lock_gone()

static void lisp_gpe_adjacency_last_fib_lock_gone ( fib_node_t node)
static

Definition at line 495 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

◆ lisp_gpe_adjacency_last_lock_gone()

static void lisp_gpe_adjacency_last_lock_gone ( lisp_gpe_adjacency_t ladj)
static

Definition at line 425 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_adjacency_show()

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 543 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:

◆ lisp_gpe_adjacency_unlock()

void lisp_gpe_adjacency_unlock ( index_t  lai)

Definition at line 449 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_build_rewrite()

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 332 of file lisp_gpe_adjacency.c.

+ Here is the caller graph for this function:

◆ lisp_gpe_fixup()

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

Definition at line 276 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_increment_stats_counters()

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

Definition at line 209 of file lisp_gpe_adjacency.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_update_adjacency()

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 295 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

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_adj_pool

lisp_gpe_adjacency_t* lisp_adj_pool
static

Memory pool of all adjacencies.

Definition at line 35 of file lisp_gpe_adjacency.c.

◆ lisp_gpe_tuennel_vft

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 500 of file lisp_gpe_adjacency.c.

◆ show_lisp_gpe_tunnel_command

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 575 of file lisp_gpe_adjacency.c.