FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
lookup_dpo.c File Reference
+ Include dependency graph for lookup_dpo.c:

Go to the source code of this file.

Data Structures

struct  lookup_trace_t_
 Lookup trace data. More...
 

Macros

#define LOOKUP_SUB_TYPE_NUM   (LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE+1)
 
#define FOR_EACH_LOOKUP_SUB_TYPE(_st)   for (_st = LOOKUP_SUB_TYPE_IP4_SRC; _st < LOOKUP_SUB_TYPE_NUM; _st++)
 

Typedefs

typedef enum lookup_sub_type_t_ lookup_sub_type_t
 Enumeration of the lookup subtypes. More...
 
typedef struct lookup_trace_t_ lookup_trace_t
 Lookup trace data. More...
 

Enumerations

enum  lookup_sub_type_t_ { LOOKUP_SUB_TYPE_SRC, LOOKUP_SUB_TYPE_DST, LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE }
 Enumeration of the lookup subtypes. More...
 

Functions

static lookup_dpo_tlookup_dpo_alloc (void)
 
static index_t lookup_dpo_get_index (lookup_dpo_t *lkd)
 
static void lookup_dpo_add_or_lock_i (fib_node_index_t fib_index, dpo_proto_t proto, lookup_input_t input, lookup_table_t table_config, dpo_id_t *dpo)
 
void lookup_dpo_add_or_lock_w_fib_index (fib_node_index_t fib_index, dpo_proto_t proto, lookup_input_t input, lookup_table_t table_config, dpo_id_t *dpo)
 
void lookup_dpo_add_or_lock_w_table_id (u32 table_id, dpo_proto_t proto, lookup_input_t input, lookup_table_t table_config, dpo_id_t *dpo)
 
u8format_lookup_dpo (u8 *s, va_list *args)
 
static void lookup_dpo_lock (dpo_id_t *dpo)
 
static void lookup_dpo_unlock (dpo_id_t *dpo)
 
static void ip4_src_fib_lookup_one (u32 src_fib_index0, const ip4_address_t *addr0, u32 *src_adj_index0)
 
static void ip4_src_fib_lookup_two (u32 src_fib_index0, u32 src_fib_index1, const ip4_address_t *addr0, const ip4_address_t *addr1, u32 *src_adj_index0, u32 *src_adj_index1)
 
static uword lookup_dpo_ip4_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int input_src_addr, int table_from_interface)
 
static u8format_lookup_trace (u8 *s, va_list *args)
 
static uword lookup_ip4_dst (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_ip4_dst_itf (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_ip4_src (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_dpo_ip6_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int input_src_addr, int table_from_interface)
 
static uword lookup_ip6_dst (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_ip6_dst_itf (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_ip6_src (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_dpo_mpls_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int table_from_interface)
 
static u8format_lookup_mpls_trace (u8 *s, va_list *args)
 
static uword lookup_mpls_dst (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword lookup_mpls_dst_itf (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static void lookup_dpo_mem_show (void)
 
void lookup_dpo_module_init (void)
 

Variables

static const char *const lookup_input_names [] = LOOKUP_INPUTS
 
lookup_dpo_tlookup_dpo_pool
 pool of all MPLS Label DPOs More...
 
static dpo_type_t lookup_dpo_sub_types [LOOKUP_SUB_TYPE_NUM]
 An array of registered DPO type values for the sub-types. More...
 
vlib_node_registration_t lookup_ip4_dst_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip4_dst_node) More...
 
vlib_node_registration_t lookup_ip4_dst_itf_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip4_dst_itf_node) More...
 
vlib_node_registration_t lookup_ip4_src_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip4_src_node) More...
 
vlib_node_registration_t lookup_ip6_dst_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip6_dst_node) More...
 
vlib_node_registration_t lookup_ip6_dst_itf_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip6_dst_itf_node) More...
 
vlib_node_registration_t lookup_ip6_src_node
 (constructor) VLIB_REGISTER_NODE (lookup_ip6_src_node) More...
 
vlib_node_registration_t lookup_mpls_dst_node
 (constructor) VLIB_REGISTER_NODE (lookup_mpls_dst_node) More...
 
vlib_node_registration_t lookup_mpls_dst_itf_node
 (constructor) VLIB_REGISTER_NODE (lookup_mpls_dst_itf_node) More...
 
static const dpo_vft_t lkd_vft
 
static const dpo_vft_t lkd_vft_w_mem_show
 
static const char *const lookup_src_ip4_nodes []
 
static const char *const lookup_src_ip6_nodes []
 
static const char *const *const lookup_src_nodes [DPO_PROTO_NUM]
 
static const char *const lookup_dst_ip4_nodes []
 
static const char *const lookup_dst_ip6_nodes []
 
static const char *const lookup_dst_mpls_nodes []
 
static const char *const *const lookup_dst_nodes [DPO_PROTO_NUM]
 
static const char *const lookup_dst_from_interface_ip4_nodes []
 
static const char *const lookup_dst_from_interface_ip6_nodes []
 
static const char *const lookup_dst_from_interface_mpls_nodes []
 
static const char *const *const lookup_dst_from_interface_nodes [DPO_PROTO_NUM]
 

Macro Definition Documentation

#define FOR_EACH_LOOKUP_SUB_TYPE (   _st)    for (_st = LOOKUP_SUB_TYPE_IP4_SRC; _st < LOOKUP_SUB_TYPE_NUM; _st++)

Definition at line 38 of file lookup_dpo.c.

#define LOOKUP_SUB_TYPE_NUM   (LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE+1)

Definition at line 36 of file lookup_dpo.c.

Typedef Documentation

Enumeration of the lookup subtypes.

Lookup trace data.

Enumeration Type Documentation

Enumeration of the lookup subtypes.

Enumerator
LOOKUP_SUB_TYPE_SRC 
LOOKUP_SUB_TYPE_DST 
LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE 

Definition at line 30 of file lookup_dpo.c.

Function Documentation

u8* format_lookup_dpo ( u8 s,
va_list *  args 
)

Definition at line 150 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 1019 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 541 of file lookup_dpo.c.

+ Here is the call graph for this function:

static void ip4_src_fib_lookup_one ( u32  src_fib_index0,
const ip4_address_t addr0,
u32 src_adj_index0 
)
inlinestatic

Definition at line 204 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_src_fib_lookup_two ( u32  src_fib_index0,
u32  src_fib_index1,
const ip4_address_t addr0,
const ip4_address_t addr1,
u32 src_adj_index0,
u32 src_adj_index1 
)
inlinestatic

Definition at line 225 of file lookup_dpo.c.

+ Here is the call graph for this function:

static void lookup_dpo_add_or_lock_i ( fib_node_index_t  fib_index,
dpo_proto_t  proto,
lookup_input_t  input,
lookup_table_t  table_config,
dpo_id_t dpo 
)
static

Definition at line 68 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lookup_dpo_add_or_lock_w_fib_index ( fib_node_index_t  fib_index,
dpo_proto_t  proto,
lookup_input_t  input,
lookup_table_t  table_config,
dpo_id_t dpo 
)

Definition at line 116 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lookup_dpo_add_or_lock_w_table_id ( u32  table_id,
dpo_proto_t  proto,
lookup_input_t  input,
lookup_table_t  table_config,
dpo_id_t dpo 
)

Definition at line 130 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static lookup_dpo_t* lookup_dpo_alloc ( void  )
static

Definition at line 52 of file lookup_dpo.c.

+ Here is the caller graph for this function:

static index_t lookup_dpo_get_index ( lookup_dpo_t lkd)
static

Definition at line 62 of file lookup_dpo.c.

+ Here is the caller graph for this function:

static uword lookup_dpo_ip4_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
int  input_src_addr,
int  table_from_interface 
)
inlinestatic

Definition at line 274 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword lookup_dpo_ip6_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
int  input_src_addr,
int  table_from_interface 
)
inlinestatic

Definition at line 607 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lookup_dpo_lock ( dpo_id_t dpo)
static

Definition at line 174 of file lookup_dpo.c.

+ Here is the call graph for this function:

static void lookup_dpo_mem_show ( void  )
static

Definition at line 1074 of file lookup_dpo.c.

+ Here is the call graph for this function:

void lookup_dpo_module_init ( void  )

Definition at line 1157 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword lookup_dpo_mpls_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
int  table_from_interface 
)
inlinestatic

Definition at line 928 of file lookup_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lookup_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 184 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 556 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 573 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 590 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 877 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 894 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 911 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 1038 of file lookup_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 1056 of file lookup_dpo.c.

+ Here is the call graph for this function:

Variable Documentation

const dpo_vft_t lkd_vft
static
Initial value:
= {
.dv_lock = lookup_dpo_lock,
.dv_unlock = lookup_dpo_unlock,
.dv_format = format_lookup_dpo,
}
u8 * format_lookup_dpo(u8 *s, va_list *args)
Definition: lookup_dpo.c:150
static void lookup_dpo_unlock(dpo_id_t *dpo)
Definition: lookup_dpo.c:184
static void lookup_dpo_lock(dpo_id_t *dpo)
Definition: lookup_dpo.c:174

Definition at line 1082 of file lookup_dpo.c.

const dpo_vft_t lkd_vft_w_mem_show
static
Initial value:
= {
.dv_lock = lookup_dpo_lock,
.dv_unlock = lookup_dpo_unlock,
.dv_format = format_lookup_dpo,
.dv_mem_show = lookup_dpo_mem_show,
}
u8 * format_lookup_dpo(u8 *s, va_list *args)
Definition: lookup_dpo.c:150
static void lookup_dpo_unlock(dpo_id_t *dpo)
Definition: lookup_dpo.c:184
static void lookup_dpo_lock(dpo_id_t *dpo)
Definition: lookup_dpo.c:174
static void lookup_dpo_mem_show(void)
Definition: lookup_dpo.c:1074

Definition at line 1087 of file lookup_dpo.c.

lookup_dpo_t* lookup_dpo_pool

pool of all MPLS Label DPOs

Definition at line 44 of file lookup_dpo.c.

dpo_type_t lookup_dpo_sub_types[LOOKUP_SUB_TYPE_NUM]
static

An array of registered DPO type values for the sub-types.

Definition at line 49 of file lookup_dpo.c.

const char* const lookup_dst_from_interface_ip4_nodes[]
static
Initial value:
=
{
"lookup-ip4-dst-itf",
}
#define NULL
Definition: clib.h:55

Definition at line 1133 of file lookup_dpo.c.

const char* const lookup_dst_from_interface_ip6_nodes[]
static
Initial value:
=
{
"lookup-ip6-dst-itf",
}
#define NULL
Definition: clib.h:55

Definition at line 1138 of file lookup_dpo.c.

const char* const lookup_dst_from_interface_mpls_nodes[]
static
Initial value:
=
{
"lookup-mpls-dst-itf",
}
#define NULL
Definition: clib.h:55

Definition at line 1143 of file lookup_dpo.c.

const char* const* const lookup_dst_from_interface_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lookup_dst_from_interface_ip6_nodes[]
Definition: lookup_dpo.c:1138
static const char *const lookup_dst_from_interface_mpls_nodes[]
Definition: lookup_dpo.c:1143
static const char *const lookup_dst_from_interface_ip4_nodes[]
Definition: lookup_dpo.c:1133

Definition at line 1148 of file lookup_dpo.c.

const char* const lookup_dst_ip4_nodes[]
static
Initial value:
=
{
"lookup-ip4-dst",
}
#define NULL
Definition: clib.h:55

Definition at line 1111 of file lookup_dpo.c.

const char* const lookup_dst_ip6_nodes[]
static
Initial value:
=
{
"lookup-ip6-dst",
}
#define NULL
Definition: clib.h:55

Definition at line 1116 of file lookup_dpo.c.

const char* const lookup_dst_mpls_nodes[]
static
Initial value:
=
{
"lookup-mpls-dst",
}
#define NULL
Definition: clib.h:55

Definition at line 1121 of file lookup_dpo.c.

const char* const* const lookup_dst_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const lookup_dst_mpls_nodes[]
Definition: lookup_dpo.c:1121
static const char *const lookup_dst_ip6_nodes[]
Definition: lookup_dpo.c:1116
static const char *const lookup_dst_ip4_nodes[]
Definition: lookup_dpo.c:1111

Definition at line 1126 of file lookup_dpo.c.

const char* const lookup_input_names[] = LOOKUP_INPUTS
static

Definition at line 25 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip4_dst_itf_node
Initial value:
= {
.function = lookup_ip4_dst_itf,
.name = "lookup-ip4-dst-itf",
.vector_size = sizeof (u32),
.sibling_of = "ip4-lookup",
.format_trace = format_lookup_trace,
}
static uword lookup_ip4_dst_itf(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:573
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip4_dst_itf_node)

Definition at line 580 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip4_dst_node
Initial value:
= {
.function = lookup_ip4_dst,
.name = "lookup-ip4-dst",
.vector_size = sizeof (u32),
.sibling_of = "ip4-lookup",
.format_trace = format_lookup_trace,
}
unsigned int u32
Definition: types.h:88
static uword lookup_ip4_dst(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:556
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip4_dst_node)

Definition at line 563 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip4_src_node
Initial value:
= {
.function = lookup_ip4_src,
.name = "lookup-ip4-src",
.vector_size = sizeof (u32),
.format_trace = format_lookup_trace,
.sibling_of = "ip4-lookup",
}
static uword lookup_ip4_src(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:590
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip4_src_node)

Definition at line 597 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip6_dst_itf_node
Initial value:
= {
.function = lookup_ip6_dst_itf,
.name = "lookup-ip6-dst-itf",
.vector_size = sizeof (u32),
.format_trace = format_lookup_trace,
.sibling_of = "ip6-lookup",
}
static uword lookup_ip6_dst_itf(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:894
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip6_dst_itf_node)

Definition at line 901 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip6_dst_node
Initial value:
= {
.function = lookup_ip6_dst,
.name = "lookup-ip6-dst",
.vector_size = sizeof (u32),
.format_trace = format_lookup_trace,
.sibling_of = "ip6-lookup",
}
static uword lookup_ip6_dst(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:877
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip6_dst_node)

Definition at line 884 of file lookup_dpo.c.

vlib_node_registration_t lookup_ip6_src_node
Initial value:
= {
.function = lookup_ip6_src,
.name = "lookup-ip6-src",
.vector_size = sizeof (u32),
.format_trace = format_lookup_trace,
.sibling_of = "ip6-lookup",
}
static uword lookup_ip6_src(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:911
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:541

(constructor) VLIB_REGISTER_NODE (lookup_ip6_src_node)

Definition at line 918 of file lookup_dpo.c.

vlib_node_registration_t lookup_mpls_dst_itf_node
Initial value:
= {
.function = lookup_mpls_dst_itf,
.name = "lookup-mpls-dst-itf",
.vector_size = sizeof (u32),
.sibling_of = "mpls-lookup",
.format_trace = format_lookup_mpls_trace,
.n_next_nodes = 0,
}
static uword lookup_mpls_dst_itf(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:1056
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_mpls_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:1019

(constructor) VLIB_REGISTER_NODE (lookup_mpls_dst_itf_node)

Definition at line 1063 of file lookup_dpo.c.

vlib_node_registration_t lookup_mpls_dst_node
Initial value:
= {
.function = lookup_mpls_dst,
.name = "lookup-mpls-dst",
.vector_size = sizeof (u32),
.sibling_of = "mpls-lookup",
.format_trace = format_lookup_mpls_trace,
.n_next_nodes = 0,
}
static uword lookup_mpls_dst(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: lookup_dpo.c:1038
unsigned int u32
Definition: types.h:88
static u8 * format_lookup_mpls_trace(u8 *s, va_list *args)
Definition: lookup_dpo.c:1019

(constructor) VLIB_REGISTER_NODE (lookup_mpls_dst_node)

Definition at line 1045 of file lookup_dpo.c.

const char* const lookup_src_ip4_nodes[]
static
Initial value:
=
{
"lookup-ip4-src",
}
#define NULL
Definition: clib.h:55

Definition at line 1094 of file lookup_dpo.c.

const char* const lookup_src_ip6_nodes[]
static
Initial value:
=
{
"lookup-ip6-src",
}
#define NULL
Definition: clib.h:55

Definition at line 1099 of file lookup_dpo.c.

const char* const* const lookup_src_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
#define NULL
Definition: clib.h:55
static const char *const lookup_src_ip6_nodes[]
Definition: lookup_dpo.c:1099
static const char *const lookup_src_ip4_nodes[]
Definition: lookup_dpo.c:1094

Definition at line 1104 of file lookup_dpo.c.