FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
decap.c File Reference

Functions for decapsulating VXLAN GPE tunnels. More...

+ Include dependency graph for decap.c:

Go to the source code of this file.

Data Structures

struct  vxlan_gpe_rx_trace_t
 Struct for VXLAN GPE decap packet tracing. More...
 

Macros

#define vxlan_gpe_error(n, s)   s,
 

Enumerations

enum  ip_vxan_bypass_next_t {
  IP_GENEVE_BYPASS_NEXT_DROP, IP_GENEVE_BYPASS_NEXT_GENEVE, IP_GENEVE_BYPASS_N_NEXT, 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, IP_GTPU_BYPASS_NEXT_DROP, IP_GTPU_BYPASS_NEXT_GTPU, IP_GTPU_BYPASS_N_NEXT
}
 

Functions

static u8format_vxlan_gpe_rx_trace (u8 *s, va_list *args)
 Tracing function for VXLAN GPE packet decapsulation. More...
 
static u8format_vxlan_gpe_with_length (u8 *s, va_list *args)
 Tracing function for VXLAN GPE packet decapsulation including length. More...
 
static uword vxlan_gpe_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip4)
 Common processing for IPv4 and IPv6 VXLAN GPE decap dispatch functions. More...
 
static uword vxlan4_gpe_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for IPv4 VXLAN GPE. More...
 
void vxlan_gpe_register_decap_protocol (u8 protocol_id, uword next_node_index)
 
void vxlan_gpe_unregister_decap_protocol (u8 protocol_id, uword next_node_index)
 
static uword vxlan6_gpe_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for IPv6 VXLAN GPE. More...
 
 VLIB_NODE_FUNCTION_MULTIARCH (vxlan4_gpe_input_node, vxlan4_gpe_input)
 
 VLIB_NODE_FUNCTION_MULTIARCH (vxlan6_gpe_input_node, vxlan6_gpe_input)
 
static uword ip_vxlan_gpe_bypass_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 is_ip4)
 
static uword ip4_vxlan_gpe_bypass (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tip4_vxlan_gpe_bypass_init (vlib_main_t *vm)
 
static uword ip6_vxlan_gpe_bypass (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tip6_vxlan_gpe_bypass_init (vlib_main_t *vm)
 

Variables

vlib_node_registration_t vxlan_gpe_input_node
 
static char * vxlan_gpe_error_strings []
 VXLAN GPE error strings. More...
 
vlib_node_registration_t vxlan4_gpe_input_node
 (constructor) VLIB_REGISTER_NODE (vxlan4_gpe_input_node) More...
 
vlib_node_registration_t vxlan6_gpe_input_node
 (constructor) VLIB_REGISTER_NODE (vxlan6_gpe_input_node) More...
 
vlib_node_registration_t ip4_vxlan_gpe_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip4_vxlan_gpe_bypass_node) More...
 
vlib_node_registration_t ip6_vxlan_gpe_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip6_vxlan_gpe_bypass_node) More...
 

Detailed Description

Functions for decapsulating VXLAN GPE tunnels.

Definition in file decap.c.

Macro Definition Documentation

#define vxlan_gpe_error (   n,
 
)    s,

Enumeration Type Documentation

Enumerator
IP_GENEVE_BYPASS_NEXT_DROP 
IP_GENEVE_BYPASS_NEXT_GENEVE 
IP_GENEVE_BYPASS_N_NEXT 
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 
IP_GTPU_BYPASS_NEXT_DROP 
IP_GTPU_BYPASS_NEXT_GTPU 
IP_GTPU_BYPASS_N_NEXT 

Definition at line 778 of file decap.c.

Function Documentation

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

Tracing function for VXLAN GPE packet decapsulation.

Parameters
*s
*args
Returns
*s

Definition at line 50 of file decap.c.

+ Here is the call graph for this function:

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

Tracing function for VXLAN GPE packet decapsulation including length.

Parameters
*s
*args
Returns
*s

Definition at line 79 of file decap.c.

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

Definition at line 1178 of file decap.c.

+ Here is the call graph for this function:

clib_error_t* ip4_vxlan_gpe_bypass_init ( vlib_main_t vm)

Definition at line 1203 of file decap.c.

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

Definition at line 1211 of file decap.c.

+ Here is the call graph for this function:

clib_error_t* ip6_vxlan_gpe_bypass_init ( vlib_main_t vm)

Definition at line 1236 of file decap.c.

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

Definition at line 786 of file decap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( vxlan4_gpe_input_node  ,
vxlan4_gpe_input   
)
VLIB_NODE_FUNCTION_MULTIARCH ( vxlan6_gpe_input_node  ,
vxlan6_gpe_input   
)
static uword vxlan4_gpe_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for IPv4 VXLAN GPE.

Node Identifier:
vxlan4-gpe-input
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 677 of file decap.c.

+ Here is the call graph for this function:

static uword vxlan6_gpe_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for IPv6 VXLAN GPE.

Node Identifier:
vxlan6-gpe-input
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors - uword

Definition at line 713 of file decap.c.

+ Here is the call graph for this function:

static uword vxlan_gpe_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u8  is_ip4 
)
inlinestatic

Common processing for IPv4 and IPv6 VXLAN GPE decap dispatch functions.

It is worth noting that other than trivial UDP forwarding (transit), VXLAN GPE tunnels are "terminate local". This means that there is no "TX" interface for this decap case, so that field in the buffer_metadata can be "used for something else". The something else in this case is, for the IPv4/IPv6 inner-packet type case, the FIB index used to look up the inner-packet's adjacency.

 vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->decap_fib_index;
Parameters
*vm
*node
*from_frame
is_ip4
Returns
from_frame->n_vectors

ip[46] lookup in the configured FIB

Definition at line 108 of file decap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vxlan_gpe_register_decap_protocol ( u8  protocol_id,
uword  next_node_index 
)

Definition at line 685 of file decap.c.

+ Here is the caller graph for this function:

void vxlan_gpe_unregister_decap_protocol ( u8  protocol_id,
uword  next_node_index 
)

Definition at line 693 of file decap.c.

Variable Documentation

vlib_node_registration_t ip4_vxlan_gpe_bypass_node
Initial value:
= {
.function = ip4_vxlan_gpe_bypass,
.name = "ip4-vxlan-gpe-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-gpe-input",
},
.format_buffer = format_ip4_header,
}
format_function_t format_ip4_header
Definition: format.h:83
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:988
static uword ip4_vxlan_gpe_bypass(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: decap.c:1178

(constructor) VLIB_REGISTER_NODE (ip4_vxlan_gpe_bypass_node)

Definition at line 1185 of file decap.c.

vlib_node_registration_t ip6_vxlan_gpe_bypass_node
Initial value:
= {
.function = ip6_vxlan_gpe_bypass,
.name = "ip6-vxlan-gpe-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-gpe-input",
},
.format_buffer = format_ip6_header,
}
unsigned int u32
Definition: types.h:88
format_function_t format_ip6_header
Definition: format.h:97
static uword ip6_vxlan_gpe_bypass(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: decap.c:1211
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
Definition: ip6_forward.c:768

(constructor) VLIB_REGISTER_NODE (ip6_vxlan_gpe_bypass_node)

Definition at line 1218 of file decap.c.

vlib_node_registration_t vxlan4_gpe_input_node
Initial value:
= {
.function = vxlan4_gpe_input,
.name = "vxlan4-gpe-input",
.vector_size = sizeof (u32),
.error_strings = vxlan_gpe_error_strings,
.n_next_nodes = VXLAN_GPE_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_vxlan_gpe_with_length,
.format_trace = format_vxlan_gpe_rx_trace,
}
static char * vxlan_gpe_error_strings[]
VXLAN GPE error strings.
Definition: decap.c:722
unsigned int u32
Definition: types.h:88
static uword vxlan4_gpe_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for IPv4 VXLAN GPE.
Definition: decap.c:677
#define ARRAY_LEN(x)
Definition: clib.h:61
#define foreach_vxlan_gpe_input_next
next nodes for VXLAN GPE input
Definition: vxlan_gpe.h:171
static u8 * format_vxlan_gpe_with_length(u8 *s, va_list *args)
Tracing function for VXLAN GPE packet decapsulation including length.
Definition: decap.c:79
static u8 * format_vxlan_gpe_rx_trace(u8 *s, va_list *args)
Tracing function for VXLAN GPE packet decapsulation.
Definition: decap.c:50

(constructor) VLIB_REGISTER_NODE (vxlan4_gpe_input_node)

Definition at line 730 of file decap.c.

vlib_node_registration_t vxlan6_gpe_input_node
Initial value:
= {
.function = vxlan6_gpe_input,
.name = "vxlan6-gpe-input",
.vector_size = sizeof (u32),
.error_strings = vxlan_gpe_error_strings,
.n_next_nodes = VXLAN_GPE_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_vxlan_gpe_with_length,
.format_trace = format_vxlan_gpe_rx_trace,
}
static char * vxlan_gpe_error_strings[]
VXLAN GPE error strings.
Definition: decap.c:722
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:61
#define foreach_vxlan_gpe_input_next
next nodes for VXLAN GPE input
Definition: vxlan_gpe.h:171
static u8 * format_vxlan_gpe_with_length(u8 *s, va_list *args)
Tracing function for VXLAN GPE packet decapsulation including length.
Definition: decap.c:79
static uword vxlan6_gpe_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for IPv6 VXLAN GPE.
Definition: decap.c:713
static u8 * format_vxlan_gpe_rx_trace(u8 *s, va_list *args)
Tracing function for VXLAN GPE packet decapsulation.
Definition: decap.c:50

(constructor) VLIB_REGISTER_NODE (vxlan6_gpe_input_node)

Definition at line 755 of file decap.c.

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

VXLAN GPE error strings.

Definition at line 722 of file decap.c.

vlib_node_registration_t vxlan_gpe_input_node

Definition at line 27 of file decap.c.