FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  flowprobe_trace_t
 

Macros

#define foreach_flowprobe_error
 
#define FLOWPROBE_NEXT_NODES
 
#define NTP_TIMESTAMP   2208988800LU
 

Enumerations

enum  flowprobe_error_t { FLOWPROBE_N_ERROR }
 
enum  flowprobe_next_t { FLOWPROBE_NEXT_DROP, FLOWPROBE_NEXT_IP4_LOOKUP, FLOWPROBE_N_NEXT }
 

Functions

static void flowprobe_export_entry (vlib_main_t *vm, flowprobe_entry_t *e)
 
static u8format_flowprobe_trace (u8 *s, va_list *args)
 
static flowprobe_variant_t flowprobe_get_variant (flowprobe_variant_t which, flowprobe_record_t flags, u16 ethertype)
 
static u32 flowprobe_common_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l2_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l3_ip6_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l3_ip4_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l4_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_hash (flowprobe_key_t *k)
 
flowprobe_entry_tflowprobe_lookup (u32 my_cpu_number, flowprobe_key_t *k, u32 *poolindex, bool *collision)
 
flowprobe_entry_tflowprobe_create (u32 my_cpu_number, flowprobe_key_t *k, u32 *poolindex)
 
static void add_to_flow_record_state (vlib_main_t *vm, vlib_node_runtime_t *node, flowprobe_main_t *fm, vlib_buffer_t *b, timestamp_nsec_t timestamp, u16 length, flowprobe_variant_t which, flowprobe_trace_t *t)
 
static u16 flowprobe_get_headersize (void)
 
static void flowprobe_export_send (vlib_main_t *vm, vlib_buffer_t *b0, flowprobe_variant_t which)
 
static vlib_buffer_tflowprobe_get_buffer (vlib_main_t *vm, flowprobe_variant_t which)
 
uword flowprobe_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, flowprobe_variant_t which)
 
static uword flowprobe_ip4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword flowprobe_ip6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword flowprobe_l2_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static void flush_record (flowprobe_variant_t which)
 
void flowprobe_flush_callback_ip4 (void)
 
void flowprobe_flush_callback_ip6 (void)
 
void flowprobe_flush_callback_l2 (void)
 
static void flowprobe_delete_by_index (u32 my_cpu_number, u32 poolindex)
 
static uword flowprobe_walker_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 

Variables

static char * flowprobe_variant_strings []
 
vlib_node_registration_t flowprobe_ip4_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_ip4_node) More...
 
vlib_node_registration_t flowprobe_ip6_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_ip6_node) More...
 
vlib_node_registration_t flowprobe_l2_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_l2_node) More...
 
static char * flowprobe_error_strings []
 
vlib_node_registration_t flowprobe_walker_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_walker_node) More...
 

Macro Definition Documentation

◆ FLOWPROBE_NEXT_NODES

#define FLOWPROBE_NEXT_NODES
Value:
{ \
[FLOWPROBE_NEXT_DROP] = "error-drop", \
[FLOWPROBE_NEXT_IP4_LOOKUP] = "ip4-lookup", \
}

Definition at line 133 of file node.c.

◆ foreach_flowprobe_error

#define foreach_flowprobe_error
Value:
_(COLLISION, "Hash table collisions") \
_(BUFFER, "Buffer allocation error") \
_(EXPORTED_PACKETS, "Exported packets") \
_(INPATH, "Exported packets in path")

Definition at line 106 of file node.c.

◆ NTP_TIMESTAMP

#define NTP_TIMESTAMP   2208988800LU

Definition at line 152 of file node.c.

Enumeration Type Documentation

◆ flowprobe_error_t

Enumerator
FLOWPROBE_N_ERROR 

Definition at line 112 of file node.c.

◆ flowprobe_next_t

Enumerator
FLOWPROBE_NEXT_DROP 
FLOWPROBE_NEXT_IP4_LOOKUP 
FLOWPROBE_N_NEXT 

Definition at line 126 of file node.c.

Function Documentation

◆ add_to_flow_record_state()

static void add_to_flow_record_state ( vlib_main_t vm,
vlib_node_runtime_t node,
flowprobe_main_t fm,
vlib_buffer_t b,
timestamp_nsec_t  timestamp,
u16  length,
flowprobe_variant_t  which,
flowprobe_trace_t t 
)
inlinestatic

Definition at line 360 of file node.c.

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

◆ flowprobe_common_add()

static u32 flowprobe_common_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 155 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_create()

flowprobe_entry_t* flowprobe_create ( u32  my_cpu_number,
flowprobe_key_t k,
u32 poolindex 
)

Definition at line 334 of file node.c.

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

◆ flowprobe_delete_by_index()

static void flowprobe_delete_by_index ( u32  my_cpu_number,
u32  poolindex 
)
static

Definition at line 902 of file node.c.

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

◆ flowprobe_export_entry()

static void flowprobe_export_entry ( vlib_main_t vm,
flowprobe_entry_t e 
)
static

Definition at line 669 of file node.c.

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

◆ flowprobe_export_send()

static void flowprobe_export_send ( vlib_main_t vm,
vlib_buffer_t b0,
flowprobe_variant_t  which 
)
static

Definition at line 518 of file node.c.

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

◆ flowprobe_flush_callback_ip4()

void flowprobe_flush_callback_ip4 ( void  )

Definition at line 881 of file node.c.

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

◆ flowprobe_flush_callback_ip6()

void flowprobe_flush_callback_ip6 ( void  )

Definition at line 887 of file node.c.

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

◆ flowprobe_flush_callback_l2()

void flowprobe_flush_callback_l2 ( void  )

Definition at line 893 of file node.c.

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

◆ flowprobe_get_buffer()

static vlib_buffer_t* flowprobe_get_buffer ( vlib_main_t vm,
flowprobe_variant_t  which 
)
static

Definition at line 629 of file node.c.

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

◆ flowprobe_get_headersize()

static u16 flowprobe_get_headersize ( void  )
static

Definition at line 511 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_get_variant()

static flowprobe_variant_t flowprobe_get_variant ( flowprobe_variant_t  which,
flowprobe_record_t  flags,
u16  ethertype 
)
inlinestatic

Definition at line 139 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_hash()

static u32 flowprobe_hash ( flowprobe_key_t k)
inlinestatic

Definition at line 287 of file node.c.

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

◆ flowprobe_ip4_node_fn()

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

Definition at line 851 of file node.c.

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

◆ flowprobe_ip6_node_fn()

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

Definition at line 858 of file node.c.

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

◆ flowprobe_l2_add()

static u32 flowprobe_l2_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 194 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_l2_node_fn()

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

Definition at line 865 of file node.c.

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

◆ flowprobe_l3_ip4_add()

static u32 flowprobe_l3_ip4_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 240 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_l3_ip6_add()

static u32 flowprobe_l3_ip6_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 214 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_l4_add()

static u32 flowprobe_l4_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 266 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_lookup()

flowprobe_entry_t* flowprobe_lookup ( u32  my_cpu_number,
flowprobe_key_t k,
u32 poolindex,
bool collision 
)

Definition at line 307 of file node.c.

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

◆ flowprobe_node_fn()

uword flowprobe_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
flowprobe_variant_t  which 
)

Definition at line 720 of file node.c.

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

◆ flowprobe_walker_process()

static uword flowprobe_walker_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 922 of file node.c.

+ Here is the call graph for this function:

◆ flush_record()

static void flush_record ( flowprobe_variant_t  which)
inlinestatic

Definition at line 872 of file node.c.

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

◆ format_flowprobe_trace()

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

Definition at line 72 of file node.c.

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

Variable Documentation

◆ flowprobe_error_strings

char* flowprobe_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_flowprobe_error
Definition: node.c:106

Definition at line 120 of file node.c.

◆ flowprobe_ip4_node

vlib_node_registration_t flowprobe_ip4_node
Initial value:
= {
.function = flowprobe_ip4_node_fn,
.name = "flowprobe-ip4",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}
static char * flowprobe_error_strings[]
Definition: node.c:120
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:72
#define ARRAY_LEN(x)
Definition: clib.h:67
#define FLOWPROBE_NEXT_NODES
Definition: node.c:133
static uword flowprobe_ip4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:851

(constructor) VLIB_REGISTER_NODE (flowprobe_ip4_node)

Definition at line 101 of file node.c.

◆ flowprobe_ip6_node

vlib_node_registration_t flowprobe_ip6_node
Initial value:
= {
.function = flowprobe_ip6_node_fn,
.name = "flowprobe-ip6",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}
static uword flowprobe_ip6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:858
static char * flowprobe_error_strings[]
Definition: node.c:120
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:72
#define ARRAY_LEN(x)
Definition: clib.h:67
#define FLOWPROBE_NEXT_NODES
Definition: node.c:133

(constructor) VLIB_REGISTER_NODE (flowprobe_ip6_node)

Definition at line 102 of file node.c.

◆ flowprobe_l2_node

vlib_node_registration_t flowprobe_l2_node
Initial value:
= {
.function = flowprobe_l2_node_fn,
.name = "flowprobe-l2",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}
static char * flowprobe_error_strings[]
Definition: node.c:120
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:72
#define ARRAY_LEN(x)
Definition: clib.h:67
#define FLOWPROBE_NEXT_NODES
Definition: node.c:133
static uword flowprobe_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:865

(constructor) VLIB_REGISTER_NODE (flowprobe_l2_node)

Definition at line 103 of file node.c.

◆ flowprobe_variant_strings

char* flowprobe_variant_strings[]
static
Initial value:

Definition at line 62 of file node.c.

◆ flowprobe_walker_node

vlib_node_registration_t flowprobe_walker_node
Initial value:
= {
.name = "flowprobe-walker",
.state = VLIB_NODE_STATE_INTERRUPT,
}
static uword flowprobe_walker_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: node.c:922

(constructor) VLIB_REGISTER_NODE (flowprobe_walker_node)

Definition at line 1034 of file node.c.