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

Common utility functions for IPv4 and IPv6 VXLAN GPE tunnels. More...

+ Include dependency graph for vxlan_gpe.c:

Go to the source code of this file.

Macros

#define foreach_gpe_copy_field
 
#define foreach_copy_ipv4
 
#define foreach_copy_ipv6
 

Functions

static u8format_decap_next (u8 *s, va_list *args)
 
u8format_vxlan_gpe_tunnel (u8 *s, va_list *args)
 Format function for VXLAN GPE tunnel. More...
 
static u8format_vxlan_gpe_name (u8 *s, va_list *args)
 Naming for VXLAN GPE tunnel. More...
 
static clib_error_tvxlan_gpe_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 CLI function for VXLAN GPE admin up/down. More...
 
 VNET_DEVICE_CLASS (vxlan_gpe_device_class, static)
 
static u8format_vxlan_gpe_header_with_length (u8 *s, va_list *args)
 Formatting function for tracing VXLAN GPE with length. More...
 
 VNET_HW_INTERFACE_CLASS (vxlan_gpe_hw_class)
 
static void vxlan_gpe_tunnel_restack_dpo (vxlan_gpe_tunnel_t *t)
 
static vxlan_gpe_tunnel_tvxlan_gpe_tunnel_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t vxlan_gpe_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 VXLAN_GPE DIP to encap node. More...
 
static fib_node_tvxlan_gpe_tunnel_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void vxlan_gpe_tunnel_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
int vxlan4_gpe_rewrite (vxlan_gpe_tunnel_t *t, u32 extension_size, u8 protocol_override, uword encap_next_node)
 Calculate IPv4 VXLAN GPE rewrite header. More...
 
int vxlan6_gpe_rewrite (vxlan_gpe_tunnel_t *t, u32 extension_size, u8 protocol_override, uword encap_next_node)
 Calculate IPv6 VXLAN GPE rewrite header. More...
 
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 *remote, fib_node_index_t mfei, adj_index_t ai)
 
static void mcast_shared_remove (ip46_address_t *remote)
 
int vnet_vxlan_gpe_add_del_tunnel (vnet_vxlan_gpe_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
 Add or Del a VXLAN GPE tunnel. More...
 
static clib_error_tvxlan_gpe_add_del_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_vxlan_gpe_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI function for showing VXLAN GPE tunnels. More...
 
void vnet_int_vxlan_gpe_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable)
 
static clib_error_tset_ip_vxlan_gpe_bypass (u32 is_ip6, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip4_vxlan_gpe_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip6_vxlan_gpe_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
 VNET_FEATURE_INIT (ip4_vxlan_gpe_bypass, static)
 
 VNET_FEATURE_INIT (ip6_vxlan_gpe_bypass, static)
 
clib_error_tvxlan_gpe_init (vlib_main_t *vm)
 Feature init function for VXLAN GPE. More...
 

Variables

vxlan_gpe_main_t vxlan_gpe_main
 
const static fib_node_vft_t vxlan_gpe_vft
 
static vlib_cli_command_t create_vxlan_gpe_tunnel_command
 (constructor) VLIB_CLI_COMMAND (create_vxlan_gpe_tunnel_command) More...
 
static vlib_cli_command_t show_vxlan_gpe_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_vxlan_gpe_tunnel_command) More...
 
static vlib_cli_command_t set_interface_ip_vxlan_gpe_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_vxlan_gpe_bypass_command) More...
 
static vlib_cli_command_t set_interface_ip6_vxlan_gpe_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip6_vxlan_gpe_bypass_command) More...
 

Detailed Description

Common utility functions for IPv4 and IPv6 VXLAN GPE tunnels.

VXLAN-GPE.

VXLAN-GPE provides the features needed to allow L2 bridge domains (BDs) to span multiple servers. This is done by building an L2 overlay on top of an L3 network underlay using VXLAN-GPE tunnels.

This makes it possible for servers to be co-located in the same data center or be separated geographically as long as they are reachable through the underlay L3 network.

You can refer to this kind of L2 overlay bridge domain as a VXLAN-GPE segment.

Definition in file vxlan_gpe.c.

Macro Definition Documentation

◆ foreach_copy_ipv4

#define foreach_copy_ipv4
Value:
{ \
_(local.ip4.as_u32) \
_(remote.ip4.as_u32) \
}

Definition at line 258 of file vxlan_gpe.c.

◆ foreach_copy_ipv6

#define foreach_copy_ipv6
Value:
{ \
_(local.ip6.as_u64[0]) \
_(local.ip6.as_u64[1]) \
_(remote.ip6.as_u64[0]) \
_(remote.ip6.as_u64[1]) \
}

Definition at line 263 of file vxlan_gpe.c.

◆ foreach_gpe_copy_field

#define foreach_gpe_copy_field
Value:
_(vni) \
_(encap_fib_index) \
_(decap_fib_index)

Definition at line 251 of file vxlan_gpe.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 389 of file vxlan_gpe.c.

◆ format_decap_next()

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

Definition at line 50 of file vxlan_gpe.c.

+ Here is the caller graph for this function:

◆ format_vxlan_gpe_header_with_length()

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

Formatting function for tracing VXLAN GPE with length.

Parameters
*s
*args
Returns
*s

Definition at line 166 of file vxlan_gpe.c.

◆ format_vxlan_gpe_name()

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

Naming for VXLAN GPE tunnel.

Parameters
*sformatting string
*args
Returns
*s formatted string

Definition at line 119 of file vxlan_gpe.c.

◆ format_vxlan_gpe_tunnel()

u8* format_vxlan_gpe_tunnel ( u8 s,
va_list *  args 
)

Format function for VXLAN GPE tunnel.

Parameters
*sformatting string
*args
Returns
*s formatted string

Definition at line 85 of file vxlan_gpe.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 *  remote,
fib_node_index_t  mfei,
adj_index_t  ai 
)
inlinestatic

Definition at line 410 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ mcast_shared_remove()

static void mcast_shared_remove ( ip46_address_t *  remote)
inlinestatic

Definition at line 422 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ set_ip4_vxlan_gpe_bypass()

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

Definition at line 1083 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ set_ip6_vxlan_gpe_bypass()

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

Definition at line 1140 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ set_ip_vxlan_gpe_bypass()

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

Definition at line 1039 of file vxlan_gpe.c.

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

◆ show_vxlan_gpe_tunnel_command_fn()

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

CLI function for showing VXLAN GPE tunnels.

Parameters
*vm
*input
*cmd
Returns
error

Definition at line 990 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( vxlan_gpe_device_class  ,
static   
)

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( ip4_vxlan_gpe_bypass  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( ip6_vxlan_gpe_bypass  ,
static   
)

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( vxlan_gpe_hw_class  )

◆ vnet_int_vxlan_gpe_bypass_mode()

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

Definition at line 1027 of file vxlan_gpe.c.

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

◆ vnet_vxlan_gpe_add_del_tunnel()

int vnet_vxlan_gpe_add_del_tunnel ( vnet_vxlan_gpe_add_del_tunnel_args_t a,
u32 sw_if_indexp 
)

Add or Del a VXLAN GPE tunnel.

Parameters
*a
*sw_if_index
Returns
rc

Definition at line 442 of file vxlan_gpe.c.

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

◆ vxlan4_gpe_rewrite()

int vxlan4_gpe_rewrite ( vxlan_gpe_tunnel_t t,
u32  extension_size,
u8  protocol_override,
uword  encap_next_node 
)

Calculate IPv4 VXLAN GPE rewrite header.

Parameters
*t
Returns
rc

Definition at line 280 of file vxlan_gpe.c.

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

◆ vxlan6_gpe_rewrite()

int vxlan6_gpe_rewrite ( vxlan_gpe_tunnel_t t,
u32  extension_size,
u8  protocol_override,
uword  encap_next_node 
)

Calculate IPv6 VXLAN GPE rewrite header.

Parameters
*t
Returns
rc

Definition at line 338 of file vxlan_gpe.c.

+ Here is the caller graph for this function:

◆ vxlan_gpe_add_del_tunnel_command_fn()

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

Definition at line 734 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ vxlan_gpe_init()

clib_error_t* vxlan_gpe_init ( vlib_main_t vm)

Feature init function for VXLAN GPE.

Parameters
*vm
Returns
error

Definition at line 1221 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ vxlan_gpe_interface_admin_up_down()

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

CLI function for VXLAN GPE admin up/down.

Parameters
*vnm
hw_if_index
flag
Returns
*rc

Definition at line 136 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ vxlan_gpe_tunnel_back_walk()

static fib_node_back_walk_rc_t vxlan_gpe_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 VXLAN_GPE DIP to encap node.

Definition at line 208 of file vxlan_gpe.c.

+ Here is the call graph for this function:

◆ vxlan_gpe_tunnel_fib_node_get()

static fib_node_t* vxlan_gpe_tunnel_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 218 of file vxlan_gpe.c.

◆ vxlan_gpe_tunnel_from_fib_node()

static vxlan_gpe_tunnel_t* vxlan_gpe_tunnel_from_fib_node ( fib_node_t node)
static

Definition at line 195 of file vxlan_gpe.c.

+ Here is the caller graph for this function:

◆ vxlan_gpe_tunnel_last_lock_gone()

static void vxlan_gpe_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 232 of file vxlan_gpe.c.

◆ vxlan_gpe_tunnel_restack_dpo()

static void vxlan_gpe_tunnel_restack_dpo ( vxlan_gpe_tunnel_t t)
static

Definition at line 182 of file vxlan_gpe.c.

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

Variable Documentation

◆ create_vxlan_gpe_tunnel_command

vlib_cli_command_t create_vxlan_gpe_tunnel_command
static
Initial value:
= {
.path = "create vxlan-gpe tunnel",
.short_help =
"create vxlan-gpe tunnel local <local-addr> "
" {remote <remote-addr>|group <mcast-addr> <intf-name>}"
" vni <nn> [next-ip4][next-ip6][next-ethernet][next-nsh]"
" [encap-vrf-id <nn>] [decap-vrf-id <nn>] [del]\n",
}

(constructor) VLIB_CLI_COMMAND (create_vxlan_gpe_tunnel_command)

Definition at line 968 of file vxlan_gpe.c.

◆ set_interface_ip6_vxlan_gpe_bypass_command

vlib_cli_command_t set_interface_ip6_vxlan_gpe_bypass_command
static
Initial value:
= {
.path = "set interface ip6 vxlan-gpe-bypass",
.short_help = "set interface ip6 vxlan-gpe-bypass <interface> [del]",
}

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_vxlan_gpe_bypass_command)

Definition at line 1189 of file vxlan_gpe.c.

◆ set_interface_ip_vxlan_gpe_bypass_command

vlib_cli_command_t set_interface_ip_vxlan_gpe_bypass_command
static
Initial value:
= {
.path = "set interface ip vxlan-gpe-bypass",
.short_help = "set interface ip vxlan-gpe-bypass <interface> [del]",
}

(constructor) VLIB_CLI_COMMAND (set_interface_ip_vxlan_gpe_bypass_command)

Definition at line 1132 of file vxlan_gpe.c.

◆ show_vxlan_gpe_tunnel_command

vlib_cli_command_t show_vxlan_gpe_tunnel_command
static
Initial value:
= {
.path = "show vxlan-gpe",
}

(constructor) VLIB_CLI_COMMAND (show_vxlan_gpe_tunnel_command)

Definition at line 1020 of file vxlan_gpe.c.

◆ vxlan_gpe_main

vxlan_gpe_main_t vxlan_gpe_main

Definition at line 47 of file vxlan_gpe.c.

◆ vxlan_gpe_vft

const static fib_node_vft_t vxlan_gpe_vft
static
Initial value:

Definition at line 245 of file vxlan_gpe.c.

set_ip6_vxlan_gpe_bypass
static clib_error_t * set_ip6_vxlan_gpe_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gpe.c:1140
vni
u32 vni
Definition: flow_types.api:160
set_ip4_vxlan_gpe_bypass
static clib_error_t * set_ip4_vxlan_gpe_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gpe.c:1083
vxlan_gpe_add_del_tunnel_command_fn
static clib_error_t * vxlan_gpe_add_del_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gpe.c:734
mcast_sw_if_index
vl_api_interface_index_t mcast_sw_if_index
Definition: vxlan_gbp.api:41
vxlan_gpe_tunnel_fib_node_get
static fib_node_t * vxlan_gpe_tunnel_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: vxlan_gpe.c:218
vxlan_gpe_tunnel_last_lock_gone
static void vxlan_gpe_tunnel_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: vxlan_gpe.c:232
protocol
vl_api_ip_proto_t protocol
Definition: lb_types.api:72
show_vxlan_gpe_tunnel_command_fn
static clib_error_t * show_vxlan_gpe_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI function for showing VXLAN GPE tunnels.
Definition: vxlan_gpe.c:990
vxlan_gpe_tunnel_back_walk
static fib_node_back_walk_rc_t vxlan_gpe_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 VXLAN_GPE DIP to enc...
Definition: vxlan_gpe.c:208