FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
l2_node.c File Reference
+ Include dependency graph for l2_node.c:

Go to the source code of this file.

Data Structures

struct  flowperpkt_l2_trace_t
 

Macros

#define foreach_flowperpkt_l2_error
 

Enumerations

enum  flowperpkt_l2_error_t { FLOWPERPKT_N_ERROR }
 
enum  flowperpkt_l2_next_t { FLOWPERPKT_L2_NEXT_DROP, FLOWPERPKT_L2_NEXT_IP4_LOOKUP, FLOWPERPKT_L2_N_NEXT }
 

Functions

static u8format_flowperpkt_l2_trace (u8 *s, va_list *args)
 
static void add_to_flow_record_l2 (vlib_main_t *vm, vlib_node_runtime_t *node, flowperpkt_main_t *fm, u32 rx_sw_if_index, u32 tx_sw_if_index, u8 *src_mac, u8 *dst_mac, u16 ethertype, u64 timestamp, u16 length, int do_flush)
 add an entry to the flow record under construction More...
 
void flowperpkt_flush_callback_l2 (void)
 
static uword flowperpkt_l2_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

vlib_node_registration_t flowperpkt_l2_node
 IPFIX l2 flow-per-packet graph node. More...
 
static char * flowperpkt_l2_error_strings []
 

Macro Definition Documentation

#define foreach_flowperpkt_l2_error

Definition at line 63 of file l2_node.c.

Enumeration Type Documentation

Enumerator
FLOWPERPKT_N_ERROR 

Definition at line 65 of file l2_node.c.

Enumerator
FLOWPERPKT_L2_NEXT_DROP 
FLOWPERPKT_L2_NEXT_IP4_LOOKUP 
FLOWPERPKT_L2_N_NEXT 

Definition at line 79 of file l2_node.c.

Function Documentation

static void add_to_flow_record_l2 ( vlib_main_t vm,
vlib_node_runtime_t node,
flowperpkt_main_t fm,
u32  rx_sw_if_index,
u32  tx_sw_if_index,
u8 src_mac,
u8 dst_mac,
u16  ethertype,
u64  timestamp,
u16  length,
int  do_flush 
)
inlinestatic

add an entry to the flow record under construction

Parameters
vmvlib_main_t * current worker thread main structure pointer
fmflowperpkt_main_t * flow-per-packet main structure pointer
sw_if_indexu32 interface handle
tosu8 ToS bits from the packet
timestampu64 timestamp, nanoseconds since 1/1/70
lengthu16 ip length of the packet
do_flushint 1 = flush all cached records, 0 = construct a record

Definition at line 98 of file l2_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void flowperpkt_flush_callback_l2 ( void  )

Definition at line 312 of file l2_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 331 of file l2_node.c.

+ Here is the call graph for this function:

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

Definition at line 45 of file l2_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

char* flowperpkt_l2_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_flowperpkt_l2_error
Definition: l2_node.c:63

Definition at line 73 of file l2_node.c.

vlib_node_registration_t flowperpkt_l2_node
Initial value:
= {
.function = flowperpkt_l2_node_fn,
.name = "flowperpkt-l2",
.vector_size = sizeof (u32),
.format_trace = format_flowperpkt_l2_trace,
.error_strings = flowperpkt_l2_error_strings,
.n_next_nodes = FLOWPERPKT_L2_N_NEXT,
.next_nodes = {
[FLOWPERPKT_L2_NEXT_DROP] = "error-drop",
},
}
static char * flowperpkt_l2_error_strings[]
Definition: l2_node.c:73
static u8 * format_flowperpkt_l2_trace(u8 *s, va_list *args)
Definition: l2_node.c:45
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
static uword flowperpkt_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: l2_node.c:331

IPFIX l2 flow-per-packet graph node.

Node Identifier:
flowperpkt-l2

This is the IPFIX flow-record-per-packet node.

Parameters
vmvlib_main_t corresponding to the current thread.
nodevlib_node_runtime_t data for this node.
framevlib_frame_t whose contents should be dispatched.
Graph mechanics: buffer metadata, next index usage

Uses:

  • vnet_buffer(b)->ip.save_rewrite_length
    • tells the node the length of the rewrite which was applied in ip4/6_rewrite_inline, allows the code to find the IP header without having to parse L2 headers, or make stupid assumptions about their length.
  • vnet_buffer(b)->flags & VLIB_BUFFER_FLOW_REPORT
    • Used to suppress flow record generation for flow record packets.

Sets:

  • vnet_buffer(b)->flags & VLIB_BUFFER_FLOW_REPORT
    • To suppress flow record generation for flow record packets

Next Index:

  • Next configured output feature on the interface, usually "interface-output." Generated flow records head for ip4-lookup(constructor) VLIB_REGISTER_NODE (flowperpkt_l2_node)

Definition at line 60 of file l2_node.c.