FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Ethernet Bridge Learning. More...
Go to the source code of this file.
Data Structures | |
struct | l2learn_trace_t |
Macros | |
#define | foreach_l2learn_error |
Enumerations | |
enum | l2learn_error_t { L2LEARN_N_ERROR } |
enum | l2learn_next_t { L2LEARN_NEXT_L2FWD, L2LEARN_NEXT_DROP, L2LEARN_N_NEXT } |
Functions | |
static u8 * | format_l2learn_trace (u8 *s, va_list *args) |
static_always_inline void | l2learn_process (vlib_node_runtime_t *node, l2learn_main_t *msm, u64 *counter_base, vlib_buffer_t *b0, u32 sw_if_index0, l2fib_entry_key_t *key0, l2fib_entry_key_t *cached_key, u32 *count, l2fib_entry_result_t *result0, u16 *next0, u8 timestamp) |
Perform learning on one packet based on the mac table lookup result. More... | |
static_always_inline uword | l2learn_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int do_trace) |
VLIB_NODE_FN() | l2learn_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) |
clib_error_t * | l2learn_init (vlib_main_t *vm) |
static clib_error_t * | int_learn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) |
Set subinterface learn enable/disable. More... | |
static clib_error_t * | l2learn_config (vlib_main_t *vm, unformat_input_t *input) |
Variables | |
l2learn_main_t | l2learn_main |
vlib_node_registration_t | l2learn_node |
(constructor) VLIB_REGISTER_NODE (l2learn_node) More... | |
static char * | l2learn_error_strings [] |
static vlib_cli_command_t | int_learn_cli |
(constructor) VLIB_CLI_COMMAND (int_learn_cli) More... | |
Ethernet Bridge Learning.
Populate the mac table with entries mapping the packet's source mac + bridge domain ID to the input sw_if_index.
Note that learning and forwarding are separate graph nodes. This means that for a set of packets, all learning is performed first, then all nodes are forwarded. The forwarding is done based on the end-state of the mac table, instead of the state after each packet. Thus the forwarding results could differ in certain cases (mac move tests), but this not expected to cause problems in real-world networks. It is much simpler to separate learning and forwarding into separate nodes.
Definition in file l2_learn.c.
#define foreach_l2learn_error |
Definition at line 78 of file l2_learn.c.
enum l2learn_error_t |
Enumerator | |
---|---|
L2LEARN_N_ERROR |
Definition at line 87 of file l2_learn.c.
enum l2learn_next_t |
Enumerator | |
---|---|
L2LEARN_NEXT_L2FWD | |
L2LEARN_NEXT_DROP | |
L2LEARN_N_NEXT |
Definition at line 101 of file l2_learn.c.
|
static |
Set subinterface learn enable/disable.
The CLI format is: set interface l2 learn <interface> [disable]
Definition at line 504 of file l2_learn.c.
|
static |
clib_error_t* l2learn_init | ( | vlib_main_t * | vm | ) |
VLIB_NODE_FN() l2learn_node | ( | vlib_main_t * | vm, |
vlib_node_runtime_t * | node, | ||
vlib_frame_t * | frame | ||
) |
static_always_inline uword l2learn_node_inline | ( | vlib_main_t * | vm, |
vlib_node_runtime_t * | node, | ||
vlib_frame_t * | frame, | ||
int | do_trace | ||
) |
Definition at line 254 of file l2_learn.c.
static_always_inline void l2learn_process | ( | vlib_node_runtime_t * | node, |
l2learn_main_t * | msm, | ||
u64 * | counter_base, | ||
vlib_buffer_t * | b0, | ||
u32 | sw_if_index0, | ||
l2fib_entry_key_t * | key0, | ||
l2fib_entry_key_t * | cached_key, | ||
u32 * | count, | ||
l2fib_entry_result_t * | result0, | ||
u16 * | next0, | ||
u8 | timestamp | ||
) |
Perform learning on one packet based on the mac table lookup result.
Definition at line 112 of file l2_learn.c.
|
static |
(constructor) VLIB_CLI_COMMAND (int_learn_cli)
Definition at line 544 of file l2_learn.c.
|
static |
Definition at line 95 of file l2_learn.c.
l2learn_main_t l2learn_main |
Definition at line 32 of file l2_learn.c.
vlib_node_registration_t l2learn_node |
(constructor) VLIB_REGISTER_NODE (l2learn_node)
Definition at line 443 of file l2_learn.c.