FD.io VPP  v16.09
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  ethernet_input_trace_t
 

Macros

#define foreach_ethernet_input_next
 
#define ethernet_error(n, c, s)   s,
 

Enumerations

enum  ethernet_input_next_t { ETHERNET_INPUT_N_NEXT }
 
enum  ethernet_input_variant_t { ETHERNET_INPUT_VARIANT_ETHERNET, ETHERNET_INPUT_VARIANT_ETHERNET_TYPE, ETHERNET_INPUT_VARIANT_NOT_L2 }
 

Functions

static u8format_ethernet_input_trace (u8 *s, va_list *va)
 
static_always_inline void parse_header (ethernet_input_variant_t variant, vlib_buffer_t *b0, u16 *type, u16 *orig_type, u16 *outer_id, u16 *inner_id, u32 *match_flags)
 
static_always_inline void identify_subint (vnet_hw_interface_t *hi, vlib_buffer_t *b0, u32 match_flags, main_intf_t *main_intf, vlan_intf_t *vlan_intf, qinq_intf_t *qinq_intf, u32 *new_sw_if_index, u8 *error0, u32 *is_l2)
 
static_always_inline void determine_next_node (ethernet_main_t *em, ethernet_input_variant_t variant, u32 is_l20, u32 type0, vlib_buffer_t *b0, u8 *error0, u8 *next0)
 
static_always_inline uword ethernet_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, ethernet_input_variant_t variant)
 
static uword ethernet_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ethernet_input_type (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ethernet_input_not_l2 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static subint_config_tethernet_sw_interface_get_config (vnet_main_t *vnm, u32 sw_if_index, u32 *flags, u32 *unsupported)
 
clib_error_tethernet_sw_interface_up_down (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (ethernet_sw_interface_up_down)
 
void ethernet_sw_interface_set_l2_mode (vnet_main_t *vnm, u32 sw_if_index, u32 l2)
 
void ethernet_sw_interface_set_l2_mode_noport (vnet_main_t *vnm, u32 sw_if_index, u32 l2)
 
static clib_error_tethernet_sw_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_create)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (ethernet_sw_interface_add_del)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ethernet_input_not_l2_node, ethernet_input_not_l2)
 
clib_error_tnext_by_ethertype_init (next_by_ethertype_t *l3_next)
 
clib_error_tnext_by_ethertype_register (next_by_ethertype_t *l3_next, u32 ethertype, u32 next_index)
 
static clib_error_tethernet_input_init (vlib_main_t *vm)
 
void ethernet_register_input_type (vlib_main_t *vm, ethernet_type_t type, u32 node_index)
 
void ethernet_register_l2_input (vlib_main_t *vm, u32 node_index)
 
void ethernet_register_l3_redirect (vlib_main_t *vm, u32 node_index)
 

Variables

vlib_node_registration_t ethernet_input_node
 (constructor) VLIB_REGISTER_NODE (ethernet_input_node) More...
 
static char * ethernet_error_strings []
 
static vlib_node_registration_t ethernet_input_type_node
 (constructor) VLIB_REGISTER_NODE (ethernet_input_type_node) More...
 
static vlib_node_registration_t ethernet_input_not_l2_node
 (constructor) VLIB_REGISTER_NODE (ethernet_input_not_l2_node) More...
 

Macro Definition Documentation

#define ethernet_error (   n,
  c,
 
)    s,
#define foreach_ethernet_input_next
Value:
_ (PUNT, "error-punt") \
_ (DROP, "error-drop") \
_ (LLC, "llc-input")
DROP
Definition: error.def:41

Definition at line 47 of file node.c.

Enumeration Type Documentation

Enumerator
ETHERNET_INPUT_N_NEXT 

Definition at line 52 of file node.c.

Enumerator
ETHERNET_INPUT_VARIANT_ETHERNET 
ETHERNET_INPUT_VARIANT_ETHERNET_TYPE 
ETHERNET_INPUT_VARIANT_NOT_L2 

Definition at line 79 of file node.c.

Function Documentation

static_always_inline void determine_next_node ( ethernet_main_t em,
ethernet_input_variant_t  variant,
u32  is_l20,
u32  type0,
vlib_buffer_t b0,
u8 error0,
u8 next0 
)

Definition at line 227 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ethernet_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 634 of file node.c.

+ Here is the call graph for this function:

static clib_error_t* ethernet_input_init ( vlib_main_t vm)
static

Definition at line 1154 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword ethernet_input_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
ethernet_input_variant_t  variant 
)

Definition at line 286 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ethernet_input_not_l2 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 650 of file node.c.

+ Here is the call graph for this function:

static uword ethernet_input_type ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 642 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 1182 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ethernet_register_l2_input ( vlib_main_t vm,
u32  node_index 
)

Definition at line 1213 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ethernet_register_l3_redirect ( vlib_main_t vm,
u32  node_index 
)

Definition at line 1234 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ethernet_sw_interface_add_del ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_create 
)
static

Definition at line 941 of file node.c.

+ Here is the call graph for this function:

static subint_config_t* ethernet_sw_interface_get_config ( vnet_main_t vnm,
u32  sw_if_index,
u32 flags,
u32 unsupported 
)
static

Definition at line 663 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ethernet_sw_interface_set_l2_mode ( vnet_main_t vnm,
u32  sw_if_index,
u32  l2 
)

Definition at line 854 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ethernet_sw_interface_set_l2_mode_noport ( vnet_main_t vnm,
u32  sw_if_index,
u32  l2 
)

Definition at line 903 of file node.c.

+ Here is the call graph for this function:

clib_error_t* ethernet_sw_interface_up_down ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)

Definition at line 824 of file node.c.

+ Here is the call graph for this function:

static u8* format_ethernet_input_trace ( u8 s,
va_list *  va 
)
static

Definition at line 66 of file node.c.

+ Here is the call graph for this function:

static_always_inline void identify_subint ( vnet_hw_interface_t hi,
vlib_buffer_t b0,
u32  match_flags,
main_intf_t main_intf,
vlan_intf_t vlan_intf,
qinq_intf_t qinq_intf,
u32 new_sw_if_index,
u8 error0,
u32 is_l2 
)

Definition at line 185 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* next_by_ethertype_init ( next_by_ethertype_t l3_next)

Definition at line 1077 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* next_by_ethertype_register ( next_by_ethertype_t l3_next,
u32  ethertype,
u32  next_index 
)

Definition at line 1107 of file node.c.

+ Here is the caller graph for this function:

static_always_inline void parse_header ( ethernet_input_variant_t  variant,
vlib_buffer_t b0,
u16 type,
u16 orig_type,
u16 outer_id,
u16 inner_id,
u32 match_flags 
)

Definition at line 89 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ethernet_input_not_l2_node  ,
ethernet_input_not_l2   
)

Definition at line 1056 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( ethernet_sw_interface_add_del  )

+ Here is the caller graph for this function:

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( ethernet_sw_interface_up_down  )

+ Here is the caller graph for this function:

Variable Documentation

char* ethernet_error_strings[]
static
Initial value:
= {
#define ethernet_error(n,c,s)
ethernet_error (NONE, PUNT, "no error")
ethernet_error (BAD_LLC_LENGTH, DROP, "llc length > packet length")
ethernet_error (UNKNOWN_TYPE, PUNT, "unknown ethernet type")
ethernet_error (UNKNOWN_VLAN, DROP, "unknown vlan")
ethernet_error (L3_MAC_MISMATCH, DROP, "l3 mac mismatch")
ethernet_error (DOWN, DROP, "subinterface down")
}
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
DROP
Definition: error.def:41
#define ethernet_error(n, c, s)

Definition at line 990 of file node.c.

vlib_node_registration_t ethernet_input_node
Initial value:
= {
.function = ethernet_input,
.name = "ethernet-input",
.vector_size = sizeof (u32),
.n_errors = ETHERNET_N_ERROR,
.error_strings = ethernet_error_strings,
.n_next_nodes = ETHERNET_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_ethernet_input_trace,
.unformat_buffer = unformat_ethernet_header,
}
static u8 * format_ethernet_input_trace(u8 *s, va_list *va)
Definition: node.c:66
#define foreach_ethernet_input_next
Definition: node.c:47
static uword ethernet_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:634
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:91
static char * ethernet_error_strings[]
Definition: node.c:990
unsigned int u32
Definition: types.h:88
uword unformat_ethernet_header(unformat_input_t *input, va_list *args)
Definition: format.c:256

(constructor) VLIB_REGISTER_NODE (ethernet_input_node)

Definition at line 77 of file node.c.

vlib_node_registration_t ethernet_input_not_l2_node
static
Initial value:
= {
.function = ethernet_input_not_l2,
.name = "ethernet-input-not-l2",
.vector_size = sizeof (u32),
.n_next_nodes = ETHERNET_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static uword ethernet_input_not_l2(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:650
#define foreach_ethernet_input_next
Definition: node.c:47
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (ethernet_input_not_l2_node)

Definition at line 1040 of file node.c.

vlib_node_registration_t ethernet_input_type_node
static
Initial value:
= {
.function = ethernet_input_type,
.name = "ethernet-input-type",
.vector_size = sizeof (u32),
.n_next_nodes = ETHERNET_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
#define foreach_ethernet_input_next
Definition: node.c:47
unsigned int u32
Definition: types.h:88
static uword ethernet_input_type(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:642

(constructor) VLIB_REGISTER_NODE (ethernet_input_type_node)

Definition at line 1021 of file node.c.