FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
ip4_reassembly.c File Reference

IPv4 Reassembly. More...

+ Include dependency graph for ip4_reassembly.c:

Go to the source code of this file.

Data Structures

struct  ip4_reass_key_t
 
struct  ip4_reass_t
 
struct  ip4_reass_per_thread_t
 
struct  ip4_reass_main_t
 
struct  ip4_reass_range_trace_t
 
struct  ip4_reass_trace_t
 
struct  ip4_rehash_cb_ctx
 

Macros

#define MSEC_PER_SEC   1000
 
#define IP4_REASS_TIMEOUT_DEFAULT_MS   100
 
#define IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS   10000
 
#define IP4_REASS_MAX_REASSEMBLIES_DEFAULT   1024
 
#define IP4_REASS_HT_LOAD_FACTOR   (0.75)
 
#define IP4_REASS_DEBUG_BUFFERS   0
 
#define IP4_REASS_DEBUG_BUFFER(...)
 

Enumerations

enum  ip4_reass_next_t { IP4_REASSEMBLY_NEXT_INPUT, IP4_REASSEMBLY_NEXT_DROP, IP4_REASSEMBLY_N_NEXT }
 
enum  ip4_reass_trace_operation_e {
  RANGE_NEW, RANGE_SHRINK, RANGE_DISCARD, RANGE_OVERLAP,
  FINALIZE
}
 
enum  ip4_reass_event_t { IP4_EVENT_CONFIG_CHANGED = 1 }
 

Functions

static u32 ip4_reass_buffer_get_data_offset_no_check (vlib_buffer_t *b)
 
static u32 ip4_reass_buffer_get_data_offset (vlib_buffer_t *b)
 
static u16 ip4_reass_buffer_get_data_len_no_check (vlib_buffer_t *b)
 
static u16 ip4_reass_buffer_get_data_len (vlib_buffer_t *b)
 
static void ip4_reass_trace_details (vlib_main_t *vm, u32 bi, ip4_reass_range_trace_t *trace)
 
static u8format_ip4_reass_range_trace (u8 *s, va_list *args)
 
u8format_ip4_reass_trace (u8 *s, va_list *args)
 
static void ip4_reass_add_trace (vlib_main_t *vm, vlib_node_runtime_t *node, ip4_reass_main_t *rm, ip4_reass_t *reass, u32 bi, ip4_reass_trace_operation_e action, u32 size_diff)
 
static void ip4_reass_free (ip4_reass_main_t *rm, ip4_reass_per_thread_t *rt, ip4_reass_t *reass)
 
static void ip4_reass_on_timeout (vlib_main_t *vm, ip4_reass_main_t *rm, ip4_reass_t *reass, u32 **vec_drop_timeout)
 
ip4_reass_tip4_reass_find_or_create (vlib_main_t *vm, ip4_reass_main_t *rm, ip4_reass_per_thread_t *rt, ip4_reass_key_t *k, u32 **vec_drop_timeout)
 
static void ip4_reass_finalize (vlib_main_t *vm, vlib_node_runtime_t *node, ip4_reass_main_t *rm, ip4_reass_per_thread_t *rt, ip4_reass_t *reass, u32 *bi0, u32 *next0, vlib_error_t *error0, u32 **vec_drop_compress, u32 **vec_drop_overlap, bool is_feature)
 
static u32 ip4_reass_get_buffer_chain_length (vlib_main_t *vm, vlib_buffer_t *b)
 
static void ip4_reass_insert_range_in_chain (vlib_main_t *vm, ip4_reass_main_t *rm, ip4_reass_per_thread_t *rt, ip4_reass_t *reass, u32 prev_range_bi, u32 new_next_bi)
 
static void ip4_reass_remove_range_from_chain (vlib_main_t *vm, vlib_node_runtime_t *node, ip4_reass_main_t *rm, u32 **vec_drop_overlap, ip4_reass_t *reass, u32 prev_range_bi, u32 discard_bi)
 
static void ip4_reass_update (vlib_main_t *vm, vlib_node_runtime_t *node, ip4_reass_main_t *rm, ip4_reass_per_thread_t *rt, ip4_reass_t *reass, u32 *bi0, u32 *next0, vlib_error_t *error0, u32 **vec_drop_overlap, u32 **vec_drop_compress, bool is_feature)
 
static uword ip4_reassembly_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
 
static uword ip4_reassembly (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_reass_node, ip4_reassembly)
 
static uword ip4_reassembly_feature (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_reass_node_feature, ip4_reassembly_feature)
 
 VNET_FEATURE_INIT (ip4_reassembly_feature, static)
 
static u32 ip4_reass_get_nbuckets ()
 
static void ip4_rehash_cb (clib_bihash_kv_24_8_t *kv, void *_ctx)
 
static void ip4_reass_set_params (u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
 
vnet_api_error_t ip4_reass_set (u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
 set ip4 reassembly configuration More...
 
vnet_api_error_t ip4_reass_get (u32 *timeout_ms, u32 *max_reassemblies, u32 *expire_walk_interval_ms)
 get ip4 reassembly configuration More...
 
static clib_error_tip4_reass_init_function (vlib_main_t *vm)
 
static uword ip4_reass_walk_expired (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static u8format_ip4_reass_key (u8 *s, va_list *args)
 
static u8format_ip4_reass (u8 *s, va_list *args)
 
static clib_error_tshow_ip4_reass (vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
 
vnet_api_error_t ip4_reass_enable_disable (u32 sw_if_index, u8 enable_disable)
 

Variables

static vlib_node_registration_t ip4_reass_node
 (constructor) VLIB_REGISTER_NODE (ip4_reass_node) More...
 
ip4_reass_main_t ip4_reass_main
 
static char * ip4_reassembly_error_strings []
 
static vlib_node_registration_t ip4_reass_node_feature
 (constructor) VLIB_REGISTER_NODE (ip4_reass_node_feature) More...
 
static vlib_node_registration_t ip4_reass_expire_node
 (constructor) VLIB_REGISTER_NODE (ip4_reass_expire_node) More...
 
static vlib_cli_command_t show_ip4_reassembly_cmd
 (constructor) VLIB_CLI_COMMAND (show_ip4_reassembly_cmd) More...
 

Detailed Description

IPv4 Reassembly.

This file contains the source code for IPv4 reassembly.

Definition in file ip4_reassembly.c.

Macro Definition Documentation

#define IP4_REASS_DEBUG_BUFFER (   ...)

Definition at line 54 of file ip4_reassembly.c.

#define IP4_REASS_DEBUG_BUFFERS   0

Definition at line 35 of file ip4_reassembly.c.

#define IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS   10000

Definition at line 31 of file ip4_reassembly.c.

#define IP4_REASS_HT_LOAD_FACTOR   (0.75)

Definition at line 33 of file ip4_reassembly.c.

#define IP4_REASS_MAX_REASSEMBLIES_DEFAULT   1024

Definition at line 32 of file ip4_reassembly.c.

#define IP4_REASS_TIMEOUT_DEFAULT_MS   100

Definition at line 30 of file ip4_reassembly.c.

#define MSEC_PER_SEC   1000

Definition at line 29 of file ip4_reassembly.c.

Enumeration Type Documentation

Enumerator
IP4_EVENT_CONFIG_CHANGED 

Definition at line 1071 of file ip4_reassembly.c.

Enumerator
IP4_REASSEMBLY_NEXT_INPUT 
IP4_REASSEMBLY_NEXT_DROP 
IP4_REASSEMBLY_N_NEXT 

Definition at line 165 of file ip4_reassembly.c.

Enumerator
RANGE_NEW 
RANGE_SHRINK 
RANGE_DISCARD 
RANGE_OVERLAP 
FINALIZE 

Definition at line 172 of file ip4_reassembly.c.

Function Documentation

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

Definition at line 1334 of file ip4_reassembly.c.

+ Here is the call graph for this function:

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

Definition at line 1324 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 217 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip4_reass_trace ( u8 s,
va_list *  args 
)

Definition at line 227 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_add_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
ip4_reass_main_t rm,
ip4_reass_t reass,
u32  bi,
ip4_reass_trace_operation_e  action,
u32  size_diff 
)
static

Definition at line 264 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 ip4_reass_buffer_get_data_len ( vlib_buffer_t b)
inlinestatic

Definition at line 103 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 ip4_reass_buffer_get_data_len_no_check ( vlib_buffer_t b)
inlinestatic

Definition at line 95 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip4_reass_buffer_get_data_offset ( vlib_buffer_t b)
inlinestatic

Definition at line 87 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip4_reass_buffer_get_data_offset_no_check ( vlib_buffer_t b)
inlinestatic

Definition at line 80 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

vnet_api_error_t ip4_reass_enable_disable ( u32  sw_if_index,
u8  enable_disable 
)

Definition at line 1425 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_finalize ( vlib_main_t vm,
vlib_node_runtime_t node,
ip4_reass_main_t rm,
ip4_reass_per_thread_t rt,
ip4_reass_t reass,
u32 bi0,
u32 next0,
vlib_error_t error0,
u32 **  vec_drop_compress,
u32 **  vec_drop_overlap,
bool  is_feature 
)
inlinestatic

Definition at line 402 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ip4_reass_t* ip4_reass_find_or_create ( vlib_main_t vm,
ip4_reass_main_t rm,
ip4_reass_per_thread_t rt,
ip4_reass_key_t k,
u32 **  vec_drop_timeout 
)

Definition at line 340 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_free ( ip4_reass_main_t rm,
ip4_reass_per_thread_t rt,
ip4_reass_t reass 
)
inlinestatic

Definition at line 297 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

vnet_api_error_t ip4_reass_get ( u32 timeout_ms,
u32 max_reassemblies,
u32 expire_walk_interval_ms 
)

get ip4 reassembly configuration

Definition at line 1140 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

static u32 ip4_reass_get_buffer_chain_length ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 560 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip4_reass_get_nbuckets ( )
inlinestatic

Definition at line 1055 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

static clib_error_t* ip4_reass_init_function ( vlib_main_t vm)
static

Definition at line 1150 of file ip4_reassembly.c.

+ Here is the call graph for this function:

static void ip4_reass_insert_range_in_chain ( vlib_main_t vm,
ip4_reass_main_t rm,
ip4_reass_per_thread_t rt,
ip4_reass_t reass,
u32  prev_range_bi,
u32  new_next_bi 
)
inlinestatic

Definition at line 579 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_on_timeout ( vlib_main_t vm,
ip4_reass_main_t rm,
ip4_reass_t reass,
u32 **  vec_drop_timeout 
)
inlinestatic

Definition at line 310 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_remove_range_from_chain ( vlib_main_t vm,
vlib_node_runtime_t node,
ip4_reass_main_t rm,
u32 **  vec_drop_overlap,
ip4_reass_t reass,
u32  prev_range_bi,
u32  discard_bi 
)
inlinestatic

Definition at line 608 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vnet_api_error_t ip4_reass_set ( u32  timeout_ms,
u32  max_reassemblies,
u32  expire_walk_interval_ms 
)

set ip4 reassembly configuration

Definition at line 1103 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_set_params ( u32  timeout_ms,
u32  max_reassemblies,
u32  expire_walk_interval_ms 
)
static

Definition at line 1093 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

static void ip4_reass_trace_details ( vlib_main_t vm,
u32  bi,
ip4_reass_range_trace_t trace 
)
static

Definition at line 204 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_reass_update ( vlib_main_t vm,
vlib_node_runtime_t node,
ip4_reass_main_t rm,
ip4_reass_per_thread_t rt,
ip4_reass_t reass,
u32 bi0,
u32 next0,
vlib_error_t error0,
u32 **  vec_drop_overlap,
u32 **  vec_drop_compress,
bool  is_feature 
)
inlinestatic

Definition at line 651 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip4_reass_walk_expired ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1189 of file ip4_reassembly.c.

+ Here is the call graph for this function:

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

Definition at line 994 of file ip4_reassembly.c.

+ Here is the call graph for this function:

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

Definition at line 1020 of file ip4_reassembly.c.

+ Here is the call graph for this function:

static uword ip4_reassembly_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
bool  is_feature 
)
inlinestatic

Definition at line 843 of file ip4_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_rehash_cb ( clib_bihash_kv_24_8_t kv,
void *  _ctx 
)
static

Definition at line 1083 of file ip4_reassembly.c.

+ Here is the caller graph for this function:

static clib_error_t* show_ip4_reass ( vlib_main_t vm,
unformat_input_t input,
CLIB_UNUSED(vlib_cli_command_t *lmd)   
)
static

Definition at line 1370 of file ip4_reassembly.c.

+ Here is the call graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ip4_reass_node  ,
ip4_reassembly   
)

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ip4_reass_node_feature  ,
ip4_reassembly_feature   
)
VNET_FEATURE_INIT ( ip4_reassembly_feature  ,
static   
)

Variable Documentation

static vlib_node_registration_t ip4_reass_expire_node
static
Initial value:
= {
.name = "ip4-reassembly-expire-walk",
.format_trace = format_ip4_reass_trace,
.error_strings = ip4_reassembly_error_strings,
}
u8 * format_ip4_reass_trace(u8 *s, va_list *args)
static char * ip4_reassembly_error_strings[]
static uword ip4_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
#define ARRAY_LEN(x)
Definition: clib.h:59

(constructor) VLIB_REGISTER_NODE (ip4_reass_expire_node)

Definition at line 1309 of file ip4_reassembly.c.

ip4_reass_main_t ip4_reass_main

Definition at line 163 of file ip4_reassembly.c.

static vlib_node_registration_t ip4_reass_node
static
Initial value:
= {
.function = ip4_reassembly,
.name = "ip4-reassembly",
.vector_size = sizeof (u32),
.format_trace = format_ip4_reass_trace,
.error_strings = ip4_reassembly_error_strings,
.n_next_nodes = IP4_REASSEMBLY_N_NEXT,
.next_nodes =
{
[IP4_REASSEMBLY_NEXT_INPUT] = "ip4-input",
[IP4_REASSEMBLY_NEXT_DROP] = "ip4-drop",
},
}
static uword ip4_reassembly(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u8 * format_ip4_reass_trace(u8 *s, va_list *args)
static char * ip4_reassembly_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (ip4_reass_node)

Definition at line 57 of file ip4_reassembly.c.

vlib_node_registration_t ip4_reass_node_feature
static
Initial value:
= {
.name = "ip4-reassembly-feature",
.vector_size = sizeof (u32),
.format_trace = format_ip4_reass_trace,
.error_strings = ip4_reassembly_error_strings,
.n_next_nodes = IP4_REASSEMBLY_N_NEXT,
.next_nodes =
{
[IP4_REASSEMBLY_NEXT_INPUT] = "ip4-input",
[IP4_REASSEMBLY_NEXT_DROP] = "ip4-drop",
},
}
static uword ip4_reassembly_feature(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u8 * format_ip4_reass_trace(u8 *s, va_list *args)
static char * ip4_reassembly_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (ip4_reass_node_feature)

Definition at line 1027 of file ip4_reassembly.c.

char* ip4_reassembly_error_strings[]
static
Initial value:
= {
#define _(sym, string)
}
#define foreach_ip4_error
Definition: ip4_error.h:43

Definition at line 987 of file ip4_reassembly.c.

vlib_cli_command_t show_ip4_reassembly_cmd
static
Initial value:
= {
.path = "show ip4-reassembly",
.short_help = "show ip4-reassembly [details]",
.function = show_ip4_reass,
}
static clib_error_t * show_ip4_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))

(constructor) VLIB_CLI_COMMAND (show_ip4_reassembly_cmd)

Definition at line 1417 of file ip4_reassembly.c.