FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
gtpu.c File Reference
+ Include dependency graph for gtpu.c:

Go to the source code of this file.

Macros

#define foreach_copy_field
 

Functions

 VNET_FEATURE_INIT (ip4_gtpu_bypass, static)
 
 VNET_FEATURE_INIT (ip6_gtpu_bypass, static)
 
u8format_gtpu_encap_trace (u8 *s, va_list *args)
 
static u8format_decap_next (u8 *s, va_list *args)
 
u8format_gtpu_tunnel (u8 *s, va_list *args)
 
static u8format_gtpu_name (u8 *s, va_list *args)
 
static clib_error_tgtpu_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_DEVICE_CLASS (gtpu_device_class, static)
 
static u8format_gtpu_header_with_length (u8 *s, va_list *args)
 
 VNET_HW_INTERFACE_CLASS (gtpu_hw_class)
 
static void gtpu_tunnel_restack_dpo (gtpu_tunnel_t *t)
 
static gtpu_tunnel_tgtpu_tunnel_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t gtpu_tunnel_back_walk (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 Function definition to backwalk a FIB node - Here we will restack the new dpo of GTPU DIP to encap node. More...
 
static fib_node_tgtpu_tunnel_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void gtpu_tunnel_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
static void ip_udp_gtpu_rewrite (gtpu_tunnel_t *t, bool is_ip6)
 
static bool gtpu_decap_next_is_valid (gtpu_main_t *gtm, u32 is_ip6, u32 decap_next_index)
 
typedef CLIB_PACKED (union { struct { fib_node_index_t mfib_entry_index;adj_index_t mcast_adj_index;};u64 as_u64;})
 
static void mcast_shared_add (ip46_address_t *dst, fib_node_index_t mfei, adj_index_t ai)
 
static void mcast_shared_remove (ip46_address_t *dst)
 
int vnet_gtpu_add_mod_del_tunnel (vnet_gtpu_add_mod_del_tunnel_args_t *a, u32 *sw_if_indexp)
 
static uword get_decap_next_for_node (u32 node_index, u32 ipv4_set)
 
static uword unformat_decap_next (unformat_input_t *input, va_list *args)
 
static clib_error_tgtpu_add_del_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_gtpu_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void vnet_int_gtpu_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable)
 
static clib_error_tset_ip_gtpu_bypass (u32 is_ip6, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip4_gtpu_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip6_gtpu_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int vnet_gtpu_add_del_rx_flow (u32 hw_if_index, u32 t_index, int is_add)
 
u32 vnet_gtpu_get_tunnel_index (u32 sw_if_index)
 
static clib_error_tgtpu_offload_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tgtpu_init (vlib_main_t *vm)
 
 VLIB_PLUGIN_REGISTER ()
 

Variables

gtpu_main_t gtpu_main
 
static const fib_node_vft_t gtpu_vft
 
static vlib_cli_command_t create_gtpu_tunnel_command
 (constructor) VLIB_CLI_COMMAND (create_gtpu_tunnel_command) More...
 
static vlib_cli_command_t show_gtpu_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_gtpu_tunnel_command) More...
 
static vlib_cli_command_t set_interface_ip_gtpu_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_gtpu_bypass_command) More...
 
static vlib_cli_command_t set_interface_ip6_gtpu_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip6_gtpu_bypass_command) More...
 
static vlib_cli_command_t gtpu_offload_command
 (constructor) VLIB_CLI_COMMAND (gtpu_offload_command) More...
 

Macro Definition Documentation

◆ foreach_copy_field

#define foreach_copy_field
Value:
_(teid) \
_(tteid) \
_(encap_fib_index) \
_(decap_next_index) \
_(src) \
_(dst)
vl_api_address_t src
Definition: gre.api:54
vl_api_interface_index_t mcast_sw_if_index
Definition: vxlan_gbp.api:41
vl_api_address_t dst
Definition: gre.api:55
u32 teid
Definition: flow_types.api:182

Definition at line 228 of file gtpu.c.

Function Documentation

◆ CLIB_PACKED()

typedef CLIB_PACKED ( union { struct { fib_node_index_t mfib_entry_index;adj_index_t mcast_adj_index;};u64 as_u64;}  )

Definition at line 310 of file gtpu.c.

+ Here is the call graph for this function:

◆ format_decap_next()

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

Definition at line 65 of file gtpu.c.

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

◆ format_gtpu_encap_trace()

u8* format_gtpu_encap_trace ( u8 s,
va_list *  args 
)

Definition at line 52 of file gtpu.c.

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

◆ format_gtpu_header_with_length()

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

Definition at line 141 of file gtpu.c.

+ Here is the call graph for this function:

◆ format_gtpu_name()

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

Definition at line 115 of file gtpu.c.

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

◆ format_gtpu_tunnel()

u8* format_gtpu_tunnel ( u8 s,
va_list *  args 
)

Definition at line 86 of file gtpu.c.

+ Here is the call graph for this function:

◆ get_decap_next_for_node()

static uword get_decap_next_for_node ( u32  node_index,
u32  ipv4_set 
)
static

Definition at line 638 of file gtpu.c.

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

◆ gtpu_add_del_tunnel_command_fn()

static clib_error_t* gtpu_add_del_tunnel_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 675 of file gtpu.c.

+ Here is the call graph for this function:

◆ gtpu_decap_next_is_valid()

static bool gtpu_decap_next_is_valid ( gtpu_main_t gtm,
u32  is_ip6,
u32  decap_next_index 
)
static

Definition at line 301 of file gtpu.c.

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

◆ gtpu_init()

clib_error_t* gtpu_init ( vlib_main_t vm)

Definition at line 1244 of file gtpu.c.

+ Here is the call graph for this function:

◆ gtpu_interface_admin_up_down()

static clib_error_t* gtpu_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 122 of file gtpu.c.

+ Here is the call graph for this function:

◆ gtpu_offload_command_fn()

static clib_error_t* gtpu_offload_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1163 of file gtpu.c.

+ Here is the call graph for this function:

◆ gtpu_tunnel_back_walk()

static fib_node_back_walk_rc_t gtpu_tunnel_back_walk ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Function definition to backwalk a FIB node - Here we will restack the new dpo of GTPU DIP to encap node.

Definition at line 184 of file gtpu.c.

+ Here is the call graph for this function:

◆ gtpu_tunnel_fib_node_get()

static fib_node_t* gtpu_tunnel_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 194 of file gtpu.c.

◆ gtpu_tunnel_from_fib_node()

static gtpu_tunnel_t* gtpu_tunnel_from_fib_node ( fib_node_t node)
static

Definition at line 173 of file gtpu.c.

+ Here is the caller graph for this function:

◆ gtpu_tunnel_last_lock_gone()

static void gtpu_tunnel_last_lock_gone ( fib_node_t node)
static

Function definition to inform the FIB node that its last lock has gone.

Definition at line 208 of file gtpu.c.

◆ gtpu_tunnel_restack_dpo()

static void gtpu_tunnel_restack_dpo ( gtpu_tunnel_t t)
static

Definition at line 159 of file gtpu.c.

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

◆ ip_udp_gtpu_rewrite()

static void ip_udp_gtpu_rewrite ( gtpu_tunnel_t t,
bool  is_ip6 
)
static

Definition at line 238 of file gtpu.c.

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

◆ mcast_shared_add()

static void mcast_shared_add ( ip46_address_t *  dst,
fib_node_index_t  mfei,
adj_index_t  ai 
)
inlinestatic

Definition at line 331 of file gtpu.c.

+ Here is the call graph for this function:

◆ mcast_shared_remove()

static void mcast_shared_remove ( ip46_address_t *  dst)
inlinestatic

Definition at line 342 of file gtpu.c.

+ Here is the call graph for this function:

◆ set_ip4_gtpu_bypass()

static clib_error_t* set_ip4_gtpu_bypass ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1000 of file gtpu.c.

+ Here is the call graph for this function:

◆ set_ip6_gtpu_bypass()

static clib_error_t* set_ip6_gtpu_bypass ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1057 of file gtpu.c.

+ Here is the call graph for this function:

◆ set_ip_gtpu_bypass()

static clib_error_t* set_ip_gtpu_bypass ( u32  is_ip6,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 956 of file gtpu.c.

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

◆ show_gtpu_tunnel_command_fn()

static clib_error_t* show_gtpu_tunnel_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 907 of file gtpu.c.

+ Here is the call graph for this function:

◆ unformat_decap_next()

static uword unformat_decap_next ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 649 of file gtpu.c.

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

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( gtpu_device_class  ,
static   
)
+ Here is the caller graph for this function:

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( ip4_gtpu_bypass  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( ip6_gtpu_bypass  ,
static   
)

◆ vnet_gtpu_add_del_rx_flow()

int vnet_gtpu_add_del_rx_flow ( u32  hw_if_index,
u32  t_index,
int  is_add 
)

Definition at line 1114 of file gtpu.c.

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

◆ vnet_gtpu_add_mod_del_tunnel()

int vnet_gtpu_add_mod_del_tunnel ( vnet_gtpu_add_mod_del_tunnel_args_t a,
u32 sw_if_indexp 
)

Definition at line 353 of file gtpu.c.

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

◆ vnet_gtpu_get_tunnel_index()

u32 vnet_gtpu_get_tunnel_index ( u32  sw_if_index)

Definition at line 1153 of file gtpu.c.

+ Here is the caller graph for this function:

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( gtpu_hw_class  )
+ Here is the caller graph for this function:

◆ vnet_int_gtpu_bypass_mode()

void vnet_int_gtpu_bypass_mode ( u32  sw_if_index,
u8  is_ip6,
u8  is_enable 
)

Definition at line 945 of file gtpu.c.

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

Variable Documentation

◆ create_gtpu_tunnel_command

vlib_cli_command_t create_gtpu_tunnel_command
static
Initial value:
= {
.path = "create gtpu tunnel",
.short_help =
"create gtpu tunnel src <local-tep-addr>"
" {dst <remote-tep-addr>|group <mcast-addr> <intf-name>}"
" teid <nn> [tteid <nn>] [encap-vrf-id <nn>]"
" [decap-next [l2|ip4|ip6|node <name>]] [del | upd-tteid <nn>]",
}
static clib_error_t * gtpu_add_del_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gtpu.c:675

(constructor) VLIB_CLI_COMMAND (create_gtpu_tunnel_command)

Definition at line 895 of file gtpu.c.

◆ gtpu_main

gtpu_main_t gtpu_main

Definition at line 36 of file gtpu.c.

◆ gtpu_offload_command

vlib_cli_command_t gtpu_offload_command
static
Initial value:
= {
.path = "set flow-offload gtpu",
.short_help =
"set flow-offload gtpu hw <inerface-name> rx <tunnel-name> [del]",
}
static clib_error_t * gtpu_offload_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gtpu.c:1163

(constructor) VLIB_CLI_COMMAND (gtpu_offload_command)

Definition at line 1235 of file gtpu.c.

◆ gtpu_vft

const fib_node_vft_t gtpu_vft
static
Initial value:
= {
.fnv_last_lock = gtpu_tunnel_last_lock_gone,
.fnv_back_walk = gtpu_tunnel_back_walk,
}
static fib_node_t * gtpu_tunnel_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: gtpu.c:194
static fib_node_back_walk_rc_t gtpu_tunnel_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node - Here we will restack the new dpo of GTPU DIP to encap no...
Definition: gtpu.c:184
static void gtpu_tunnel_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: gtpu.c:208

Definition at line 221 of file gtpu.c.

◆ set_interface_ip6_gtpu_bypass_command

vlib_cli_command_t set_interface_ip6_gtpu_bypass_command
static
Initial value:
= {
.path = "set interface ip6 gtpu-bypass",
.function = set_ip6_gtpu_bypass,
.short_help = "set interface ip6 gtpu-bypass <interface> [del]",
}
static clib_error_t * set_ip6_gtpu_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gtpu.c:1057

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_gtpu_bypass_command)

Definition at line 1106 of file gtpu.c.

◆ set_interface_ip_gtpu_bypass_command

vlib_cli_command_t set_interface_ip_gtpu_bypass_command
static
Initial value:
= {
.path = "set interface ip gtpu-bypass",
.function = set_ip4_gtpu_bypass,
.short_help = "set interface ip gtpu-bypass <interface> [del]",
}
static clib_error_t * set_ip4_gtpu_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gtpu.c:1000

(constructor) VLIB_CLI_COMMAND (set_interface_ip_gtpu_bypass_command)

Definition at line 1049 of file gtpu.c.

◆ show_gtpu_tunnel_command

vlib_cli_command_t show_gtpu_tunnel_command
static
Initial value:
= {
.path = "show gtpu tunnel",
.short_help = "show gtpu tunnel",
}
static clib_error_t * show_gtpu_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gtpu.c:907

(constructor) VLIB_CLI_COMMAND (show_gtpu_tunnel_command)

Definition at line 937 of file gtpu.c.