FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
adj_midchain.c File Reference
+ Include dependency graph for adj_midchain.c:

Go to the source code of this file.

Data Structures

struct  adj_midchain_tx_trace_t_
 Trace data for packets traversing the midchain tx node. More...
 

Typedefs

typedef struct adj_midchain_tx_trace_t_ adj_midchain_tx_trace_t
 Trace data for packets traversing the midchain tx node. More...
 

Functions

static uword adj_midchain_tx_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int interface_count)
 
static u8format_adj_midchain_tx_trace (u8 *s, va_list *args)
 
static uword adj_midchain_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword adj_midchain_tx_no_count (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (adj_midchain_tx_ip4, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_no_count_ip4, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_ip6, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_no_count_ip6, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_mpls, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_no_count_mpls, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_ethernet, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_no_count_ethernet, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_nsh, static)
 
 VNET_FEATURE_INIT (adj_midchain_tx_no_count_nsh, static)
 
static u32 adj_get_midchain_node (vnet_link_t link)
 
static u8 adj_midchain_get_feature_arc_index_for_link_type (const ip_adjacency_t *adj)
 
static u32 adj_nbr_midchain_get_tx_node (ip_adjacency_t *adj)
 
static u32 adj_nbr_midchain_get_feature_node (ip_adjacency_t *adj)
 
void adj_midchain_setup (adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *data, adj_flags_t flags)
 adj_midchain_setup More...
 
void adj_nbr_midchain_update_rewrite (adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
 adj_nbr_midchain_update_rewrite More...
 
void adj_nbr_midchain_unstack (adj_index_t adj_index)
 adj_nbr_midchain_unstack More...
 
void adj_nbr_midchain_stack_on_fib_entry (adj_index_t ai, fib_node_index_t fei, fib_forward_chain_type_t fct)
 [re]stack a midchain. More...
 
void adj_nbr_midchain_stack (adj_index_t adj_index, const dpo_id_t *next)
 adj_nbr_midchain_stack More...
 
int adj_ndr_midchain_recursive_loop_detect (adj_index_t ai, fib_node_index_t **entry_indicies)
 descend the FIB graph looking for loops More...
 
u8format_adj_midchain (u8 *s, va_list *ap)
 Format a midchain adjacency. More...
 
static void adj_dpo_lock (dpo_id_t *dpo)
 
static void adj_dpo_unlock (dpo_id_t *dpo)
 
void adj_midchain_module_init (void)
 Module initialisation. More...
 

Variables

static u32 adj_midchain_tx_feature_node [VNET_LINK_NUM]
 The two midchain tx feature node indices. More...
 
static u32 adj_midchain_tx_no_count_feature_node [VNET_LINK_NUM]
 
static vlib_node_registration_t adj_midchain_tx_node
 (constructor) VLIB_REGISTER_NODE (adj_midchain_tx_node) More...
 
static vlib_node_registration_t adj_midchain_tx_no_count_node
 (constructor) VLIB_REGISTER_NODE (adj_midchain_tx_no_count_node) More...
 
static const dpo_vft_t adj_midchain_dpo_vft
 
static const char *const midchain_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a midchain object. More...
 
static const char *const midchain_ip6_nodes []
 
static const char *const midchain_mpls_nodes []
 
static const char *const midchain_ethernet_nodes []
 
static const char *const midchain_nsh_nodes []
 
static const char *const *const midchain_nodes [DPO_PROTO_NUM]
 

Typedef Documentation

◆ adj_midchain_tx_trace_t

Trace data for packets traversing the midchain tx node.

Function Documentation

◆ adj_dpo_lock()

static void adj_dpo_lock ( dpo_id_t dpo)
static

Definition at line 729 of file adj_midchain.c.

+ Here is the call graph for this function:

◆ adj_dpo_unlock()

static void adj_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 734 of file adj_midchain.c.

+ Here is the call graph for this function:

◆ adj_get_midchain_node()

static u32 adj_get_midchain_node ( vnet_link_t  link)
inlinestatic

Definition at line 377 of file adj_midchain.c.

+ Here is the caller graph for this function:

◆ adj_midchain_get_feature_arc_index_for_link_type()

static u8 adj_midchain_get_feature_arc_index_for_link_type ( const ip_adjacency_t adj)
static

Definition at line 398 of file adj_midchain.c.

+ Here is the caller graph for this function:

◆ adj_midchain_module_init()

void adj_midchain_module_init ( void  )

Module initialisation.

Definition at line 789 of file adj_midchain.c.

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

◆ adj_midchain_setup()

void adj_midchain_setup ( adj_index_t  adj_index,
adj_midchain_fixup_t  fixup,
const void *  data,
adj_flags_t  flags 
)

adj_midchain_setup

Setup the adj as a mid-chain

Definition at line 463 of file adj_midchain.c.

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

◆ adj_midchain_tx()

static uword adj_midchain_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 274 of file adj_midchain.c.

+ Here is the call graph for this function:

◆ adj_midchain_tx_inline()

static uword adj_midchain_tx_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  interface_count 
)
inlinestatic

Definition at line 45 of file adj_midchain.c.

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

◆ adj_midchain_tx_no_count()

static uword adj_midchain_tx_no_count ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 295 of file adj_midchain.c.

+ Here is the call graph for this function:

◆ adj_nbr_midchain_get_feature_node()

static u32 adj_nbr_midchain_get_feature_node ( ip_adjacency_t adj)
static

Definition at line 447 of file adj_midchain.c.

+ Here is the caller graph for this function:

◆ adj_nbr_midchain_get_tx_node()

static u32 adj_nbr_midchain_get_tx_node ( ip_adjacency_t adj)
static

Definition at line 439 of file adj_midchain.c.

+ Here is the caller graph for this function:

◆ adj_nbr_midchain_stack()

void adj_nbr_midchain_stack ( adj_index_t  adj_index,
const dpo_id_t next 
)

adj_nbr_midchain_stack

[re]stack a midchain.

Definition at line 655 of file adj_midchain.c.

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

◆ adj_nbr_midchain_stack_on_fib_entry()

void adj_nbr_midchain_stack_on_fib_entry ( adj_index_t  adj_index,
fib_node_index_t  fei,
fib_forward_chain_type_t  fct 
)

[re]stack a midchain.

'Stacking' is the act of forming parent-child relationships in the data-plane graph. Since function performs recursive loop detection.

Parameters
adj_indexThe index of the midchain to stack
feiThe FIB entry to stack on
fctThe chain type to use from the fib entry fowarding

Definition at line 584 of file adj_midchain.c.

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

◆ adj_nbr_midchain_unstack()

void adj_nbr_midchain_unstack ( adj_index_t  adj_index)

adj_nbr_midchain_unstack

unstack a midchain.

Unstack the adj. stack it on drop

Definition at line 552 of file adj_midchain.c.

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

◆ adj_nbr_midchain_update_rewrite()

void adj_nbr_midchain_update_rewrite ( adj_index_t  adj_index,
adj_midchain_fixup_t  fixup,
const void *  fixup_data,
adj_flags_t  flags,
u8 rewrite 
)

adj_nbr_midchain_update_rewrite

Midchain Adjacency sub-type.

Update the adjacency's rewrite string. A NULL string implies the rewrite is reset (i.e. when ARP/ND etnry is gone). NB: the adj being updated may be handling traffic in the DP.

Definition at line 509 of file adj_midchain.c.

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

◆ adj_ndr_midchain_recursive_loop_detect()

int adj_ndr_midchain_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 673 of file adj_midchain.c.

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

◆ format_adj_midchain()

u8* format_adj_midchain ( u8 s,
va_list *  ap 
)

Format a midchain adjacency.

Definition at line 700 of file adj_midchain.c.

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

◆ format_adj_midchain_tx_trace()

static u8* format_adj_midchain_tx_trace ( u8 s,
va_list *  args 
)
static

Definition at line 260 of file adj_midchain.c.

+ Here is the call graph for this function:

◆ VNET_FEATURE_INIT() [1/10]

VNET_FEATURE_INIT ( adj_midchain_tx_ip4  ,
static   
)

◆ VNET_FEATURE_INIT() [2/10]

VNET_FEATURE_INIT ( adj_midchain_tx_no_count_ip4  ,
static   
)

◆ VNET_FEATURE_INIT() [3/10]

VNET_FEATURE_INIT ( adj_midchain_tx_ip6  ,
static   
)

◆ VNET_FEATURE_INIT() [4/10]

VNET_FEATURE_INIT ( adj_midchain_tx_no_count_ip6  ,
static   
)

◆ VNET_FEATURE_INIT() [5/10]

VNET_FEATURE_INIT ( adj_midchain_tx_mpls  ,
static   
)

◆ VNET_FEATURE_INIT() [6/10]

VNET_FEATURE_INIT ( adj_midchain_tx_no_count_mpls  ,
static   
)

◆ VNET_FEATURE_INIT() [7/10]

VNET_FEATURE_INIT ( adj_midchain_tx_ethernet  ,
static   
)

◆ VNET_FEATURE_INIT() [8/10]

VNET_FEATURE_INIT ( adj_midchain_tx_no_count_ethernet  ,
static   
)

◆ VNET_FEATURE_INIT() [9/10]

VNET_FEATURE_INIT ( adj_midchain_tx_nsh  ,
static   
)

◆ VNET_FEATURE_INIT() [10/10]

VNET_FEATURE_INIT ( adj_midchain_tx_no_count_nsh  ,
static   
)

Variable Documentation

◆ adj_midchain_dpo_vft

const dpo_vft_t adj_midchain_dpo_vft
static
Initial value:
= {
.dv_lock = adj_dpo_lock,
.dv_unlock = adj_dpo_unlock,
.dv_format = format_adj_midchain,
.dv_get_urpf = adj_dpo_get_urpf,
}
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
Definition: adj.c:291
static void adj_dpo_unlock(dpo_id_t *dpo)
Definition: adj_midchain.c:734
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
Definition: adj_midchain.c:700
static void adj_dpo_lock(dpo_id_t *dpo)
Definition: adj_midchain.c:729

Definition at line 739 of file adj_midchain.c.

◆ adj_midchain_tx_feature_node

u32 adj_midchain_tx_feature_node[VNET_LINK_NUM]
static

The two midchain tx feature node indices.

Definition at line 30 of file adj_midchain.c.

◆ adj_midchain_tx_no_count_feature_node

u32 adj_midchain_tx_no_count_feature_node[VNET_LINK_NUM]
static

Definition at line 31 of file adj_midchain.c.

◆ adj_midchain_tx_no_count_node

vlib_node_registration_t adj_midchain_tx_no_count_node
static
Initial value:
= {
.name = "adj-midchain-tx-no-count",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}
static uword adj_midchain_tx_no_count(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: adj_midchain.c:295
unsigned int u32
Definition: types.h:88
static u8 * format_adj_midchain_tx_trace(u8 *s, va_list *args)
Definition: adj_midchain.c:260

(constructor) VLIB_REGISTER_NODE (adj_midchain_tx_no_count_node)

Definition at line 302 of file adj_midchain.c.

◆ adj_midchain_tx_node

vlib_node_registration_t adj_midchain_tx_node
static
Initial value:
= {
.function = adj_midchain_tx,
.name = "adj-midchain-tx",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}
static uword adj_midchain_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: adj_midchain.c:274
unsigned int u32
Definition: types.h:88
static u8 * format_adj_midchain_tx_trace(u8 *s, va_list *args)
Definition: adj_midchain.c:260

(constructor) VLIB_REGISTER_NODE (adj_midchain_tx_node)

Definition at line 281 of file adj_midchain.c.

◆ midchain_ethernet_nodes

const char* const midchain_ethernet_nodes[]
static
Initial value:
=
{
"adj-l2-midchain",
}
#define NULL
Definition: clib.h:58

Definition at line 768 of file adj_midchain.c.

◆ midchain_ip4_nodes

const char* const midchain_ip4_nodes[]
static
Initial value:
=
{
"ip4-midchain",
}
#define NULL
Definition: clib.h:58

The per-protocol VLIB graph nodes that are assigned to a midchain object.

this means that these graph nodes are ones from which a midchain is the parent object in the DPO-graph.

Definition at line 753 of file adj_midchain.c.

◆ midchain_ip6_nodes

const char* const midchain_ip6_nodes[]
static
Initial value:
=
{
"ip6-midchain",
}
#define NULL
Definition: clib.h:58

Definition at line 758 of file adj_midchain.c.

◆ midchain_mpls_nodes

const char* const midchain_mpls_nodes[]
static
Initial value:
=
{
"mpls-midchain",
}
#define NULL
Definition: clib.h:58

Definition at line 763 of file adj_midchain.c.

◆ midchain_nodes

const char* const* const midchain_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const midchain_nsh_nodes[]
Definition: adj_midchain.c:773
static const char *const midchain_ip6_nodes[]
Definition: adj_midchain.c:758
static const char *const midchain_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a midchain object.
Definition: adj_midchain.c:753
static const char *const midchain_mpls_nodes[]
Definition: adj_midchain.c:763
static const char *const midchain_ethernet_nodes[]
Definition: adj_midchain.c:768

Definition at line 779 of file adj_midchain.c.

◆ midchain_nsh_nodes

const char* const midchain_nsh_nodes[]
static
Initial value:
=
{
"adj-nsh-midchain",
}
#define NULL
Definition: clib.h:58

Definition at line 773 of file adj_midchain.c.