FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
dvr_dpo.c File Reference
+ Include dependency graph for dvr_dpo.c:

Go to the source code of this file.

Data Structures

struct  dvr_dpo_trace_t_
 Interface DPO trace data. More...
 

Typedefs

typedef struct dvr_dpo_trace_t_ dvr_dpo_trace_t
 Interface DPO trace data. More...
 
typedef enum dvr_reinject_next_t_ dvr_reinject_next_t
 

Enumerations

enum  dvr_reinject_next_t_ { DVR_REINJECT_NEXT_L2, DVR_REINJECT_NEXT_L3 }
 

Functions

static dvr_dpo_tdvr_dpo_alloc (void)
 
static dvr_dpo_tdvr_dpo_get_from_dpo (const dpo_id_t *dpo)
 
static index_t dvr_dpo_get_index (dvr_dpo_t *dd)
 
static void dvr_dpo_lock (dpo_id_t *dpo)
 
static void dvr_dpo_unlock (dpo_id_t *dpo)
 
void dvr_dpo_add_or_lock (u32 sw_if_index, dpo_proto_t dproto, dpo_id_t *dpo)
 
static clib_error_tdvr_dpo_interface_state_change (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (dvr_dpo_interface_state_change)
 
static clib_error_tdvr_dpo_hw_interface_state_change (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 Registered callback for HW interface state changes. More...
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (dvr_dpo_hw_interface_state_change)
 
static clib_error_tdvr_dpo_interface_delete (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (dvr_dpo_interface_delete)
 
static u8format_dvr_reinject (u8 *s, va_list *ap)
 
static u8format_dvr_dpo (u8 *s, va_list *ap)
 
static void dvr_dpo_mem_show (void)
 
void dvr_dpo_module_init (void)
 
static uword dvr_dpo_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip6)
 
static u8format_dvr_dpo_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() ip4_dvr_dpo_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() ip6_dvr_dpo_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword dvr_reinject_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() ip4_dvr_reinject_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() ip6_dvr_reinject_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VNET_FEATURE_INIT (ip4_dvr_reinject_feat_node, static)
 
 VNET_FEATURE_INIT (ip6_dvr_reinject_feat_node, static)
 

Variables

dvr_dpo_tdvr_dpo_pool
 pool of all interface DPOs More...
 
static index_tdvr_dpo_db [DPO_PROTO_NUM]
 The 'DB' of DVR DPOs. More...
 
const static dpo_vft_t dvr_dpo_vft
 
const static char *const dvr_dpo_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a glean object. More...
 
const static char *const dvr_dpo_ip6_nodes []
 
const static char *const *const dvr_dpo_nodes [DPO_PROTO_NUM]
 
vlib_node_registration_t ip4_dvr_dpo_node
 (constructor) VLIB_REGISTER_NODE (ip4_dvr_dpo_node) More...
 
vlib_node_registration_t ip6_dvr_dpo_node
 (constructor) VLIB_REGISTER_NODE (ip6_dvr_dpo_node) More...
 
vlib_node_registration_t ip4_dvr_reinject_node
 (constructor) VLIB_REGISTER_NODE (ip4_dvr_reinject_node) More...
 
vlib_node_registration_t ip6_dvr_reinject_node
 (constructor) VLIB_REGISTER_NODE (ip6_dvr_reinject_node) More...
 

Typedef Documentation

◆ dvr_dpo_trace_t

Interface DPO trace data.

◆ dvr_reinject_next_t

Enumeration Type Documentation

◆ dvr_reinject_next_t_

Enumerator
DVR_REINJECT_NEXT_L2 
DVR_REINJECT_NEXT_L3 

Definition at line 465 of file dvr_dpo.c.

Function Documentation

◆ dvr_dpo_add_or_lock()

void dvr_dpo_add_or_lock ( u32  sw_if_index,
dpo_proto_t  dproto,
dpo_id_t dpo 
)

Definition at line 91 of file dvr_dpo.c.

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

◆ dvr_dpo_alloc()

static dvr_dpo_t* dvr_dpo_alloc ( void  )
static

Definition at line 32 of file dvr_dpo.c.

+ Here is the caller graph for this function:

◆ dvr_dpo_get_from_dpo()

static dvr_dpo_t* dvr_dpo_get_from_dpo ( const dpo_id_t dpo)
inlinestatic

Definition at line 42 of file dvr_dpo.c.

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

◆ dvr_dpo_get_index()

static index_t dvr_dpo_get_index ( dvr_dpo_t dd)
inlinestatic

Definition at line 50 of file dvr_dpo.c.

+ Here is the caller graph for this function:

◆ dvr_dpo_hw_interface_state_change()

static clib_error_t* dvr_dpo_hw_interface_state_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Registered callback for HW interface state changes.

Definition at line 162 of file dvr_dpo.c.

◆ dvr_dpo_inline()

static uword dvr_dpo_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u8  is_ip6 
)
inlinestatic

Definition at line 276 of file dvr_dpo.c.

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

◆ dvr_dpo_interface_delete()

static clib_error_t* dvr_dpo_interface_delete ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 173 of file dvr_dpo.c.

◆ dvr_dpo_interface_state_change()

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

Definition at line 146 of file dvr_dpo.c.

◆ dvr_dpo_lock()

static void dvr_dpo_lock ( dpo_id_t dpo)
static

Definition at line 56 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ dvr_dpo_mem_show()

static void dvr_dpo_mem_show ( void  )
static

Definition at line 218 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ dvr_dpo_module_init()

void dvr_dpo_module_init ( void  )

Definition at line 259 of file dvr_dpo.c.

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

◆ dvr_dpo_unlock()

static void dvr_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 65 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ dvr_reinject_inline()

static uword dvr_reinject_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
inlinestatic

Definition at line 472 of file dvr_dpo.c.

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

◆ format_dvr_dpo()

static u8* format_dvr_dpo ( u8 s,
va_list *  ap 
)
static

Definition at line 202 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ format_dvr_dpo_trace()

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

Definition at line 426 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ format_dvr_reinject()

static u8* format_dvr_reinject ( u8 s,
va_list *  ap 
)
static

Definition at line 185 of file dvr_dpo.c.

+ Here is the caller graph for this function:

◆ ip4_dvr_dpo_node()

VLIB_NODE_FN() ip4_dvr_dpo_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 438 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ ip4_dvr_reinject_node()

VLIB_NODE_FN() ip4_dvr_reinject_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 593 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ ip6_dvr_dpo_node()

VLIB_NODE_FN() ip6_dvr_dpo_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 445 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ ip6_dvr_reinject_node()

VLIB_NODE_FN() ip6_dvr_reinject_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 600 of file dvr_dpo.c.

+ Here is the call graph for this function:

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( ip4_dvr_reinject_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( ip6_dvr_reinject_feat_node  ,
static   
)

◆ VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION()

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( dvr_dpo_hw_interface_state_change  )

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( dvr_dpo_interface_delete  )

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( dvr_dpo_interface_state_change  )

Variable Documentation

◆ dvr_dpo_db

index_t* dvr_dpo_db[DPO_PROTO_NUM]
static

The 'DB' of DVR DPOs.

There is one per-interface per-L3 proto, so this is a per-interface vector

Definition at line 29 of file dvr_dpo.c.

◆ dvr_dpo_ip4_nodes

const static char* const dvr_dpo_ip4_nodes[]
static
Initial value:
=
{
"ip4-dvr-dpo",
NULL,
}

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

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

Definition at line 241 of file dvr_dpo.c.

◆ dvr_dpo_ip6_nodes

const static char* const dvr_dpo_ip6_nodes[]
static
Initial value:
=
{
"ip6-dvr-dpo",
NULL,
}

Definition at line 246 of file dvr_dpo.c.

◆ dvr_dpo_nodes

const static char* const * const dvr_dpo_nodes[DPO_PROTO_NUM]
static
Initial value:

Definition at line 252 of file dvr_dpo.c.

◆ dvr_dpo_pool

dvr_dpo_t* dvr_dpo_pool

pool of all interface DPOs

Definition at line 23 of file dvr_dpo.c.

◆ dvr_dpo_vft

const static dpo_vft_t dvr_dpo_vft
static
Initial value:
= {
.dv_lock = dvr_dpo_lock,
.dv_unlock = dvr_dpo_unlock,
.dv_format = format_dvr_dpo,
.dv_mem_show = dvr_dpo_mem_show,
}

Definition at line 227 of file dvr_dpo.c.

◆ ip4_dvr_dpo_node

vlib_node_registration_t ip4_dvr_dpo_node
Initial value:
= {
.name = "ip4-dvr-dpo",
.vector_size = sizeof (u32),
.format_trace = format_dvr_dpo_trace,
.sibling_of = "ip4-rewrite",
}

(constructor) VLIB_REGISTER_NODE (ip4_dvr_dpo_node)

Definition at line 452 of file dvr_dpo.c.

◆ ip4_dvr_reinject_node

vlib_node_registration_t ip4_dvr_reinject_node
Initial value:
= {
.name = "ip4-dvr-reinject",
.vector_size = sizeof (u32),
.format_trace = format_dvr_dpo_trace,
.n_next_nodes = 1,
.next_nodes = {
[DVR_REINJECT_NEXT_L2] = "l2-output",
[DVR_REINJECT_NEXT_L3] = "interface-output",
},
}

(constructor) VLIB_REGISTER_NODE (ip4_dvr_reinject_node)

Definition at line 607 of file dvr_dpo.c.

◆ ip6_dvr_dpo_node

vlib_node_registration_t ip6_dvr_dpo_node
Initial value:
= {
.name = "ip6-dvr-dpo",
.vector_size = sizeof (u32),
.format_trace = format_dvr_dpo_trace,
.sibling_of = "ip6-rewrite",
}

(constructor) VLIB_REGISTER_NODE (ip6_dvr_dpo_node)

Definition at line 458 of file dvr_dpo.c.

◆ ip6_dvr_reinject_node

vlib_node_registration_t ip6_dvr_reinject_node
Initial value:
= {
.name = "ip6-dvr-reinject",
.vector_size = sizeof (u32),
.format_trace = format_dvr_dpo_trace,
.n_next_nodes = 1,
.next_nodes = {
[DVR_REINJECT_NEXT_L2] = "l2-output",
[DVR_REINJECT_NEXT_L3] = "interface-output",
},
}

(constructor) VLIB_REGISTER_NODE (ip6_dvr_reinject_node)

Definition at line 619 of file dvr_dpo.c.

dvr_dpo_ip6_nodes
const static char *const dvr_dpo_ip6_nodes[]
Definition: dvr_dpo.c:246
dvr_dpo_ip4_nodes
const static char *const dvr_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Definition: dvr_dpo.c:241
dvr_dpo_unlock
static void dvr_dpo_unlock(dpo_id_t *dpo)
Definition: dvr_dpo.c:65
DVR_REINJECT_NEXT_L3
@ DVR_REINJECT_NEXT_L3
Definition: dvr_dpo.c:468
DVR_REINJECT_NEXT_L2
@ DVR_REINJECT_NEXT_L2
Definition: dvr_dpo.c:467
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
u32
unsigned int u32
Definition: types.h:88
dvr_dpo_mem_show
static void dvr_dpo_mem_show(void)
Definition: dvr_dpo.c:218
dvr_dpo_lock
static void dvr_dpo_lock(dpo_id_t *dpo)
Definition: dvr_dpo.c:56
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
format_dvr_dpo_trace
static u8 * format_dvr_dpo_trace(u8 *s, va_list *args)
Definition: dvr_dpo.c:426
format_dvr_dpo
static u8 * format_dvr_dpo(u8 *s, va_list *ap)
Definition: dvr_dpo.c:202