FD.io VPP  v16.06
Vector Packet Processing
l2_input.c File Reference
+ Include dependency graph for l2_input.c:

Go to the source code of this file.

Data Structures

struct  l2input_trace_t
 

Macros

#define foreach_l2input_error
 
#define get_u32(addr)   ( *((u32 *)(addr)) )
 
#define get_u16(addr)   ( *((u16 *)(addr)) )
 
#define STATS_IF_LAYER2_UCAST_INPUT_CNT   0
 
#define STATS_IF_LAYER2_MCAST_INPUT_CNT   1
 
#define STATS_IF_LAYER2_BCAST_INPUT_CNT   2
 
#define foreach_l2_init_function
 

Enumerations

enum  l2input_error_t { L2INPUT_N_ERROR }
 
enum  l2input_next_t { L2INPUT_NEXT_LEARN, L2INPUT_NEXT_FWD, L2INPUT_NEXT_DROP, L2INPUT_N_NEXT }
 

Functions

char ** l2input_get_feat_names (void)
 
static u8format_l2input_trace (u8 *s, va_list *args)
 
static_always_inline void classify_and_dispatch (vlib_main_t *vm, vlib_node_runtime_t *node, u32 cpu_index, l2input_main_t *msm, vlib_buffer_t *b0, u32 *next0)
 
static uword l2input_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tl2input_init (vlib_main_t *vm)
 
l2_input_config_tl2input_intf_config (u32 sw_if_index)
 
u32 l2input_intf_bitmap_enable (u32 sw_if_index, u32 feature_bitmap, u32 enable)
 
u32 l2input_set_bridge_features (u32 bd_index, u32 feat_mask, u32 feat_value)
 
u32 set_int_l2_mode (vlib_main_t *vm, vnet_main_t *vnet_main, u32 mode, u32 sw_if_index, u32 bd_index, u32 bvi, u32 shg, u32 xc_sw_if_index)
 
static clib_error_tint_l2_bridge (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tint_l2_xc (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tint_l3 (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_int_mode (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tl2_init (vlib_main_t *vm)
 

Variables

static char * l2input_feat_names []
 
l2input_main_t l2input_main
 
static char * l2input_error_strings []
 
vlib_node_registration_t l2input_node
 (constructor) VLIB_REGISTER_NODE (l2input_node) More...
 
vlib_cli_command_t int_l2_bridge_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_bridge_cli) More...
 
vlib_cli_command_t int_l2_xc_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_xc_cli) More...
 
vlib_cli_command_t int_l3_cli
 (constructor) VLIB_CLI_COMMAND (int_l3_cli) More...
 
vlib_cli_command_t show_l2_mode
 (constructor) VLIB_CLI_COMMAND (show_l2_mode) More...
 

Macro Definition Documentation

#define foreach_l2_init_function
Value:
clib_error_t * feat_bitmap_drop_init(vlib_main_t *vm)
Definition: feat_bitmap.c:141
clib_error_t * l2output_init(vlib_main_t *vm)
Definition: l2_output.c:417
clib_error_t * l2_vtr_init(vlib_main_t *vm)
Definition: l2_vtr.c:34
clib_error_t * l2fwd_init(vlib_main_t *vm)
Definition: l2_fwd.c:370
clib_error_t * l2fib_init(vlib_main_t *vm)
Definition: l2_fib.c:543
clib_error_t * l2learn_init(vlib_main_t *vm)
Definition: l2_learn.c:419
clib_error_t * l2bd_init(vlib_main_t *vm)
Definition: l2_bd.c:144
clib_error_t * l2_xcrw_init(vlib_main_t *vm)
Definition: l2_xcrw.c:258
clib_error_t * l2_inacl_init(vlib_main_t *vm)
Definition: l2_input_acl.c:374
clib_error_t * l2_efp_filter_init(vlib_main_t *vm)
clib_error_t * l2_invtr_init(vlib_main_t *vm)
Definition: l2_input_vtr.c:296
clib_error_t * l2_classify_init(vlib_main_t *vm)
Definition: l2_classify.c:402
clib_error_t * l2input_init(vlib_main_t *vm)
Definition: l2_input.c:436
clib_error_t * l2_outacl_init(vlib_main_t *vm)
clib_error_t * l2_patch_init(vlib_main_t *vm)
Definition: l2_patch.c:422
clib_error_t * l2flood_init(vlib_main_t *vm)
Definition: l2_flood.c:445

Definition at line 931 of file l2_input.c.

#define foreach_l2input_error
Value:
_(L2INPUT, "L2 input packets") \
_(DROP, "L2 input drops")
DROP
Definition: error.def:41

Definition at line 74 of file l2_input.c.

#define get_u16 (   addr)    ( *((u16 *)(addr)) )
#define get_u32 (   addr)    ( *((u32 *)(addr)) )
#define STATS_IF_LAYER2_BCAST_INPUT_CNT   2
#define STATS_IF_LAYER2_MCAST_INPUT_CNT   1
#define STATS_IF_LAYER2_UCAST_INPUT_CNT   0

Enumeration Type Documentation

Enumerator
L2INPUT_N_ERROR 

Definition at line 78 of file l2_input.c.

Enumerator
L2INPUT_NEXT_LEARN 
L2INPUT_NEXT_FWD 
L2INPUT_NEXT_DROP 
L2INPUT_N_NEXT 

Definition at line 91 of file l2_input.c.

Function Documentation

static_always_inline void classify_and_dispatch ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  cpu_index,
l2input_main_t msm,
vlib_buffer_t b0,
u32 next0 
)

Definition at line 100 of file l2_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 59 of file l2_input.c.

+ Here is the call graph for this function:

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

Definition at line 709 of file l2_input.c.

+ Here is the call graph for this function:

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

Definition at line 772 of file l2_input.c.

+ Here is the call graph for this function:

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

Definition at line 816 of file l2_input.c.

+ Here is the call graph for this function:

clib_error_t* l2_init ( vlib_main_t vm)

Definition at line 949 of file l2_input.c.

+ Here is the caller graph for this function:

char** l2input_get_feat_names ( void  )

Definition at line 45 of file l2_input.c.

+ Here is the caller graph for this function:

clib_error_t* l2input_init ( vlib_main_t vm)

Definition at line 436 of file l2_input.c.

+ Here is the call graph for this function:

u32 l2input_intf_bitmap_enable ( u32  sw_if_index,
u32  feature_bitmap,
u32  enable 
)

Definition at line 473 of file l2_input.c.

+ Here is the caller graph for this function:

l2_input_config_t* l2input_intf_config ( u32  sw_if_index)

Definition at line 464 of file l2_input.c.

+ Here is the caller graph for this function:

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

Definition at line 246 of file l2_input.c.

+ Here is the call graph for this function:

u32 l2input_set_bridge_features ( u32  bd_index,
u32  feat_mask,
u32  feat_value 
)

Definition at line 492 of file l2_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 set_int_l2_mode ( vlib_main_t vm,
vnet_main_t vnet_main,
u32  mode,
u32  sw_if_index,
u32  bd_index,
u32  bvi,
u32  shg,
u32  xc_sw_if_index 
)

Definition at line 509 of file l2_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 851 of file l2_input.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t int_l2_bridge_cli
Initial value:
= {
.path = "set interface l2 bridge",
.short_help = "set interface to L2 bridging mode in <bridge-domain ID> [bvi] [shg]",
.function = int_l2_bridge,
}
static clib_error_t * int_l2_bridge(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_input.c:709

(constructor) VLIB_CLI_COMMAND (int_l2_bridge_cli)

Definition at line 762 of file l2_input.c.

vlib_cli_command_t int_l2_xc_cli
Initial value:
= {
.path = "set interface l2 xconnect",
.short_help = "set interface to L2 cross-connect mode with <peer interface>",
.function = int_l2_xc,
}
static clib_error_t * int_l2_xc(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_input.c:772

(constructor) VLIB_CLI_COMMAND (int_l2_xc_cli)

Definition at line 806 of file l2_input.c.

vlib_cli_command_t int_l3_cli
Initial value:
= {
.path = "set interface l3",
.short_help = "set interface to L3 mode",
.function = int_l3,
}
static clib_error_t * int_l3(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_input.c:816

(constructor) VLIB_CLI_COMMAND (int_l3_cli)

Definition at line 842 of file l2_input.c.

char* l2input_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_l2input_error
Definition: l2_input.c:74

Definition at line 85 of file l2_input.c.

char* l2input_feat_names[]
static
Initial value:
= {
#define _(sym,name)
}

Definition at line 39 of file l2_input.c.

l2input_main_t l2input_main

Definition at line 72 of file l2_input.c.

Initial value:
= {
.function = l2input_node_fn,
.name = "l2-input",
.vector_size = sizeof (u32),
.format_trace = format_l2input_trace,
.error_strings = l2input_error_strings,
.n_next_nodes = L2INPUT_N_NEXT,
.next_nodes = {
[L2INPUT_NEXT_LEARN] = "l2-learn",
[L2INPUT_NEXT_FWD] = "l2-fwd",
[L2INPUT_NEXT_DROP] = "error-drop",
},
}
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:70
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
static uword l2input_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: l2_input.c:246
static u8 * format_l2input_trace(u8 *s, va_list *args)
Definition: l2_input.c:59
static char * l2input_error_strings[]
Definition: l2_input.c:85

(constructor) VLIB_REGISTER_NODE (l2input_node)

Definition at line 415 of file l2_input.c.

vlib_cli_command_t show_l2_mode
Initial value:
= {
.path = "show mode",
.short_help = "show mode [<if-name1> <if-name2> ...]",
.function = show_int_mode,
}
static clib_error_t * show_int_mode(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_input.c:851

(constructor) VLIB_CLI_COMMAND (show_l2_mode)

Definition at line 925 of file l2_input.c.