FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
l2_fib.c File Reference

Ethernet MAC Address FIB Table Management. More...

+ Include dependency graph for l2_fib.c:

Go to the source code of this file.

Data Structures

struct  l2fib_main_t
 

Functions

u8format_vnet_sw_if_index_name_with_NA (u8 *s, va_list *args)
 Format sw_if_index. More...
 
void l2fib_table_dump (u32 bd_index, l2fib_entry_key_t **l2fe_key, l2fib_entry_result_t **l2fe_res)
 
static clib_error_tshow_l2fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Display the contents of the l2fib. More...
 
void l2fib_clear_table (uint keep_static)
 
static clib_error_tclear_l2fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Clear all entries in L2FIB. More...
 
void l2fib_add_entry (u64 mac, u32 bd_index, u32 sw_if_index, u32 static_mac, u32 filter_mac, u32 bvi_mac)
 Add an entry to the l2fib. More...
 
static clib_error_tl2fib_add (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Add an entry to the L2FIB. More...
 
static clib_error_tl2fib_test_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
u32 l2fib_del_entry (u64 mac, u32 bd_index)
 Delete an entry from the l2fib. More...
 
static clib_error_tl2fib_del (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Delete an entry from the L2FIB. More...
 
 BVT (clib_bihash)
 
static uword l2fib_mac_age_scanner_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
clib_error_tl2fib_init (vlib_main_t *vm)
 

Variables

l2fib_main_t l2fib_main
 
static vlib_cli_command_t show_l2fib_cli
 (constructor) VLIB_CLI_COMMAND (show_l2fib_cli) More...
 
static vlib_cli_command_t clear_l2fib_cli
 (constructor) VLIB_CLI_COMMAND (clear_l2fib_cli) More...
 
static vlib_cli_command_t l2fib_add_cli
 (constructor) VLIB_CLI_COMMAND (l2fib_add_cli) More...
 
static vlib_cli_command_t l2fib_test_command
 (constructor) VLIB_CLI_COMMAND (l2fib_test_command) More...
 
static vlib_cli_command_t l2fib_del_cli
 (constructor) VLIB_CLI_COMMAND (l2fib_del_cli) More...
 
vlib_node_registration_t l2fib_mac_age_scanner_process_node
 (constructor) VLIB_REGISTER_NODE (l2fib_mac_age_scanner_process_node) More...
 

Detailed Description

Ethernet MAC Address FIB Table Management.

The MAC Address forwarding table for bridge-domains is called the l2fib. Entries are added automatically as part of mac learning, but MAC Addresses entries can also be added manually.

Definition in file l2_fib.c.

Function Documentation

BVT ( clib_bihash  )

Definition at line 707 of file l2_fib.c.

+ Here is the caller graph for this function:

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

Clear all entries in L2FIB.

: Later we may want a way to remove only the non-static entries

Definition at line 282 of file l2_fib.c.

+ Here is the call graph for this function:

u8* format_vnet_sw_if_index_name_with_NA ( u8 s,
va_list *  args 
)

Format sw_if_index.

If the value is ~0, use the text "N/A"

Definition at line 60 of file l2_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Add an entry to the L2FIB.

The CLI format is: l2fib add <mac> <bd> <intf> [static] [bvi] l2fib add <mac> <bd> filter Note that filter and bvi entries are always static

Definition at line 354 of file l2_fib.c.

+ Here is the call graph for this function:

void l2fib_add_entry ( u64  mac,
u32  bd_index,
u32  sw_if_index,
u32  static_mac,
u32  filter_mac,
u32  bvi_mac 
)

Add an entry to the l2fib.

If the entry already exists then overwrite it

Definition at line 314 of file l2_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void l2fib_clear_table ( uint  keep_static)

Definition at line 259 of file l2_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Delete an entry from the L2FIB.

The CLI format is: l2fib del <mac> <bd-id>

Definition at line 647 of file l2_fib.c.

+ Here is the call graph for this function:

u32 l2fib_del_entry ( u64  mac,
u32  bd_index 
)

Delete an entry from the l2fib.

Return 0 if the entry was deleted, or 1 if it was not found

Definition at line 612 of file l2_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* l2fib_init ( vlib_main_t vm)

Definition at line 825 of file l2_fib.c.

+ Here is the call graph for this function:

static uword l2fib_mac_age_scanner_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 714 of file l2_fib.c.

+ Here is the call graph for this function:

void l2fib_table_dump ( u32  bd_index,
l2fib_entry_key_t **  l2fe_key,
l2fib_entry_result_t **  l2fe_res 
)

Definition at line 73 of file l2_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 462 of file l2_fib.c.

+ Here is the call graph for this function:

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

Display the contents of the l2fib.

Definition at line 113 of file l2_fib.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t clear_l2fib_cli
static
Initial value:
= {
.path = "clear l2fib",
.short_help = "clear l2fib",
.function = clear_l2fib,
}
static clib_error_t * clear_l2fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Clear all entries in L2FIB.
Definition: l2_fib.c:282

(constructor) VLIB_CLI_COMMAND (clear_l2fib_cli)

Definition at line 301 of file l2_fib.c.

vlib_cli_command_t l2fib_add_cli
static
Initial value:
= {
.path = "l2fib add",
.short_help = "l2fib add <mac> <bridge-domain-id> filter | <intf> [static | bvi]",
.function = l2fib_add,
}
static clib_error_t * l2fib_add(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Add an entry to the L2FIB.
Definition: l2_fib.c:354

(constructor) VLIB_CLI_COMMAND (l2fib_add_cli)

Definition at line 453 of file l2_fib.c.

vlib_cli_command_t l2fib_del_cli
static
Initial value:
= {
.path = "l2fib del",
.short_help = "l2fib del <mac> <bridge-domain-id>",
.function = l2fib_del,
}
static clib_error_t * l2fib_del(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Delete an entry from the L2FIB.
Definition: l2_fib.c:647

(constructor) VLIB_CLI_COMMAND (l2fib_del_cli)

Definition at line 699 of file l2_fib.c.

vlib_node_registration_t l2fib_mac_age_scanner_process_node
Initial value:
= {
.name = "l2fib-mac-age-scanner-process",
}
static uword l2fib_mac_age_scanner_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: l2_fib.c:714

(constructor) VLIB_REGISTER_NODE (l2fib_mac_age_scanner_process_node)

Definition at line 817 of file l2_fib.c.

l2fib_main_t l2fib_main

Definition at line 55 of file l2_fib.c.

vlib_cli_command_t l2fib_test_command
static
Initial value:
= {
.path = "test l2fib",
.short_help = "test l2fib [add|del|check] mac <base-addr> count <nn>",
.function = l2fib_test_command_fn,
}
static clib_error_t * l2fib_test_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_fib.c:462

(constructor) VLIB_CLI_COMMAND (l2fib_test_command)

Definition at line 599 of file l2_fib.c.

vlib_cli_command_t show_l2fib_cli
static
Initial value:
= {
.path = "show l2fib",
.short_help = "show l2fib [verbose | bd_id <nn> | bd_index <nn> | raw]",
.function = show_l2fib,
}
static clib_error_t * show_l2fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Display the contents of the l2fib.
Definition: l2_fib.c:113

(constructor) VLIB_CLI_COMMAND (show_l2fib_cli)

Definition at line 249 of file l2_fib.c.