FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
l2_input.h File Reference
+ Include dependency graph for l2_input.h:

Go to the source code of this file.

Data Structures

struct  l2_input_config_t
 
struct  l2input_main_t
 

Macros

#define L2INPUT_BVI   ((u32) (~0-1))
 
#define foreach_l2input_feat
 
#define MODE_L3   0
 
#define MODE_L2_BRIDGE   1
 
#define MODE_L2_XC   2
 
#define MODE_L2_CLASSIFY   3
 
#define MODE_ERROR_ETH   1
 
#define MODE_ERROR_BVI_DEF   2
 

Typedefs

typedef enum l2_input_flags_t_ l2_input_flags_t
 

Enumerations

enum  l2_input_flags_t_ { L2_INPUT_FLAG_NONE = 0, L2_INPUT_FLAG_XCONNECT = (1 << 0), L2_INPUT_FLAG_BRIDGE = (1 << 1), L2_INPUT_FLAG_BVI = (1 << 2) }
 
enum  l2input_feat_t { L2INPUT_N_FEAT }
 
enum  l2input_feat_masks_t { L2INPUT_FEAT_NONE = 0, L2INPUT_VALID_MASK }
 

Functions

 STATIC_ASSERT_SIZEOF (l2_input_config_t, 2 *sizeof(u64))
 
static_always_inline l2_bridge_domain_tl2input_bd_config_from_index (l2input_main_t *l2im, u32 bd_index)
 
static_always_inline l2_bridge_domain_tl2input_bd_config (u32 bd_index)
 
 STATIC_ASSERT (L2INPUT_N_FEAT<=32, "too many l2 input features")
 
 STATIC_ASSERT ((u64) L2INPUT_VALID_MASK==(1ull<< L2INPUT_N_FEAT) - 1, "")
 
char ** l2input_get_feat_names (void)
 Return an array of strings containing graph node names of each feature. More...
 
u8format_l2_input_feature_bitmap (u8 *s, va_list *args)
 
u8format_l2_input_features (u8 *s, va_list *args)
 
u8format_l2_input (u8 *s, va_list *args)
 
static_always_inline u8 bd_feature_flood (l2_bridge_domain_t *bd_config)
 
static_always_inline u8 bd_feature_uu_flood (l2_bridge_domain_t *bd_config)
 
static_always_inline u8 bd_feature_forward (l2_bridge_domain_t *bd_config)
 
static_always_inline u8 bd_feature_learn (l2_bridge_domain_t *bd_config)
 
static_always_inline u8 bd_feature_arp_term (l2_bridge_domain_t *bd_config)
 
static_always_inline u8 bd_feature_arp_ufwd (l2_bridge_domain_t *bd_config)
 
static bool l2_input_is_bridge (const l2_input_config_t *input)
 
static bool l2_input_is_xconnect (const l2_input_config_t *input)
 
static bool l2_input_is_bvi (const l2_input_config_t *input)
 
static_always_inline u8 l2_input_seq_num (u32 sw_if_index)
 
l2_input_config_tl2input_intf_config (u32 sw_if_index)
 Masks for eliminating features that do not apply to a packet. More...
 
u32 l2input_intf_bitmap_enable (u32 sw_if_index, l2input_feat_masks_t feature_bitmap, u32 enable)
 Enable (or disable) the feature in the bitmap for the given interface. More...
 
u32 l2input_set_bridge_features (u32 bd_index, u32 feat_mask, u32 feat_value)
 
void l2input_interface_mac_change (u32 sw_if_index, const u8 *old_address, const u8 *new_address)
 
void l2_input_seq_num_inc (u32 sw_if_index)
 
walk_rc_t l2input_recache (u32 bd_index, u32 sw_if_index)
 
u32 set_int_l2_mode (vlib_main_t *vm, vnet_main_t *vnet_main, u32 mode, u32 sw_if_index, u32 bd_index, l2_bd_port_type_t port_type, u32 shg, u32 xc_sw_if_index)
 Set the subinterface to run in l2 or l3 mode. More...
 
static u16 vnet_update_l2_len (vlib_buffer_t *b)
 
static u32 vnet_l2_compute_flow_hash (vlib_buffer_t *b)
 

Variables

l2input_main_t l2input_main
 
vlib_node_registration_t l2input_node
 (constructor) VLIB_REGISTER_NODE (l2input_node) More...
 

Macro Definition Documentation

◆ foreach_l2input_feat

#define foreach_l2input_feat
Value:
_(DROP, "feature-bitmap-drop") \
_(XCONNECT, "l2-output") \
_(FLOOD, "l2-flood") \
_(ARP_UFWD, "l2-uu-fwd") \
_(ARP_TERM, "arp-term-l2bd") \
_(UU_FLOOD, "l2-flood") \
_(GBP_FWD, "gbp-fwd") \
_(UU_FWD, "l2-uu-fwd") \
_(FWD, "l2-fwd") \
_(RW, "l2-rw") \
_(LEARN, "l2-learn") \
_(L2_EMULATION, "l2-emulation") \
_(GBP_LEARN, "gbp-learn-l2") \
_(GBP_LPM_ANON_CLASSIFY, "l2-gbp-lpm-anon-classify") \
_(GBP_NULL_CLASSIFY, "gbp-null-classify") \
_(GBP_SRC_CLASSIFY, "gbp-src-classify") \
_(GBP_LPM_CLASSIFY, "l2-gbp-lpm-classify") \
_(VTR, "l2-input-vtr") \
_(L2_IP_QOS_RECORD, "l2-ip-qos-record") \
_(VPATH, "vpath-input-l2") \
_(ACL, "l2-input-acl") \
_(POLICER_CLAS, "l2-policer-classify") \
_(INPUT_FEAT_ARC, "l2-input-feat-arc") \
_(INPUT_CLASSIFY, "l2-input-classify") \
_(SPAN, "span-l2-input")

Definition at line 132 of file l2_input.h.

◆ L2INPUT_BVI

#define L2INPUT_BVI   ((u32) (~0-1))

Definition at line 127 of file l2_input.h.

◆ MODE_ERROR_BVI_DEF

#define MODE_ERROR_BVI_DEF   2

Definition at line 290 of file l2_input.h.

◆ MODE_ERROR_ETH

#define MODE_ERROR_ETH   1

Definition at line 289 of file l2_input.h.

◆ MODE_L2_BRIDGE

#define MODE_L2_BRIDGE   1

Definition at line 285 of file l2_input.h.

◆ MODE_L2_CLASSIFY

#define MODE_L2_CLASSIFY   3

Definition at line 287 of file l2_input.h.

◆ MODE_L2_XC

#define MODE_L2_XC   2

Definition at line 286 of file l2_input.h.

◆ MODE_L3

#define MODE_L3   0

Definition at line 284 of file l2_input.h.

Typedef Documentation

◆ l2_input_flags_t

Enumeration Type Documentation

◆ l2_input_flags_t_

Enumerator
L2_INPUT_FLAG_NONE 
L2_INPUT_FLAG_XCONNECT 
L2_INPUT_FLAG_BRIDGE 
L2_INPUT_FLAG_BVI 

Definition at line 32 of file l2_input.h.

◆ l2input_feat_masks_t

Enumerator
L2INPUT_FEAT_NONE 
L2INPUT_VALID_MASK 

Definition at line 171 of file l2_input.h.

◆ l2input_feat_t

Enumerator
L2INPUT_N_FEAT 

Definition at line 160 of file l2_input.h.

Function Documentation

◆ bd_feature_arp_term()

static_always_inline u8 bd_feature_arp_term ( l2_bridge_domain_t bd_config)

Definition at line 222 of file l2_input.h.

+ Here is the caller graph for this function:

◆ bd_feature_arp_ufwd()

static_always_inline u8 bd_feature_arp_ufwd ( l2_bridge_domain_t bd_config)

Definition at line 229 of file l2_input.h.

+ Here is the caller graph for this function:

◆ bd_feature_flood()

static_always_inline u8 bd_feature_flood ( l2_bridge_domain_t bd_config)

Definition at line 195 of file l2_input.h.

+ Here is the caller graph for this function:

◆ bd_feature_forward()

static_always_inline u8 bd_feature_forward ( l2_bridge_domain_t bd_config)

Definition at line 209 of file l2_input.h.

+ Here is the caller graph for this function:

◆ bd_feature_learn()

static_always_inline u8 bd_feature_learn ( l2_bridge_domain_t bd_config)

Definition at line 215 of file l2_input.h.

+ Here is the caller graph for this function:

◆ bd_feature_uu_flood()

static_always_inline u8 bd_feature_uu_flood ( l2_bridge_domain_t bd_config)

Definition at line 202 of file l2_input.h.

+ Here is the caller graph for this function:

◆ format_l2_input()

u8* format_l2_input ( u8 s,
va_list *  args 
)

Definition at line 118 of file l2_input.c.

+ Here is the call graph for this function:

◆ format_l2_input_feature_bitmap()

u8* format_l2_input_feature_bitmap ( u8 s,
va_list *  args 
)

Definition at line 65 of file l2_input.c.

+ Here is the caller graph for this function:

◆ format_l2_input_features()

u8* format_l2_input_features ( u8 s,
va_list *  args 
)

Definition at line 98 of file l2_input.c.

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

◆ l2_input_is_bridge()

static bool l2_input_is_bridge ( const l2_input_config_t input)
inlinestatic

Definition at line 236 of file l2_input.h.

+ Here is the caller graph for this function:

◆ l2_input_is_bvi()

static bool l2_input_is_bvi ( const l2_input_config_t input)
inlinestatic

Definition at line 248 of file l2_input.h.

+ Here is the caller graph for this function:

◆ l2_input_is_xconnect()

static bool l2_input_is_xconnect ( const l2_input_config_t input)
inlinestatic

Definition at line 242 of file l2_input.h.

+ Here is the caller graph for this function:

◆ l2_input_seq_num()

static_always_inline u8 l2_input_seq_num ( u32  sw_if_index)

Definition at line 254 of file l2_input.h.

+ Here is the caller graph for this function:

◆ l2_input_seq_num_inc()

void l2_input_seq_num_inc ( u32  sw_if_index)

Definition at line 238 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_bd_config()

static_always_inline l2_bridge_domain_t* l2input_bd_config ( u32  bd_index)

Definition at line 116 of file l2_input.h.

+ Here is the caller graph for this function:

◆ l2input_bd_config_from_index()

static_always_inline l2_bridge_domain_t* l2input_bd_config_from_index ( l2input_main_t l2im,
u32  bd_index 
)

Definition at line 107 of file l2_input.h.

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

◆ l2input_get_feat_names()

char** l2input_get_feat_names ( void  )

Return an array of strings containing graph node names of each feature.

Definition at line 59 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_interface_mac_change()

void l2input_interface_mac_change ( u32  sw_if_index,
const u8 old_address,
const u8 new_address 
)

Definition at line 201 of file l2_input.c.

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

◆ l2input_intf_bitmap_enable()

u32 l2input_intf_bitmap_enable ( u32  sw_if_index,
l2input_feat_masks_t  feature_bitmap,
u32  enable 
)

Enable (or disable) the feature in the bitmap for the given interface.

Definition at line 177 of file l2_input.c.

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

◆ l2input_intf_config()

l2_input_config_t* l2input_intf_config ( u32  sw_if_index)

Masks for eliminating features that do not apply to a packet.

Get a pointer to the config for the given interface

Masks for eliminating features that do not apply to a packet.

Definition at line 167 of file l2_input.c.

+ Here is the caller graph for this function:

◆ l2input_recache()

walk_rc_t l2input_recache ( u32  bd_index,
u32  sw_if_index 
)

Definition at line 222 of file l2_input.c.

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

◆ l2input_set_bridge_features()

u32 l2input_set_bridge_features ( u32  bd_index,
u32  feat_mask,
u32  feat_value 
)

Definition at line 191 of file l2_input.c.

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

◆ set_int_l2_mode()

u32 set_int_l2_mode ( vlib_main_t vm,
vnet_main_t vnet_main,
u32  mode,
u32  sw_if_index,
u32  bd_index,
l2_bd_port_type_t  port_type,
u32  shg,
u32  xc_sw_if_index 
)

Set the subinterface to run in l2 or l3 mode.

For L3 mode, just the sw_if_index is specified. For bridged mode, the bd id and bvi flag are also specified. For xconnect mode, the peer sw_if_index is also specified. Return 0 if ok, or non-0 if there was an error.

Definition at line 256 of file l2_input.c.

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

◆ STATIC_ASSERT() [1/2]

STATIC_ASSERT ( (u64 L2INPUT_VALID_MASK = =(1ull<< L2INPUT_N_FEAT) - 1,
""   
)

◆ STATIC_ASSERT() [2/2]

STATIC_ASSERT ( L2INPUT_N_FEAT<=  32,
"too many l2 input features"   
)

◆ STATIC_ASSERT_SIZEOF()

STATIC_ASSERT_SIZEOF ( l2_input_config_t  ,
2 *  sizeofu64 
)

◆ vnet_l2_compute_flow_hash()

static u32 vnet_l2_compute_flow_hash ( vlib_buffer_t b)
inlinestatic

Definition at line 342 of file l2_input.h.

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

◆ vnet_update_l2_len()

static u16 vnet_update_l2_len ( vlib_buffer_t b)
inlinestatic

Definition at line 300 of file l2_input.h.

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

Variable Documentation

◆ l2input_main

l2input_main_t l2input_main

Definition at line 78 of file l2_input_node.c.

◆ l2input_node

(constructor) VLIB_REGISTER_NODE (l2input_node)

Definition at line 370 of file l2_input_node.c.

DROP
DROP
Definition: error.def:41