FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
encap.c File Reference

Functions for encapsulating VXLAN GPE tunnels. More...

+ Include dependency graph for encap.c:

Go to the source code of this file.

Data Structures

struct  vxlan_gpe_encap_trace_t
 Struct for tracing VXLAN GPE encapsulated packets. More...
 

Macros

#define foreach_vxlan_gpe_encap_error   _(ENCAPSULATED, "good packets encapsulated")
 Statistics (not really errors) More...
 

Enumerations

enum  vxlan_gpe_encap_error_t { VXLAN_GPE_ENCAP_N_ERROR }
 Struct for VXLAN GPE errors/counters. More...
 

Functions

u8format_vxlan_gpe_encap_trace (u8 *s, va_list *args)
 Trace of packets encapsulated in VXLAN GPE. More...
 
static void vxlan_gpe_encap_one_inline (vxlan_gpe_main_t *ngm, vlib_buffer_t *b0, vxlan_gpe_tunnel_t *t0, u32 *next0, u8 is_v4)
 Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup. More...
 
static void vxlan_gpe_encap_two_inline (vxlan_gpe_main_t *ngm, vlib_buffer_t *b0, vlib_buffer_t *b1, vxlan_gpe_tunnel_t *t0, vxlan_gpe_tunnel_t *t1, u32 *next0, u32 *next1, u8 is_v4)
 Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup for two packets. More...
 
static uword vxlan_gpe_encap (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Common processing for IPv4 and IPv6 VXLAN GPE encap dispatch functions. More...
 

Variables

static char * vxlan_gpe_encap_error_strings []
 VXLAN GPE encap error strings. More...
 
vlib_node_registration_t vxlan_gpe_encap_node
 (constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node) More...
 

Detailed Description

Functions for encapsulating VXLAN GPE tunnels.

Definition in file encap.c.

Macro Definition Documentation

◆ foreach_vxlan_gpe_encap_error

#define foreach_vxlan_gpe_encap_error   _(ENCAPSULATED, "good packets encapsulated")

Statistics (not really errors)

Definition at line 29 of file encap.c.

Enumeration Type Documentation

◆ vxlan_gpe_encap_error_t

Struct for VXLAN GPE errors/counters.

Enumerator
VXLAN_GPE_ENCAP_N_ERROR 

Definition at line 44 of file encap.c.

Function Documentation

◆ format_vxlan_gpe_encap_trace()

u8* format_vxlan_gpe_encap_trace ( u8 s,
va_list *  args 
)

Trace of packets encapsulated in VXLAN GPE.

Parameters
*s
*args
Returns
*s

Definition at line 70 of file encap.c.

◆ vxlan_gpe_encap()

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

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

It is worth noting that other than trivial UDP forwarding (transit), VXLAN GPE tunnels are "establish local". This means that we don't have a TX interface as yet as we need to look up where the outer-header dest is. By setting the TX index in the buffer metadata to the encap FIB, we can do a lookup to get the adjacency and real TX.

 vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->encap_fib_index;
Node Identifier:
vxlan-gpe-input
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 147 of file encap.c.

+ Here is the call graph for this function:

◆ vxlan_gpe_encap_one_inline()

static void vxlan_gpe_encap_one_inline ( vxlan_gpe_main_t ngm,
vlib_buffer_t b0,
vxlan_gpe_tunnel_t t0,
u32 next0,
u8  is_v4 
)
inlinestatic

Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup.

Parameters
*ngm
*b0
*t0contains rewrite header
*next0relative index of next dispatch function (next node)
is_v4Is this IPv4? (or IPv6)

Definition at line 91 of file encap.c.

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

◆ vxlan_gpe_encap_two_inline()

static void vxlan_gpe_encap_two_inline ( vxlan_gpe_main_t ngm,
vlib_buffer_t b0,
vlib_buffer_t b1,
vxlan_gpe_tunnel_t t0,
vxlan_gpe_tunnel_t t1,
u32 next0,
u32 next1,
u8  is_v4 
)
inlinestatic

Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup for two packets.

Parameters
*ngm
*b0Packet0
*b1Packet1
*t0contains rewrite header for Packet0
*t1contains rewrite header for Packet1
*next0relative index of next dispatch function (next node) for Packet0
*next1relative index of next dispatch function (next node) for Packet1
is_v4Is this IPv4? (or IPv6)

Definition at line 115 of file encap.c.

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

Variable Documentation

◆ vxlan_gpe_encap_error_strings

char* vxlan_gpe_encap_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

VXLAN GPE encap error strings.

Definition at line 35 of file encap.c.

◆ vxlan_gpe_encap_node

vlib_node_registration_t vxlan_gpe_encap_node
Initial value:
= {
.function = vxlan_gpe_encap,
.name = "vxlan-gpe-encap",
.vector_size = sizeof (u32),
.n_next_nodes = VXLAN_GPE_ENCAP_N_NEXT,
.next_nodes = {
[VXLAN_GPE_ENCAP_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node)

Definition at line 403 of file encap.c.

VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
vxlan_gpe_encap
static uword vxlan_gpe_encap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Common processing for IPv4 and IPv6 VXLAN GPE encap dispatch functions.
Definition: encap.c:147
vxlan_gpe_encap_error_strings
static char * vxlan_gpe_encap_error_strings[]
VXLAN GPE encap error strings.
Definition: encap.c:35
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP
@ VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP
Definition: vxlan_gpe.h:269
VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP
@ VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP
Definition: vxlan_gpe.h:268
VXLAN_GPE_ENCAP_N_NEXT
@ VXLAN_GPE_ENCAP_N_NEXT
Definition: vxlan_gpe.h:271
format_vxlan_gpe_encap_trace
u8 * format_vxlan_gpe_encap_trace(u8 *s, va_list *args)
Trace of packets encapsulated in VXLAN GPE.
Definition: encap.c:70
u32
unsigned int u32
Definition: types.h:88
VXLAN_GPE_ENCAP_NEXT_DROP
@ VXLAN_GPE_ENCAP_NEXT_DROP
Definition: vxlan_gpe.h:270
foreach_vxlan_gpe_encap_error
#define foreach_vxlan_gpe_encap_error
Statistics (not really errors)
Definition: encap.c:29
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123