FD.io VPP  v19.08.3-2-gbabecb413
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...
 
VLIB_NODE_FN() l2_efp_filter_node (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, u8 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 char * l2_efp_filter_error_strings []
 
vlib_node_registration_t l2_efp_filter_node
 (constructor) VLIB_REGISTER_NODE (l2_efp_filter_node) More...
 
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

◆ foreach_l2_efp_filter_error

#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 90 of file l2_efp_filter.c.

Enumeration Type Documentation

◆ l2_efp_filter_error_t

Enumerator
L2_EFP_FILTER_N_ERROR 

Definition at line 94 of file l2_efp_filter.c.

◆ l2_efp_filter_next_t

Enumerator
L2_EFP_FILTER_NEXT_DROP 
L2_EFP_FILTER_N_NEXT 

Definition at line 108 of file l2_efp_filter.c.

Function Documentation

◆ extract_keys()

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 120 of file l2_efp_filter.c.

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

◆ format_l2_efp_filter_trace()

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:

◆ 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 
)
static

Set subinterface egress efp filter enable/disable.

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

Definition at line 518 of file l2_efp_filter.c.

+ Here is the call graph for this function:

◆ l2_efp_filter_configure()

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

Enable/disable the EFP Filter check on the subinterface.

Definition at line 505 of file l2_efp_filter.c.

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

◆ l2_efp_filter_init()

clib_error_t* l2_efp_filter_init ( vlib_main_t vm)

Definition at line 483 of file l2_efp_filter.c.

+ Here is the call graph for this function:

◆ l2_efp_filter_node()

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

Definition at line 175 of file l2_efp_filter.c.

+ Here is the call graph for this function:

Variable Documentation

◆ int_l2_efp_filter_cli

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 561 of file l2_efp_filter.c.

◆ l2_efp_filter_error_strings

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

Definition at line 102 of file l2_efp_filter.c.

◆ l2_efp_filter_main

l2_efp_filter_main_t l2_efp_filter_main

Definition at line 87 of file l2_efp_filter.c.

◆ l2_efp_filter_node

vlib_node_registration_t l2_efp_filter_node
Initial value:
= {
.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
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * l2_efp_filter_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:63

(constructor) VLIB_REGISTER_NODE (l2_efp_filter_node)

Definition at line 463 of file l2_efp_filter.c.