FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
l2_input.c File Reference

Interface Input Mode (Layer 2 Cross-Connect or Bridge / Layer 3). More...

+ Include dependency graph for l2_input.c:

Go to the source code of this file.

Macros

#define foreach_l2_init_function
 

Functions

char ** l2input_get_feat_names (void)
 Return an array of strings containing graph node names of each feature. More...
 
u8format_l2_input_feature_bitmap (u8 *s, va_list *args)
 
u8format_l2_input_features (u8 *s, va_list *args)
 
u8format_l2_input (u8 *s, va_list *args)
 
clib_error_tl2input_init (vlib_main_t *vm)
 
l2_input_config_tl2input_intf_config (u32 sw_if_index)
 Get a pointer to the config for the given interface. More...
 
u32 l2input_intf_bitmap_enable (u32 sw_if_index, l2input_feat_masks_t feature_bitmap, u32 enable)
 Enable (or disable) the feature in the bitmap for the given interface. More...
 
u32 l2input_set_bridge_features (u32 bd_index, u32 feat_mask, u32 feat_value)
 
void l2input_interface_mac_change (u32 sw_if_index, const u8 *old_address, const u8 *new_address)
 
walk_rc_t l2input_recache (u32 bd_index, u32 sw_if_index)
 
void l2_input_seq_num_inc (u32 sw_if_index)
 
u32 set_int_l2_mode (vlib_main_t *vm, vnet_main_t *vnet_main, u32 mode, u32 sw_if_index, u32 bd_index, l2_bd_port_type_t port_type, u32 shg, u32 xc_sw_if_index)
 Set the subinterface to run in l2 or l3 mode. More...
 
static clib_error_tl2_input_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (l2_input_interface_add_del)
 
static clib_error_tint_l2_bridge (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface in bridging mode with a bridge-domain ID. More...
 
static clib_error_tint_l2_xc (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface in xconnect mode with another interface. More...
 
static clib_error_tint_l3 (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface in L3 mode. More...
 
static clib_error_tshow_int_mode (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Show interface mode. More...
 
clib_error_tl2_init (vlib_main_t *vm)
 

Variables

static char * l2input_feat_names []
 
static vlib_cli_command_t int_l2_bridge_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_bridge_cli) More...
 
static vlib_cli_command_t int_l2_xc_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_xc_cli) More...
 
static vlib_cli_command_t int_l3_cli
 (constructor) VLIB_CLI_COMMAND (int_l3_cli) More...
 
static vlib_cli_command_t show_l2_mode
 (constructor) VLIB_CLI_COMMAND (show_l2_mode) More...
 

Detailed Description

Interface Input Mode (Layer 2 Cross-Connect or Bridge / Layer 3).

This file contains the CLI Commands that modify the input mode of an interface. For interfaces in a Layer 2 cross-connect, all packets received on one interface will be transmitted to the other. For interfaces in a bridge-domain, packets will be forwarded to other interfaces in the same bridge-domain based on destination mac address. For interfaces in Layer 3 mode, the packets will be routed.

Definition in file l2_input.c.

Macro Definition Documentation

◆ foreach_l2_init_function

#define foreach_l2_init_function

Function Documentation

◆ format_l2_input()

u8* format_l2_input ( u8 s,
va_list *  args 
)

Definition at line 118 of file l2_input.c.

+ Here is the call graph for this function:

◆ format_l2_input_feature_bitmap()

u8* format_l2_input_feature_bitmap ( u8 s,
va_list *  args 
)

Definition at line 65 of file l2_input.c.

+ Here is the caller graph for this function:

◆ format_l2_input_features()

u8* format_l2_input_features ( u8 s,
va_list *  args 
)

Definition at line 98 of file l2_input.c.

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

◆ int_l2_bridge()

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

Set subinterface in bridging mode with a bridge-domain ID.

The CLI format is: set interface l2 bridge <interface> <bd> [bvi] [split-horizon-group]

Definition at line 551 of file l2_input.c.

+ Here is the call graph for this function:

◆ int_l2_xc()

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

Set subinterface in xconnect mode with another interface.

The CLI format is: set interface l2 xconnect <interface> <peer interface>

Definition at line 663 of file l2_input.c.

+ Here is the call graph for this function:

◆ int_l3()

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

Set subinterface in L3 mode.

The CLI format is: set interface l3 <interface>

Definition at line 729 of file l2_input.c.

+ Here is the call graph for this function:

◆ l2_init()

clib_error_t* l2_init ( vlib_main_t vm)

Definition at line 907 of file l2_input.c.

◆ l2_input_interface_add_del()

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

Definition at line 521 of file l2_input.c.

+ Here is the call graph for this function:

◆ l2_input_seq_num_inc()

void l2_input_seq_num_inc ( u32  sw_if_index)

Definition at line 238 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_get_feat_names()

char** l2input_get_feat_names ( void  )

Return an array of strings containing graph node names of each feature.

Definition at line 59 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_init()

clib_error_t* l2input_init ( vlib_main_t vm)

Definition at line 142 of file l2_input.c.

+ Here is the call graph for this function:

◆ l2input_interface_mac_change()

void l2input_interface_mac_change ( u32  sw_if_index,
const u8 old_address,
const u8 new_address 
)

Definition at line 201 of file l2_input.c.

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

◆ l2input_intf_bitmap_enable()

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

Enable (or disable) the feature in the bitmap for the given interface.

Definition at line 177 of file l2_input.c.

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

◆ l2input_intf_config()

l2_input_config_t* l2input_intf_config ( u32  sw_if_index)

Get a pointer to the config for the given interface.

Masks for eliminating features that do not apply to a packet.

Definition at line 167 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_recache()

walk_rc_t l2input_recache ( u32  bd_index,
u32  sw_if_index 
)

Definition at line 222 of file l2_input.c.

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

◆ l2input_set_bridge_features()

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

Definition at line 191 of file l2_input.c.

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

◆ set_int_l2_mode()

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

Set the subinterface to run in l2 or l3 mode.

For L3 mode, just the sw_if_index is specified. For bridged mode, the bd id and bvi flag are also specified. For xconnect mode, the peer sw_if_index is also specified. Return 0 if ok, or non-0 if there was an error.

Definition at line 256 of file l2_input.c.

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

◆ show_int_mode()

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

Show interface mode.

The CLI format is: show mode [<if-name1> <if-name2> ...]

Definition at line 779 of file l2_input.c.

+ Here is the call graph for this function:

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( l2_input_interface_add_del  )

Variable Documentation

◆ int_l2_bridge_cli

vlib_cli_command_t int_l2_bridge_cli
static
Initial value:
= {
.path = "set interface l2 bridge",
.short_help = "set interface l2 bridge <interface> <bridge-domain-id> [bvi|uu-fwd] [shg]",
.function = int_l2_bridge,
}

(constructor) VLIB_CLI_COMMAND (int_l2_bridge_cli)

Definition at line 650 of file l2_input.c.

◆ int_l2_xc_cli

vlib_cli_command_t int_l2_xc_cli
static
Initial value:
= {
.path = "set interface l2 xconnect",
.short_help = "set interface l2 xconnect <interface> <peer interface>",
.function = int_l2_xc,
}

(constructor) VLIB_CLI_COMMAND (int_l2_xc_cli)

Definition at line 716 of file l2_input.c.

◆ int_l3_cli

vlib_cli_command_t int_l3_cli
static
Initial value:
= {
.path = "set interface l3",
.short_help = "set interface l3 <interface>",
.function = int_l3,
}

(constructor) VLIB_CLI_COMMAND (int_l3_cli)

Definition at line 766 of file l2_input.c.

◆ l2input_feat_names

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

Definition at line 52 of file l2_input.c.

◆ show_l2_mode

vlib_cli_command_t show_l2_mode
static
Initial value:
= {
.path = "show mode",
.short_help = "show mode [<if-name1> <if-name2> ...]",
.function = show_int_mode,
}

(constructor) VLIB_CLI_COMMAND (show_l2_mode)

Definition at line 882 of file l2_input.c.

l2_patch_init
static clib_error_t * l2_patch_init(vlib_main_t *vm)
Definition: l2_patch.c:433
int_l2_bridge
static clib_error_t * int_l2_bridge(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface in bridging mode with a bridge-domain ID.
Definition: l2_input.c:551
l2flood_init
clib_error_t * l2flood_init(vlib_main_t *vm)
Definition: l2_flood.c:387
l2fwd_init
clib_error_t * l2fwd_init(vlib_main_t *vm)
Definition: l2_fwd.c:440
int_l3
static clib_error_t * int_l3(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface in L3 mode.
Definition: l2_input.c:729
l2bd_init
clib_error_t * l2bd_init(vlib_main_t *vm)
Definition: l2_bd.c:232
l2input_init
clib_error_t * l2input_init(vlib_main_t *vm)
Definition: l2_input.c:142
l2fib_init
clib_error_t * l2fib_init(vlib_main_t *vm)
Definition: l2_fib.c:1382
l2_efp_filter_init
clib_error_t * l2_efp_filter_init(vlib_main_t *vm)
Definition: l2_efp_filter.c:483
foreach_l2input_feat
#define foreach_l2input_feat
Definition: l2_input.h:130
l2_xcrw_init
clib_error_t * l2_xcrw_init(vlib_main_t *vm)
Definition: l2_xcrw.c:262
show_int_mode
static clib_error_t * show_int_mode(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Show interface mode.
Definition: l2_input.c:779
l2_invtr_init
clib_error_t * l2_invtr_init(vlib_main_t *vm)
Definition: l2_input_vtr.c:343
l2_input_classify_init
clib_error_t * l2_input_classify_init(vlib_main_t *vm)
l2 input classsifier feature initialization.
Definition: l2_input_classify.c:474
l2_in_out_acl_init
clib_error_t * l2_in_out_acl_init(vlib_main_t *vm)
Definition: l2_in_out_acl.c:506
l2learn_init
clib_error_t * l2learn_init(vlib_main_t *vm)
Definition: l2_learn.c:464
feat_bitmap_drop_init
clib_error_t * feat_bitmap_drop_init(vlib_main_t *vm)
Definition: feat_bitmap.c:151
l2_vtr_init
clib_error_t * l2_vtr_init(vlib_main_t *vm)
Just a placeholder; ensures file is not eliminated by linker.
Definition: l2_vtr.c:46
l2output_init
static clib_error_t * l2output_init(vlib_main_t *vm)
Definition: l2_output.c:570
int_l2_xc
static clib_error_t * int_l2_xc(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface in xconnect mode with another interface.
Definition: l2_input.c:663