FD.io VPP  v20.01-48-g3e0dafb74
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 132 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 105 of file node.c.

◆ NTP_TIMESTAMP

#define NTP_TIMESTAMP   2208988800LU

Definition at line 151 of file node.c.

Enumeration Type Documentation

◆ flowprobe_error_t

Enumerator
FLOWPROBE_N_ERROR 

Definition at line 111 of file node.c.

◆ flowprobe_next_t

Enumerator
FLOWPROBE_NEXT_DROP 
FLOWPROBE_NEXT_IP4_LOOKUP 
FLOWPROBE_N_NEXT 

Definition at line 125 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 359 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 154 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 333 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 901 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 668 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 517 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 880 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 886 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 892 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 628 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 510 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 138 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 286 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 850 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 857 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 193 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 864 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 239 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 213 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 265 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 306 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 719 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 921 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 871 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 71 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:105

Definition at line 119 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:119
unsigned int u32
Definition: types.h:88
static uword flowprobe_ip4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:850
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define FLOWPROBE_NEXT_NODES
Definition: node.c:132
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:71
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (flowprobe_ip4_node)

Definition at line 100 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 char * flowprobe_error_strings[]
Definition: node.c:119
static uword flowprobe_ip6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:857
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define FLOWPROBE_NEXT_NODES
Definition: node.c:132
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:71
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (flowprobe_ip6_node)

Definition at line 101 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:119
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define FLOWPROBE_NEXT_NODES
Definition: node.c:132
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:71
#define ARRAY_LEN(x)
Definition: clib.h:62
static uword flowprobe_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:864

(constructor) VLIB_REGISTER_NODE (flowprobe_l2_node)

Definition at line 102 of file node.c.

◆ flowprobe_variant_strings

char* flowprobe_variant_strings[]
static
Initial value:

Definition at line 61 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:921

(constructor) VLIB_REGISTER_NODE (flowprobe_walker_node)

Definition at line 1033 of file node.c.