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

Ethernet Flooding. More...

+ Include dependency graph for l2_flood.c:

Go to the source code of this file.

Data Structures

struct  l2flood_main_t
 
struct  l2flood_trace_t
 

Macros

#define foreach_l2flood_error
 

Enumerations

enum  l2flood_error_t { L2FLOOD_N_ERROR }
 
enum  l2flood_next_t { L2FLOOD_NEXT_L2_OUTPUT, L2FLOOD_NEXT_DROP, L2FLOOD_N_NEXT }
 

Functions

static u8format_l2flood_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() l2flood_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tl2flood_init (vlib_main_t *vm)
 
void l2flood_register_input_type (vlib_main_t *vm, ethernet_type_t type, u32 node_index)
 Add the L3 input node for this ethertype to the next nodes structure. More...
 
static clib_error_tint_flood (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface flood enable/disable. More...
 

Variables

l2flood_main_t l2flood_main
 
static char * l2flood_error_strings []
 
vlib_node_registration_t l2flood_node
 (constructor) VLIB_REGISTER_NODE (l2flood_node) More...
 
static vlib_cli_command_t int_flood_cli
 (constructor) VLIB_CLI_COMMAND (int_flood_cli) More...
 

Detailed Description

Ethernet Flooding.

Flooding uses the packet replication infrastructure to send a copy of the packet to each member interface. Logically the replication infrastructure expects two graph nodes: a prep node that initiates replication and sends the packet to the first destination, and a recycle node that is passed the packet after it has been transmitted.

To decrease the amount of code, l2 flooding implements both functions in the same graph node. This node can tell if is it being called as the "prep" or "recycle" using replication_is_recycled().

Definition in file l2_flood.c.

Macro Definition Documentation

◆ foreach_l2flood_error

#define foreach_l2flood_error
Value:
_(L2FLOOD, "L2 flood packets") \
_(REPL_FAIL, "L2 replication failures") \
_(NO_MEMBERS, "L2 replication complete") \
_(BVI_BAD_MAC, "BVI L3 mac mismatch") \
_(BVI_ETHERTYPE, "BVI packet with unhandled ethertype")

Definition at line 95 of file l2_flood.c.

Enumeration Type Documentation

◆ l2flood_error_t

Enumerator
L2FLOOD_N_ERROR 

Definition at line 102 of file l2_flood.c.

◆ l2flood_next_t

Enumerator
L2FLOOD_NEXT_L2_OUTPUT 
L2FLOOD_NEXT_DROP 
L2FLOOD_N_NEXT 

Definition at line 116 of file l2_flood.c.

Function Documentation

◆ format_l2flood_trace()

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

Definition at line 76 of file l2_flood.c.

+ Here is the call graph for this function:

◆ int_flood()

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

Set subinterface flood enable/disable.

The CLI format is: set interface l2 flood <interface> [disable]

Definition at line 432 of file l2_flood.c.

+ Here is the call graph for this function:

◆ l2flood_init()

clib_error_t* l2flood_init ( vlib_main_t vm)

Definition at line 387 of file l2_flood.c.

+ Here is the call graph for this function:

◆ l2flood_node()

VLIB_NODE_FN() l2flood_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 138 of file l2_flood.c.

+ Here is the call graph for this function:

◆ l2flood_register_input_type()

void l2flood_register_input_type ( vlib_main_t vm,
ethernet_type_t  type,
u32  node_index 
)

Add the L3 input node for this ethertype to the next nodes structure.

Definition at line 413 of file l2_flood.c.

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

Variable Documentation

◆ int_flood_cli

vlib_cli_command_t int_flood_cli
static
Initial value:
= {
.path = "set interface l2 flood",
.short_help = "set interface l2 flood <interface> [disable]",
.function = int_flood,
}

(constructor) VLIB_CLI_COMMAND (int_flood_cli)

Definition at line 472 of file l2_flood.c.

◆ l2flood_error_strings

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

Definition at line 110 of file l2_flood.c.

◆ l2flood_main

l2flood_main_t l2flood_main

Definition at line 92 of file l2_flood.c.

◆ l2flood_node

Initial value:
= {
.name = "l2-flood",
.vector_size = sizeof (u32),
.format_trace = format_l2flood_trace,
.error_strings = l2flood_error_strings,
.n_next_nodes = L2FLOOD_N_NEXT,
.next_nodes = {
[L2FLOOD_NEXT_L2_OUTPUT] = "l2-output",
[L2FLOOD_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (l2flood_node)

Definition at line 366 of file l2_flood.c.

L2FLOOD_NEXT_DROP
@ L2FLOOD_NEXT_DROP
Definition: l2_flood.c:119
foreach_l2flood_error
#define foreach_l2flood_error
Definition: l2_flood.c:95
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
L2FLOOD_N_NEXT
@ L2FLOOD_N_NEXT
Definition: l2_flood.c:120
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
int_flood
static clib_error_t * int_flood(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface flood enable/disable.
Definition: l2_flood.c:432
format_l2flood_trace
static u8 * format_l2flood_trace(u8 *s, va_list *args)
Definition: l2_flood.c:76
u32
unsigned int u32
Definition: types.h:88
l2flood_error_strings
static char * l2flood_error_strings[]
Definition: l2_flood.c:110
L2FLOOD_NEXT_L2_OUTPUT
@ L2FLOOD_NEXT_L2_OUTPUT
Definition: l2_flood.c:118
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123