FD.io VPP  v19.04.4-rc0-5-ge88582fac
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 28 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 43 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 69 of file encap.c.

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

◆ 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 146 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 90 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 114 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)
}
#define foreach_vxlan_gpe_encap_error
Statistics (not really errors)
Definition: encap.c:28

VXLAN GPE encap error strings.

Definition at line 34 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",
},
}
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:146
u8 * format_vxlan_gpe_encap_trace(u8 *s, va_list *args)
Trace of packets encapsulated in VXLAN GPE.
Definition: encap.c:69
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:62
static char * vxlan_gpe_encap_error_strings[]
VXLAN GPE encap error strings.
Definition: encap.c:34

(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node)

Definition at line 407 of file encap.c.