FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
decap.c File Reference
+ Include dependency graph for decap.c:

Go to the source code of this file.

Data Structures

struct  vxlan_rx_trace_t
 

Macros

#define vxlan_error(n, s)   s,
 
#define foreach_vxlan_flow_input_next
 
#define foreach_vxlan_flow_error
 

Typedefs

typedef vxlan4_tunnel_key_t last_tunnel_cache4
 
typedef vxlan6_tunnel_key_t last_tunnel_cache6
 

Enumerations

enum  ip_vxlan_bypass_next_t {
  IP_VXLAN_BYPASS_NEXT_DROP, IP_VXLAN_BYPASS_NEXT_VXLAN, IP_VXLAN_BYPASS_N_NEXT, IP_VXLAN_BYPASS_NEXT_DROP,
  IP_VXLAN_BYPASS_NEXT_VXLAN, IP_VXLAN_BYPASS_N_NEXT
}
 
enum  vxlan_flow_input_next_t { VXLAN_FLOW_N_NEXT }
 
enum  vxlan_flow_error_t { VXLAN_FLOW_N_ERROR }
 

Functions

static u8format_vxlan_rx_trace (u8 *s, va_list *args)
 
static vxlan_decap_info_t vxlan4_find_tunnel (vxlan_main_t *vxm, last_tunnel_cache4 *cache, u32 fib_index, ip4_header_t *ip4_0, vxlan_header_t *vxlan0, u32 *stats_sw_if_index)
 
static vxlan_decap_info_t vxlan6_find_tunnel (vxlan_main_t *vxm, last_tunnel_cache6 *cache, u32 fib_index, ip6_header_t *ip6_0, vxlan_header_t *vxlan0, u32 *stats_sw_if_index)
 
static uword vxlan_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u32 is_ip4)
 
VLIB_NODE_FN() vxlan4_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() vxlan6_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ip_vxlan_bypass_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 is_ip4)
 
VLIB_NODE_FN() ip4_vxlan_bypass_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static clib_error_tip4_vxlan_bypass_init (vlib_main_t *vm)
 
VLIB_NODE_FN() ip6_vxlan_bypass_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static clib_error_tip6_vxlan_bypass_init (vlib_main_t *vm)
 
static_always_inline u8 vxlan_validate_udp_csum (vlib_main_t *vm, vlib_buffer_t *b)
 
static_always_inline u8 vxlan_check_udp_csum (vlib_main_t *vm, vlib_buffer_t *b)
 
static_always_inline u8 vxlan_check_ip (vlib_buffer_t *b, u16 payload_len)
 
static_always_inline u8 vxlan_check_ip_udp_len (vlib_buffer_t *b)
 
static_always_inline u8 vxlan_err_code (u8 ip_err0, u8 udp_err0, u8 csum_err0)
 
VLIB_NODE_FN() vxlan4_flow_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 

Variables

vlib_node_registration_t vxlan4_input_node
 (constructor) VLIB_REGISTER_NODE (vxlan4_input_node) More...
 
vlib_node_registration_t vxlan6_input_node
 (constructor) VLIB_REGISTER_NODE (vxlan6_input_node) More...
 
static const vxlan_decap_info_t decap_not_found
 
static const vxlan_decap_info_t decap_bad_flags
 
static char * vxlan_error_strings []
 
vlib_node_registration_t ip4_vxlan_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip4_vxlan_bypass_node) More...
 
vlib_node_registration_t ip6_vxlan_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip6_vxlan_bypass_node) More...
 
static char * vxlan_flow_error_strings []
 
vlib_node_registration_t vxlan4_flow_input_node
 (constructor) VLIB_REGISTER_NODE (vxlan4_flow_input_node) More...
 

Macro Definition Documentation

◆ foreach_vxlan_flow_error

#define foreach_vxlan_flow_error
Value:
_(NONE, "no error") \
_(IP_CHECKSUM_ERROR, "Rx ip checksum errors") \
_(IP_HEADER_ERROR, "Rx ip header errors") \
_(UDP_CHECKSUM_ERROR, "Rx udp checksum errors") \
_(UDP_LENGTH_ERROR, "Rx udp length errors")

Definition at line 947 of file decap.c.

◆ foreach_vxlan_flow_input_next

#define foreach_vxlan_flow_input_next
Value:
_(DROP, "error-drop") \
_(L2_INPUT, "l2-input")

Definition at line 935 of file decap.c.

◆ vxlan_error

#define vxlan_error (   n,
 
)    s,

Typedef Documentation

◆ last_tunnel_cache4

Definition at line 49 of file decap.c.

◆ last_tunnel_cache6

Definition at line 123 of file decap.c.

Enumeration Type Documentation

◆ ip_vxlan_bypass_next_t

Enumerator
IP_VXLAN_BYPASS_NEXT_DROP 
IP_VXLAN_BYPASS_NEXT_VXLAN 
IP_VXLAN_BYPASS_N_NEXT 
IP_VXLAN_BYPASS_NEXT_DROP 
IP_VXLAN_BYPASS_NEXT_VXLAN 
IP_VXLAN_BYPASS_N_NEXT 

Definition at line 447 of file decap.c.

◆ vxlan_flow_error_t

Enumerator
VXLAN_FLOW_N_ERROR 

Definition at line 954 of file decap.c.

◆ vxlan_flow_input_next_t

Enumerator
VXLAN_FLOW_N_NEXT 

Definition at line 939 of file decap.c.

Function Documentation

◆ format_vxlan_rx_trace()

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

Definition at line 36 of file decap.c.

◆ ip4_vxlan_bypass_init()

static clib_error_t* ip4_vxlan_bypass_init ( vlib_main_t vm)
static

Definition at line 896 of file decap.c.

◆ ip4_vxlan_bypass_node()

VLIB_NODE_FN() ip4_vxlan_bypass_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 871 of file decap.c.

+ Here is the call graph for this function:

◆ ip6_vxlan_bypass_init()

static clib_error_t* ip6_vxlan_bypass_init ( vlib_main_t vm)
static

Definition at line 928 of file decap.c.

◆ ip6_vxlan_bypass_node()

VLIB_NODE_FN() ip6_vxlan_bypass_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 903 of file decap.c.

+ Here is the call graph for this function:

◆ ip_vxlan_bypass_inline()

static uword ip_vxlan_bypass_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u32  is_ip4 
)
inlinestatic

Definition at line 455 of file decap.c.

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

◆ vxlan4_find_tunnel()

static vxlan_decap_info_t vxlan4_find_tunnel ( vxlan_main_t vxm,
last_tunnel_cache4 cache,
u32  fib_index,
ip4_header_t ip4_0,
vxlan_header_t vxlan0,
u32 stats_sw_if_index 
)
inlinestatic

Definition at line 64 of file decap.c.

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

◆ vxlan4_flow_input_node()

VLIB_NODE_FN() vxlan4_flow_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)

Definition at line 1033 of file decap.c.

+ Here is the call graph for this function:

◆ vxlan4_input_node()

VLIB_NODE_FN() vxlan4_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 395 of file decap.c.

+ Here is the call graph for this function:

◆ vxlan6_find_tunnel()

static vxlan_decap_info_t vxlan6_find_tunnel ( vxlan_main_t vxm,
last_tunnel_cache6 cache,
u32  fib_index,
ip6_header_t ip6_0,
vxlan_header_t vxlan0,
u32 stats_sw_if_index 
)
inlinestatic

Definition at line 126 of file decap.c.

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

◆ vxlan6_input_node()

VLIB_NODE_FN() vxlan6_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 402 of file decap.c.

+ Here is the call graph for this function:

◆ vxlan_check_ip()

static_always_inline u8 vxlan_check_ip ( vlib_buffer_t b,
u16  payload_len 
)

Definition at line 1002 of file decap.c.

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

◆ vxlan_check_ip_udp_len()

static_always_inline u8 vxlan_check_ip_udp_len ( vlib_buffer_t b)

Definition at line 1012 of file decap.c.

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

◆ vxlan_check_udp_csum()

static_always_inline u8 vxlan_check_udp_csum ( vlib_main_t vm,
vlib_buffer_t b 
)

Definition at line 990 of file decap.c.

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

◆ vxlan_err_code()

static_always_inline u8 vxlan_err_code ( u8  ip_err0,
u8  udp_err0,
u8  csum_err0 
)

Definition at line 1021 of file decap.c.

+ Here is the caller graph for this function:

◆ vxlan_input()

static uword vxlan_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u32  is_ip4 
)
inlinestatic

Definition at line 184 of file decap.c.

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

◆ vxlan_validate_udp_csum()

static_always_inline u8 vxlan_validate_udp_csum ( vlib_main_t vm,
vlib_buffer_t b 
)

Definition at line 970 of file decap.c.

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

Variable Documentation

◆ decap_bad_flags

const vxlan_decap_info_t decap_bad_flags
static
Initial value:
= {
.sw_if_index = ~0,
.next_index = VXLAN_INPUT_NEXT_DROP,
.error = VXLAN_ERROR_BAD_FLAGS
}

Definition at line 57 of file decap.c.

◆ decap_not_found

const vxlan_decap_info_t decap_not_found
static
Initial value:
= {
.sw_if_index = ~0,
.next_index = VXLAN_INPUT_NEXT_DROP,
.error = VXLAN_ERROR_NO_SUCH_TUNNEL
}

Definition at line 51 of file decap.c.

◆ ip4_vxlan_bypass_node

vlib_node_registration_t ip4_vxlan_bypass_node
Initial value:
=
{
.name = "ip4-vxlan-bypass",
.vector_size = sizeof (u32),
.n_next_nodes = IP_VXLAN_BYPASS_N_NEXT,
.next_nodes = {
[IP_VXLAN_BYPASS_NEXT_DROP] = "error-drop",
[IP_VXLAN_BYPASS_NEXT_VXLAN] = "vxlan4-input",
},
.format_buffer = format_ip4_header,
}

(constructor) VLIB_REGISTER_NODE (ip4_vxlan_bypass_node)

Definition at line 879 of file decap.c.

◆ ip6_vxlan_bypass_node

vlib_node_registration_t ip6_vxlan_bypass_node
Initial value:
=
{
.name = "ip6-vxlan-bypass",
.vector_size = sizeof (u32),
.n_next_nodes = IP_VXLAN_BYPASS_N_NEXT,
.next_nodes = {
[IP_VXLAN_BYPASS_NEXT_DROP] = "error-drop",
[IP_VXLAN_BYPASS_NEXT_VXLAN] = "vxlan6-input",
},
.format_buffer = format_ip6_header,
}

(constructor) VLIB_REGISTER_NODE (ip6_vxlan_bypass_node)

Definition at line 911 of file decap.c.

◆ vxlan4_flow_input_node

vlib_node_registration_t vxlan4_flow_input_node
Initial value:
= {
.name = "vxlan-flow-input",
.vector_size = sizeof (u32),
.format_trace = format_vxlan_rx_trace,
.n_errors = VXLAN_FLOW_N_ERROR,
.error_strings = vxlan_flow_error_strings,
.n_next_nodes = VXLAN_FLOW_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (vxlan4_flow_input_node)

Definition at line 1304 of file decap.c.

◆ vxlan4_input_node

vlib_node_registration_t vxlan4_input_node
Initial value:
=
{
.name = "vxlan4-input",
.vector_size = sizeof (u32),
.n_errors = VXLAN_N_ERROR,
.error_strings = vxlan_error_strings,
.n_next_nodes = VXLAN_INPUT_N_NEXT,
.format_trace = format_vxlan_rx_trace,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (vxlan4_input_node)

Definition at line 23 of file decap.c.

◆ vxlan6_input_node

vlib_node_registration_t vxlan6_input_node
Initial value:
=
{
.name = "vxlan6-input",
.vector_size = sizeof (u32),
.n_errors = VXLAN_N_ERROR,
.error_strings = vxlan_error_strings,
.n_next_nodes = VXLAN_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_vxlan_rx_trace,
}

(constructor) VLIB_REGISTER_NODE (vxlan6_input_node)

Definition at line 24 of file decap.c.

◆ vxlan_error_strings

char* vxlan_error_strings[]
static
Initial value:
= {
#define vxlan_error(n,s)
}

Definition at line 409 of file decap.c.

◆ vxlan_flow_error_strings

char* vxlan_flow_error_strings[]
static
Initial value:
= {
#define _(n,s)
}

Definition at line 962 of file decap.c.

DROP
DROP
Definition: error.def:41
format_ip6_header
format_function_t format_ip6_header
Definition: format.h:95
IP_VXLAN_BYPASS_NEXT_DROP
@ IP_VXLAN_BYPASS_NEXT_DROP
Definition: decap.c:449
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
IP_VXLAN_BYPASS_N_NEXT
@ IP_VXLAN_BYPASS_N_NEXT
Definition: decap.c:451
VXLAN_N_ERROR
@ VXLAN_N_ERROR
Definition: vxlan.h:157
format_ip4_forward_next_trace
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1190
VXLAN_INPUT_N_NEXT
@ VXLAN_INPUT_N_NEXT
Definition: vxlan.h:149
format_vxlan_rx_trace
static u8 * format_vxlan_rx_trace(u8 *s, va_list *args)
Definition: decap.c:36
VXLAN_FLOW_N_NEXT
@ VXLAN_FLOW_N_NEXT
Definition: decap.c:944
IP_VXLAN_BYPASS_NEXT_VXLAN
@ IP_VXLAN_BYPASS_NEXT_VXLAN
Definition: decap.c:450
foreach_vxlan_input_next
#define foreach_vxlan_input_next
Definition: vxlan.h:140
vxlan_flow_error_strings
static char * vxlan_flow_error_strings[]
Definition: decap.c:962
u32
unsigned int u32
Definition: types.h:88
format_ip4_header
format_function_t format_ip4_header
Definition: format.h:81
foreach_vxlan_flow_error
#define foreach_vxlan_flow_error
Definition: decap.c:947
VXLAN_FLOW_N_ERROR
@ VXLAN_FLOW_N_ERROR
Definition: decap.c:959
vxlan_error_strings
static char * vxlan_error_strings[]
Definition: decap.c:409
format_ip6_forward_next_trace
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
Definition: ip6_forward.c:951
foreach_vxlan_flow_input_next
#define foreach_vxlan_flow_input_next
Definition: decap.c:935