FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
adj.c File Reference
+ Include dependency graph for adj.c:

Go to the source code of this file.

Data Structures

struct  adj_feature_update_t_
 

Macros

#define ADJ_FROM_NODE(_node)   ((ip_adjacency_t*)((char*)_node - STRUCT_OFFSET_OF(ip_adjacency_t, ia_node)))
 

Typedefs

typedef struct adj_feature_update_t_ adj_feature_update_ctx_t
 

Functions

static void adj_poison (ip_adjacency_t *adj)
 
ip_adjacency_tadj_alloc (fib_protocol_t proto)
 
static int adj_index_is_special (adj_index_t adj_index)
 
u8format_adj_flags (u8 *s, va_list *args)
 Format adjacency flags. More...
 
u8format_ip_adjacency (u8 *s, va_list *args)
 Pretty print helper function for formatting specific adjacencies. More...
 
int adj_recursive_loop_detect (adj_index_t ai, fib_node_index_t **entry_indicies)
 descend the FIB graph looking for loops More...
 
static void adj_last_lock_gone (ip_adjacency_t *adj)
 
u32 adj_dpo_get_urpf (const dpo_id_t *dpo)
 
void adj_lock (adj_index_t adj_index)
 Take a reference counting lock on the adjacency. More...
 
void adj_unlock (adj_index_t adj_index)
 Release a reference counting lock on the adjacency. More...
 
u32 adj_child_add (adj_index_t adj_index, fib_node_type_t child_type, fib_node_index_t child_index)
 Add a child dependent to an adjacency. More...
 
void adj_child_remove (adj_index_t adj_index, u32 sibling_index)
 Remove a child dependent. More...
 
static adj_walk_rc_t adj_feature_update_walk_cb (adj_index_t ai, void *arg)
 
static void adj_feature_update (u32 sw_if_index, u8 arc_index, u8 is_enable, void *data)
 
static adj_walk_rc_t adj_mtu_update_walk_cb (adj_index_t ai, void *arg)
 
static clib_error_tadj_mtu_update (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_MTU_CHANGE_FUNCTION (adj_mtu_update)
 
void adj_walk (u32 sw_if_index, adj_walk_cb_t cb, void *ctx)
 Walk the Adjacencies on a given interface. More...
 
vnet_link_t adj_get_link_type (adj_index_t ai)
 Return the link type of the adjacency. More...
 
u32 adj_get_sw_if_index (adj_index_t ai)
 Return the sw interface index of the adjacency. More...
 
int adj_is_up (adj_index_t ai)
 Return true if the adjacency is 'UP', i.e. More...
 
const u8adj_get_rewrite (adj_index_t ai)
 Return the rewrite string of the adjacency. More...
 
static fib_node_tadj_get_node (fib_node_index_t index)
 
static void adj_node_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t adj_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static clib_error_tadj_module_init (vlib_main_t *vm)
 
static clib_error_tadj_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tadj_cli_counters_set (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI invoked function to enable/disable per-adj counters. More...
 

Variables

vlib_combined_counter_main_t adjacency_counters
 Adjacency packet counters. More...
 
ip_adjacency_tadj_pool
 The global adjacency pool. More...
 
int adj_per_adj_counters
 Global Config for enabling per-adjacency counters. More...
 
const ip46_address_t ADJ_BCAST_ADDR
 The special broadcast address (to construct a broadcast adjacency. More...
 
static const char * adj_attr_names [] = ADJ_ATTR_NAMES
 Adj flag names. More...
 
static const fib_node_vft_t adj_vft
 
static vlib_cli_command_t adj_show_command
 (constructor) VLIB_CLI_COMMAND (adj_show_command) More...
 
static vlib_cli_command_t adj_cli_counters_set_command
 (constructor) VLIB_CLI_COMMAND (adj_cli_counters_set_command) More...
 

Macro Definition Documentation

◆ ADJ_FROM_NODE

#define ADJ_FROM_NODE (   _node)    ((ip_adjacency_t*)((char*)_node - STRUCT_OFFSET_OF(ip_adjacency_t, ia_node)))

Definition at line 566 of file adj.c.

Typedef Documentation

◆ adj_feature_update_ctx_t

Function Documentation

◆ adj_alloc()

ip_adjacency_t* adj_alloc ( fib_protocol_t  proto)

Definition at line 63 of file adj.c.

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

◆ adj_back_walk_notify()

static fib_node_back_walk_rc_t adj_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 576 of file adj.c.

+ Here is the call graph for this function:

◆ adj_child_add()

u32 adj_child_add ( adj_index_t  adj_index,
fib_node_type_t  type,
fib_node_index_t  child_index 
)

Add a child dependent to an adjacency.

The child will thus be informed via its registered back-walk function when the adjacency state changes.

Definition at line 367 of file adj.c.

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

◆ adj_child_remove()

void adj_child_remove ( adj_index_t  adj_index,
u32  sibling_index 
)

Remove a child dependent.

Definition at line 384 of file adj.c.

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

◆ adj_cli_counters_set()

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

CLI invoked function to enable/disable per-adj counters.

Definition at line 726 of file adj.c.

+ Here is the call graph for this function:

◆ adj_dpo_get_urpf()

u32 adj_dpo_get_urpf ( const dpo_id_t dpo)

Definition at line 321 of file adj.c.

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

◆ adj_feature_update()

static void adj_feature_update ( u32  sw_if_index,
u8  arc_index,
u8  is_enable,
void *  data 
)
static

Definition at line 443 of file adj.c.

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

◆ adj_feature_update_walk_cb()

static adj_walk_rc_t adj_feature_update_walk_cb ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 407 of file adj.c.

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

◆ adj_get_link_type()

vnet_link_t adj_get_link_type ( adj_index_t  ai)

Return the link type of the adjacency.

Definition at line 507 of file adj.c.

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

◆ adj_get_node()

static fib_node_t* adj_get_node ( fib_node_index_t  index)
static

Definition at line 557 of file adj.c.

+ Here is the call graph for this function:

◆ adj_get_rewrite()

const u8* adj_get_rewrite ( adj_index_t  ai)

Return the rewrite string of the adjacency.

Return the link type of the adjacency.

Definition at line 543 of file adj.c.

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

◆ adj_get_sw_if_index()

u32 adj_get_sw_if_index ( adj_index_t  ai)

Return the sw interface index of the adjacency.

Definition at line 520 of file adj.c.

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

◆ adj_index_is_special()

static int adj_index_is_special ( adj_index_t  adj_index)
static

Definition at line 119 of file adj.c.

+ Here is the caller graph for this function:

◆ adj_is_up()

int adj_is_up ( adj_index_t  ai)

Return true if the adjacency is 'UP', i.e.

can be used for forwarding 0 is down, !0 is up.

Definition at line 534 of file adj.c.

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

◆ adj_last_lock_gone()

static void adj_last_lock_gone ( ip_adjacency_t adj)
static

Definition at line 262 of file adj.c.

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

◆ adj_lock()

void adj_lock ( adj_index_t  adj_index)

Take a reference counting lock on the adjacency.

Definition at line 331 of file adj.c.

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

◆ adj_module_init()

static clib_error_t* adj_module_init ( vlib_main_t vm)
static

Definition at line 619 of file adj.c.

+ Here is the call graph for this function:

◆ adj_mtu_update()

static clib_error_t* adj_mtu_update ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)
static

Definition at line 474 of file adj.c.

+ Here is the call graph for this function:

◆ adj_mtu_update_walk_cb()

static adj_walk_rc_t adj_mtu_update_walk_cb ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 460 of file adj.c.

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

◆ adj_node_last_lock_gone()

static void adj_node_last_lock_gone ( fib_node_t node)
static

Definition at line 570 of file adj.c.

+ Here is the call graph for this function:

◆ adj_poison()

static void adj_poison ( ip_adjacency_t adj)
inlinestatic

Definition at line 54 of file adj.c.

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

◆ adj_recursive_loop_detect()

int adj_recursive_loop_detect ( adj_index_t  ai,
fib_node_index_t **  entry_indicies 
)

descend the FIB graph looking for loops

Parameters
aiThe adj index to traverse
entry_indicies)A pointer to a vector of FIB entries already visited.

Definition at line 224 of file adj.c.

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

◆ adj_show()

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

Definition at line 636 of file adj.c.

+ Here is the call graph for this function:

◆ adj_unlock()

void adj_unlock ( adj_index_t  adj_index)

Release a reference counting lock on the adjacency.

Definition at line 348 of file adj.c.

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

◆ adj_walk()

void adj_walk ( u32  sw_if_index,
adj_walk_cb_t  cb,
void *  ctx 
)

Walk the Adjacencies on a given interface.

Definition at line 487 of file adj.c.

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

◆ format_adj_flags()

u8* format_adj_flags ( u8 s,
va_list *  args 
)

Format adjacency flags.

Definition at line 128 of file adj.c.

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

◆ format_ip_adjacency()

u8* format_ip_adjacency ( u8 s,
va_list *  args 
)

Pretty print helper function for formatting specific adjacencies.

Parameters
s- input string to format
args- other args passed to format function such as:

Definition at line 158 of file adj.c.

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

◆ VNET_SW_INTERFACE_MTU_CHANGE_FUNCTION()

VNET_SW_INTERFACE_MTU_CHANGE_FUNCTION ( adj_mtu_update  )
+ Here is the caller graph for this function:

Variable Documentation

◆ adj_attr_names

const char* adj_attr_names[] = ADJ_ATTR_NAMES
static

Adj flag names.

Definition at line 51 of file adj.c.

◆ ADJ_BCAST_ADDR

const ip46_address_t ADJ_BCAST_ADDR
Initial value:
= {
.ip6 = {
.as_u64[0] = 0xffffffffffffffff,
.as_u64[1] = 0xffffffffffffffff,
},
}

The special broadcast address (to construct a broadcast adjacency.

Definition at line 41 of file adj.c.

◆ adj_cli_counters_set_command

vlib_cli_command_t adj_cli_counters_set_command
static
Initial value:
= {
.path = "adjacency counters",
.short_help = "adjacency counters [enable|disable]",
.function = adj_cli_counters_set,
}
static clib_error_t * adj_cli_counters_set(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI invoked function to enable/disable per-adj counters.
Definition: adj.c:726

(constructor) VLIB_CLI_COMMAND (adj_cli_counters_set_command)

Definition at line 760 of file adj.c.

◆ adj_per_adj_counters

int adj_per_adj_counters

Global Config for enabling per-adjacency counters.

Global Config for enabling per-adjacency counters This is configurable because it comes with a non-negligible performance cost.

By default these are disabled.

Definition at line 39 of file adj.c.

◆ adj_pool

ip_adjacency_t* adj_pool

The global adjacency pool.

Exposed for fast/inline data-plane access

Definition at line 33 of file adj.c.

◆ adj_show_command

vlib_cli_command_t adj_show_command
static
Initial value:
= {
.path = "show adj",
.short_help = "show adj [<adj_index>] [interface] [summary]",
.function = adj_show,
}
static clib_error_t * adj_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: adj.c:636

(constructor) VLIB_CLI_COMMAND (adj_show_command)

Definition at line 716 of file adj.c.

◆ adj_vft

const fib_node_vft_t adj_vft
static
Initial value:
= {
.fnv_get = adj_get_node,
.fnv_last_lock = adj_node_last_lock_gone,
.fnv_back_walk = adj_back_walk_notify,
}
static fib_node_back_walk_rc_t adj_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Definition: adj.c:576
static fib_node_t * adj_get_node(fib_node_index_t index)
Definition: adj.c:557
static void adj_node_last_lock_gone(fib_node_t *node)
Definition: adj.c:570

Definition at line 612 of file adj.c.

◆ adjacency_counters

vlib_combined_counter_main_t adjacency_counters
Initial value:
= {
.name = "adjacency",
.stat_segment_name = "/net/adjacency",
}

Adjacency packet counters.

Definition at line 25 of file adj.c.