FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
l2_efp_filter.c File Reference

EFP-filter - Ethernet Flow Point Filter. More...

+ Include dependency graph for l2_efp_filter.c:

Go to the source code of this file.

Data Structures

struct  l2_efp_filter_main_t
 
struct  l2_efp_filter_trace_t
 

Macros

#define foreach_l2_efp_filter_error
 

Enumerations

enum  l2_efp_filter_error_t { L2_EFP_FILTER_N_ERROR }
 
enum  l2_efp_filter_next_t { L2_EFP_FILTER_NEXT_DROP, L2_EFP_FILTER_N_NEXT }
 

Functions

static u8format_l2_efp_filter_trace (u8 *s, va_list *args)
 
static_always_inline void extract_keys (vnet_main_t *vnet_main, u32 sw_if_index0, vlib_buffer_t *b0, u32 *port_sw_if_index0, u16 *first_ethertype0, u16 *outer_id0, u16 *inner_id0, u32 *match_flags0)
 Extract fields from the packet that will be used in interface classification. More...
 
static uword l2_efp_filter_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tl2_efp_filter_init (vlib_main_t *vm)
 
void l2_efp_filter_configure (vnet_main_t *vnet_main, u32 sw_if_index, u32 enable)
 Enable/disable the EFP Filter check on the subinterface. More...
 
static clib_error_tint_l2_efp_filter (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface egress efp filter enable/disable. More...
 

Variables

l2_efp_filter_main_t l2_efp_filter_main
 
static vlib_node_registration_t l2_efp_filter_node
 (constructor) VLIB_REGISTER_NODE (l2_efp_filter_node) More...
 
static char * l2_efp_filter_error_strings []
 
static vlib_cli_command_t int_l2_efp_filter_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_efp_filter_cli) More...
 

Detailed Description

EFP-filter - Ethernet Flow Point Filter.

It is possible to transmit a packet out a subinterface with VLAN tags that are not compatible with that subinterface. In other words, if that packet arrived on the output port, it would not be classified as coming from the output subinterface. This can happen in various ways: through misconfiguration, by putting subinterfaces with different VLAN encaps in the same bridge-domain, etc. The EFP Filter Check detects such packets and drops them. It consists of two checks, one that verifies the packet prior to output VLAN tag rewrite and one that verifies the packet after VLAN tag rewrite.

Definition in file l2_efp_filter.c.

Macro Definition Documentation

#define foreach_l2_efp_filter_error
Value:
_(L2_EFP_FILTER, "L2 EFP filter packets") \
_(DROP, "L2 EFP filter post-rewrite drops")
DROP
Definition: error.def:41

Definition at line 88 of file l2_efp_filter.c.

Enumeration Type Documentation

Enumerator
L2_EFP_FILTER_N_ERROR 

Definition at line 92 of file l2_efp_filter.c.

Enumerator
L2_EFP_FILTER_NEXT_DROP 
L2_EFP_FILTER_N_NEXT 

Definition at line 106 of file l2_efp_filter.c.

Function Documentation

static_always_inline void extract_keys ( vnet_main_t vnet_main,
u32  sw_if_index0,
vlib_buffer_t b0,
u32 port_sw_if_index0,
u16 first_ethertype0,
u16 outer_id0,
u16 inner_id0,
u32 match_flags0 
)

Extract fields from the packet that will be used in interface classification.

Definition at line 118 of file l2_efp_filter.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 67 of file l2_efp_filter.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Set subinterface egress efp filter enable/disable.

The CLI format is: set interface l2 efp-filter <interface> [disable]]

Definition at line 554 of file l2_efp_filter.c.

+ Here is the call graph for this function:

void l2_efp_filter_configure ( vnet_main_t vnet_main,
u32  sw_if_index,
u32  enable 
)

Enable/disable the EFP Filter check on the subinterface.

Definition at line 541 of file l2_efp_filter.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* l2_efp_filter_init ( vlib_main_t vm)

Definition at line 519 of file l2_efp_filter.c.

+ Here is the call graph for this function:

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

Definition at line 174 of file l2_efp_filter.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t int_l2_efp_filter_cli
static
Initial value:
= {
.path = "set interface l2 efp-filter",
.short_help = "set interface l2 efp-filter <interface> [disable]",
.function = int_l2_efp_filter,
}
static clib_error_t * int_l2_efp_filter(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface egress efp filter enable/disable.

(constructor) VLIB_CLI_COMMAND (int_l2_efp_filter_cli)

Definition at line 597 of file l2_efp_filter.c.

char* l2_efp_filter_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_l2_efp_filter_error
Definition: l2_efp_filter.c:88

Definition at line 100 of file l2_efp_filter.c.

l2_efp_filter_main_t l2_efp_filter_main

Definition at line 84 of file l2_efp_filter.c.

static vlib_node_registration_t l2_efp_filter_node
static
Initial value:
= {
.function = l2_efp_filter_node_fn,
.name = "l2-efp-filter",
.vector_size = sizeof (u32),
.format_trace = format_l2_efp_filter_trace,
.error_strings = l2_efp_filter_error_strings,
.n_next_nodes = L2_EFP_FILTER_N_NEXT,
.next_nodes = {
[L2_EFP_FILTER_NEXT_DROP] = "error-drop",
},
}
static u8 * format_l2_efp_filter_trace(u8 *s, va_list *args)
Definition: l2_efp_filter.c:67
static char * l2_efp_filter_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
static uword l2_efp_filter_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (l2_efp_filter_node)

Definition at line 86 of file l2_efp_filter.c.