FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
gtpu_decap.c File Reference
+ Include dependency graph for gtpu_decap.c:

Go to the source code of this file.

Data Structures

struct  gtpu_rx_trace_t
 

Macros

#define gtpu_error(n, s)   s,
 
#define foreach_gtpu_flow_error
 
#define gtpu_error(n, s)   GTPU_FLOW_ERROR_##n,
 
#define gtpu_error(n, s)   s,
 
#define gtpu_local_need_csum_check(_b)
 
#define gtpu_local_csum_is_valid(_b)
 

Enumerations

enum  ip_vxan_bypass_next_t {
  IP_GENEVE_BYPASS_NEXT_DROP, IP_GENEVE_BYPASS_NEXT_GENEVE, IP_GENEVE_BYPASS_N_NEXT, IP_GTPU_BYPASS_NEXT_DROP,
  IP_GTPU_BYPASS_NEXT_GTPU, IP_GTPU_BYPASS_N_NEXT
}
 
enum  gtpu_flow_error_t { GTPU_FLOW_N_ERROR }
 

Functions

static u8format_gtpu_rx_trace (u8 *s, va_list *args)
 
static u32 validate_gtpu_fib (vlib_buffer_t *b, gtpu_tunnel_t *t, u32 is_ip4)
 
static uword gtpu_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u32 is_ip4)
 
VLIB_NODE_FN() gtpu4_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() gtpu6_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ip_gtpu_bypass_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 is_ip4)
 
VLIB_NODE_FN() ip4_gtpu_bypass_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tip4_gtpu_bypass_init (vlib_main_t *vm)
 
VLIB_NODE_FN() ip6_gtpu_bypass_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tip6_gtpu_bypass_init (vlib_main_t *vm)
 
static_always_inline u8 gtpu_validate_udp_csum (vlib_main_t *vm, vlib_buffer_t *b)
 
static_always_inline u8 gtpu_check_ip (vlib_buffer_t *b, u16 payload_len)
 
static_always_inline u8 gtpu_check_ip_udp_len (vlib_buffer_t *b)
 
static_always_inline u8 gtpu_err_code (u8 ip_err0, u8 udp_err0, u8 csum_err0)
 
static uword gtpu_flow_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() gtpu4_flow_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 

Variables

vlib_node_registration_t gtpu4_input_node
 (constructor) VLIB_REGISTER_NODE (gtpu4_input_node) More...
 
vlib_node_registration_t gtpu6_input_node
 (constructor) VLIB_REGISTER_NODE (gtpu6_input_node) More...
 
static char * gtpu_error_strings []
 
vlib_node_registration_t ip4_gtpu_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip4_gtpu_bypass_node) More...
 
vlib_node_registration_t ip6_gtpu_bypass_node
 (constructor) VLIB_REGISTER_NODE (ip6_gtpu_bypass_node) More...
 
static char * gtpu_flow_error_strings []
 
vlib_node_registration_t gtpu4_flow_input_node
 (constructor) VLIB_REGISTER_NODE (gtpu4_flow_input_node) More...
 

Macro Definition Documentation

◆ foreach_gtpu_flow_error

#define foreach_gtpu_flow_error
Value:
_(NONE, "no error") \
_(PAYLOAD_ERROR, "Payload type errors") \
_(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 1226 of file gtpu_decap.c.

◆ gtpu_error [1/3]

#define gtpu_error (   n,
 
)    s,

Definition at line 1239 of file gtpu_decap.c.

◆ gtpu_error [2/3]

#define gtpu_error (   n,
 
)    GTPU_FLOW_ERROR_##n,

Definition at line 1239 of file gtpu_decap.c.

◆ gtpu_error [3/3]

#define gtpu_error (   n,
 
)    s,

Definition at line 1239 of file gtpu_decap.c.

◆ gtpu_local_csum_is_valid

#define gtpu_local_csum_is_valid (   _b)
Value:
((_b->flags & VNET_BUFFER_F_L4_CHECKSUM_CORRECT || \
(_b->flags & VNET_BUFFER_F_OFFLOAD && \
vnet_buffer (_b)->oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)) != 0)

Definition at line 1261 of file gtpu_decap.c.

◆ gtpu_local_need_csum_check

#define gtpu_local_need_csum_check (   _b)
Value:
(!(_b->flags & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED || \
(_b->flags & VNET_BUFFER_F_OFFLOAD && \
vnet_buffer (_b)->oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)))

Definition at line 1256 of file gtpu_decap.c.

Enumeration Type Documentation

◆ gtpu_flow_error_t

Enumerator
GTPU_FLOW_N_ERROR 

Definition at line 1234 of file gtpu_decap.c.

◆ ip_vxan_bypass_next_t

Enumerator
IP_GENEVE_BYPASS_NEXT_DROP 
IP_GENEVE_BYPASS_NEXT_GENEVE 
IP_GENEVE_BYPASS_N_NEXT 
IP_GTPU_BYPASS_NEXT_DROP 
IP_GTPU_BYPASS_NEXT_GTPU 
IP_GTPU_BYPASS_N_NEXT 

Definition at line 787 of file gtpu_decap.c.

Function Documentation

◆ format_gtpu_rx_trace()

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

Definition at line 31 of file gtpu_decap.c.

◆ gtpu4_flow_input_node()

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

Definition at line 1728 of file gtpu_decap.c.

+ Here is the call graph for this function:

◆ gtpu4_input_node()

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

Definition at line 726 of file gtpu_decap.c.

+ Here is the call graph for this function:

◆ gtpu6_input_node()

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

Definition at line 733 of file gtpu_decap.c.

+ Here is the call graph for this function:

◆ gtpu_check_ip()

static_always_inline u8 gtpu_check_ip ( vlib_buffer_t b,
u16  payload_len 
)

Definition at line 1284 of file gtpu_decap.c.

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

◆ gtpu_check_ip_udp_len()

static_always_inline u8 gtpu_check_ip_udp_len ( vlib_buffer_t b)

Definition at line 1294 of file gtpu_decap.c.

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

◆ gtpu_err_code()

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

Definition at line 1305 of file gtpu_decap.c.

+ Here is the caller graph for this function:

◆ gtpu_flow_input()

static uword gtpu_flow_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
inlinestatic

Definition at line 1319 of file gtpu_decap.c.

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

◆ gtpu_input()

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

Definition at line 57 of file gtpu_decap.c.

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

◆ gtpu_validate_udp_csum()

static_always_inline u8 gtpu_validate_udp_csum ( vlib_main_t vm,
vlib_buffer_t b 
)

Definition at line 1267 of file gtpu_decap.c.

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

◆ ip4_gtpu_bypass_init()

clib_error_t* ip4_gtpu_bypass_init ( vlib_main_t vm)

Definition at line 1192 of file gtpu_decap.c.

◆ ip4_gtpu_bypass_node()

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

Definition at line 1169 of file gtpu_decap.c.

+ Here is the call graph for this function:

◆ ip6_gtpu_bypass_init()

clib_error_t* ip6_gtpu_bypass_init ( vlib_main_t vm)

Definition at line 1221 of file gtpu_decap.c.

◆ ip6_gtpu_bypass_node()

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

Definition at line 1198 of file gtpu_decap.c.

+ Here is the call graph for this function:

◆ ip_gtpu_bypass_inline()

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

Definition at line 794 of file gtpu_decap.c.

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

◆ validate_gtpu_fib()

static u32 validate_gtpu_fib ( vlib_buffer_t b,
gtpu_tunnel_t t,
u32  is_ip4 
)
inlinestatic

Definition at line 51 of file gtpu_decap.c.

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

Variable Documentation

◆ gtpu4_flow_input_node

vlib_node_registration_t gtpu4_flow_input_node
Initial value:
= {
.name = "gtpu4-flow-input",
.vector_size = sizeof (u32),
.format_trace = format_gtpu_rx_trace,
.n_errors = GTPU_FLOW_N_ERROR,
.error_strings = gtpu_flow_error_strings,
.n_next_nodes = GTPU_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (gtpu4_flow_input_node)

Definition at line 1738 of file gtpu_decap.c.

◆ gtpu4_input_node

vlib_node_registration_t gtpu4_input_node
Initial value:
= {
.name = "gtpu4-input",
.vector_size = sizeof (u32),
.n_errors = GTPU_N_ERROR,
.error_strings = gtpu_error_strings,
.n_next_nodes = GTPU_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_gtpu_rx_trace,
}

(constructor) VLIB_REGISTER_NODE (gtpu4_input_node)

Definition at line 747 of file gtpu_decap.c.

◆ gtpu6_input_node

vlib_node_registration_t gtpu6_input_node
Initial value:
= {
.name = "gtpu6-input",
.vector_size = sizeof (u32),
.n_errors = GTPU_N_ERROR,
.error_strings = gtpu_error_strings,
.n_next_nodes = GTPU_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_gtpu_rx_trace,
}

(constructor) VLIB_REGISTER_NODE (gtpu6_input_node)

Definition at line 767 of file gtpu_decap.c.

◆ gtpu_error_strings

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

Definition at line 740 of file gtpu_decap.c.

◆ gtpu_flow_error_strings

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

Definition at line 1245 of file gtpu_decap.c.

◆ ip4_gtpu_bypass_node

vlib_node_registration_t ip4_gtpu_bypass_node
Initial value:
= {
.name = "ip4-gtpu-bypass",
.vector_size = sizeof (u32),
.n_next_nodes = IP_GTPU_BYPASS_N_NEXT,
.next_nodes = {
[IP_GTPU_BYPASS_NEXT_DROP] = "error-drop",
[IP_GTPU_BYPASS_NEXT_GTPU] = "gtpu4-input",
},
.format_buffer = format_ip4_header,
}

(constructor) VLIB_REGISTER_NODE (ip4_gtpu_bypass_node)

Definition at line 1176 of file gtpu_decap.c.

◆ ip6_gtpu_bypass_node

vlib_node_registration_t ip6_gtpu_bypass_node
Initial value:
= {
.name = "ip6-gtpu-bypass",
.vector_size = sizeof (u32),
.n_next_nodes = IP_GTPU_BYPASS_N_NEXT,
.next_nodes = {
[IP_GTPU_BYPASS_NEXT_DROP] = "error-drop",
[IP_GTPU_BYPASS_NEXT_GTPU] = "gtpu6-input",
},
.format_buffer = format_ip6_header,
}

(constructor) VLIB_REGISTER_NODE (ip6_gtpu_bypass_node)

Definition at line 1205 of file gtpu_decap.c.

foreach_gtpu_flow_error
#define foreach_gtpu_flow_error
Definition: gtpu_decap.c:1226
format_ip6_header
format_function_t format_ip6_header
Definition: format.h:95
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
foreach_gtpu_input_next
#define foreach_gtpu_input_next
Definition: gtpu.h:183
IP_GTPU_BYPASS_NEXT_GTPU
@ IP_GTPU_BYPASS_NEXT_GTPU
Definition: gtpu_decap.c:789
IP_GTPU_BYPASS_N_NEXT
@ IP_GTPU_BYPASS_N_NEXT
Definition: gtpu_decap.c:790
format_ip4_forward_next_trace
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1189
gtpu_flow_error_strings
static char * gtpu_flow_error_strings[]
Definition: gtpu_decap.c:1245
GTPU_INPUT_N_NEXT
@ GTPU_INPUT_N_NEXT
Definition: gtpu.h:194
u32
unsigned int u32
Definition: types.h:88
format_ip4_header
format_function_t format_ip4_header
Definition: format.h:81
format_gtpu_rx_trace
static u8 * format_gtpu_rx_trace(u8 *s, va_list *args)
Definition: gtpu_decap.c:31
gtpu_error_strings
static char * gtpu_error_strings[]
Definition: gtpu_decap.c:740
GTPU_FLOW_N_ERROR
@ GTPU_FLOW_N_ERROR
Definition: gtpu_decap.c:1242
IP_GTPU_BYPASS_NEXT_DROP
@ IP_GTPU_BYPASS_NEXT_DROP
Definition: gtpu_decap.c:788
GTPU_N_ERROR
@ GTPU_N_ERROR
Definition: gtpu.h:202
format_ip6_forward_next_trace
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
Definition: ip6_forward.c:949