FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
geneve.c File Reference

GENEVE. More...

+ Include dependency graph for geneve.c:

Go to the source code of this file.

Macros

#define foreach_copy_field
 

Functions

u8format_geneve_encap_trace (u8 *s, va_list *args)
 
static u8format_decap_next (u8 *s, va_list *args)
 
u8format_geneve_tunnel (u8 *s, va_list *args)
 
static u8format_geneve_name (u8 *s, va_list *args)
 
static clib_error_tgeneve_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static clib_error_tgeneve_mac_change (vnet_hw_interface_t *hi, const u8 *old_address, const u8 *mac_address)
 
 VNET_DEVICE_CLASS (geneve_device_class, static)
 
static u8format_geneve_header_with_length (u8 *s, va_list *args)
 
 VNET_HW_INTERFACE_CLASS (geneve_hw_class)
 
static void geneve_tunnel_restack_dpo (geneve_tunnel_t *t)
 
static geneve_tunnel_tgeneve_tunnel_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t geneve_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 GENEVE DIP to encap node. More...
 
static fib_node_tgeneve_tunnel_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void geneve_tunnel_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
static int geneve_rewrite (geneve_tunnel_t *t, bool is_ip6)
 
static bool geneve_decap_next_is_valid (geneve_main_t *vxm, u32 is_ip6, u32 decap_next_index)
 
static mcast_shared_t mcast_shared_get (ip46_address_t *ip)
 
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_geneve_add_del_tunnel (vnet_geneve_add_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_tgeneve_add_del_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_geneve_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void vnet_int_geneve_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable)
 
static clib_error_tset_ip_geneve_bypass (u32 is_ip6, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip4_geneve_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip6_geneve_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tgeneve_init (vlib_main_t *vm)
 

Variables

geneve_main_t geneve_main
 
const static fib_node_vft_t geneve_vft
 
static vlib_cli_command_t create_geneve_tunnel_command
 (constructor) VLIB_CLI_COMMAND (create_geneve_tunnel_command) More...
 
static vlib_cli_command_t show_geneve_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_geneve_tunnel_command) More...
 
static vlib_cli_command_t set_interface_ip_geneve_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_geneve_bypass_command) More...
 
static vlib_cli_command_t set_interface_ip6_geneve_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip6_geneve_bypass_command) More...
 

Detailed Description

GENEVE.

GENEVE 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 GENEVE 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.

Definition in file geneve.c.

Macro Definition Documentation

◆ foreach_copy_field

#define foreach_copy_field
Value:
_(vni) \
_(encap_fib_index) \
_(decap_next_index) \
_(local) \
_(remote) \
_(l3_mode)

Definition at line 226 of file geneve.c.

Function Documentation

◆ format_decap_next()

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

Definition at line 54 of file geneve.c.

+ Here is the caller graph for this function:

◆ format_geneve_encap_trace()

u8* format_geneve_encap_trace ( u8 s,
va_list *  args 
)

Definition at line 42 of file geneve.c.

◆ format_geneve_header_with_length()

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

Definition at line 128 of file geneve.c.

◆ format_geneve_name()

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

Definition at line 93 of file geneve.c.

◆ format_geneve_tunnel()

u8* format_geneve_tunnel ( u8 s,
va_list *  args 
)

Definition at line 71 of file geneve.c.

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

◆ geneve_add_del_tunnel_command_fn()

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

Definition at line 660 of file geneve.c.

+ Here is the call graph for this function:

◆ geneve_decap_next_is_valid()

static bool geneve_decap_next_is_valid ( geneve_main_t vxm,
u32  is_ip6,
u32  decap_next_index 
)
static

Definition at line 307 of file geneve.c.

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

◆ geneve_init()

clib_error_t* geneve_init ( vlib_main_t vm)

Definition at line 1103 of file geneve.c.

+ Here is the call graph for this function:

◆ geneve_interface_admin_up_down()

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

Definition at line 100 of file geneve.c.

+ Here is the call graph for this function:

◆ geneve_mac_change()

static clib_error_t* geneve_mac_change ( vnet_hw_interface_t hi,
const u8 old_address,
const u8 mac_address 
)
static

Definition at line 110 of file geneve.c.

+ Here is the call graph for this function:

◆ geneve_rewrite()

static int geneve_rewrite ( geneve_tunnel_t t,
bool  is_ip6 
)
static

Definition at line 236 of file geneve.c.

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

◆ geneve_tunnel_back_walk()

static fib_node_back_walk_rc_t geneve_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 GENEVE DIP to encap node.

Definition at line 182 of file geneve.c.

+ Here is the call graph for this function:

◆ geneve_tunnel_fib_node_get()

static fib_node_t* geneve_tunnel_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 192 of file geneve.c.

◆ geneve_tunnel_from_fib_node()

static geneve_tunnel_t* geneve_tunnel_from_fib_node ( fib_node_t node)
static

Definition at line 170 of file geneve.c.

+ Here is the caller graph for this function:

◆ geneve_tunnel_last_lock_gone()

static void geneve_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 206 of file geneve.c.

◆ geneve_tunnel_restack_dpo()

static void geneve_tunnel_restack_dpo ( geneve_tunnel_t t)
static

Definition at line 144 of file geneve.c.

+ Here is the call graph for this function:
+ Here is the caller 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 628 of file geneve.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 340 of file geneve.c.

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

◆ mcast_shared_get()

static mcast_shared_t mcast_shared_get ( ip46_address_t *  ip)
inlinestatic

Definition at line 329 of file geneve.c.

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

◆ mcast_shared_remove()

static void mcast_shared_remove ( ip46_address_t *  remote)
inlinestatic

Definition at line 352 of file geneve.c.

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

◆ set_ip4_geneve_bypass()

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

Definition at line 989 of file geneve.c.

+ Here is the call graph for this function:

◆ set_ip6_geneve_bypass()

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

Definition at line 1046 of file geneve.c.

+ Here is the call graph for this function:

◆ set_ip_geneve_bypass()

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

Definition at line 945 of file geneve.c.

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

◆ show_geneve_tunnel_command_fn()

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

Definition at line 896 of file geneve.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 639 of file geneve.c.

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

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( geneve_device_class  ,
static   
)

◆ vnet_geneve_add_del_tunnel()

int vnet_geneve_add_del_tunnel ( vnet_geneve_add_del_tunnel_args_t a,
u32 sw_if_indexp 
)

Definition at line 363 of file geneve.c.

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

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( geneve_hw_class  )

◆ vnet_int_geneve_bypass_mode()

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

Definition at line 933 of file geneve.c.

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

Variable Documentation

◆ create_geneve_tunnel_command

vlib_cli_command_t create_geneve_tunnel_command
static
Initial value:
= {
.path = "create geneve tunnel",
.short_help =
"create geneve tunnel local <local-vtep-addr>"
" {remote <remote-vtep-addr>|group <mcast-vtep-addr> <intf-name>} vni <nn>"
" [encap-vrf-id <nn>] [decap-next [l2|node <name>]] [l3-mode] [del]",
}

(constructor) VLIB_CLI_COMMAND (create_geneve_tunnel_command)

Definition at line 885 of file geneve.c.

◆ geneve_main

geneve_main_t geneve_main

Definition at line 39 of file geneve.c.

◆ geneve_vft

const static fib_node_vft_t geneve_vft
static
Initial value:
= {
.fnv_last_lock = geneve_tunnel_last_lock_gone,
.fnv_back_walk = geneve_tunnel_back_walk,
}

Definition at line 219 of file geneve.c.

◆ set_interface_ip6_geneve_bypass_command

vlib_cli_command_t set_interface_ip6_geneve_bypass_command
static
Initial value:
= {
.path = "set interface ip6 geneve-bypass",
.function = set_ip6_geneve_bypass,
.short_help = "set interface ip6 geneve-bypass <interface> [del]",
}

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_geneve_bypass_command)

Definition at line 1095 of file geneve.c.

◆ set_interface_ip_geneve_bypass_command

vlib_cli_command_t set_interface_ip_geneve_bypass_command
static
Initial value:
= {
.path = "set interface ip geneve-bypass",
.function = set_ip4_geneve_bypass,
.short_help = "set interface ip geneve-bypass <interface> [del]",
}

(constructor) VLIB_CLI_COMMAND (set_interface_ip_geneve_bypass_command)

Definition at line 1038 of file geneve.c.

◆ show_geneve_tunnel_command

vlib_cli_command_t show_geneve_tunnel_command
static
Initial value:
= {
.path = "show geneve tunnel",
.short_help = "show geneve tunnel",
}

(constructor) VLIB_CLI_COMMAND (show_geneve_tunnel_command)

Definition at line 924 of file geneve.c.

show_geneve_tunnel_command_fn
static clib_error_t * show_geneve_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:896
vni
u32 vni
Definition: flow_types.api:160
geneve_add_del_tunnel_command_fn
static clib_error_t * geneve_add_del_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:660
set_ip6_geneve_bypass
static clib_error_t * set_ip6_geneve_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:1046
geneve_tunnel_back_walk
static fib_node_back_walk_rc_t geneve_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 GENEVE DIP to encap ...
Definition: geneve.c:182
set_ip4_geneve_bypass
static clib_error_t * set_ip4_geneve_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:989
mcast_sw_if_index
vl_api_interface_index_t mcast_sw_if_index
Definition: vxlan_gbp.api:41
geneve_tunnel_last_lock_gone
static void geneve_tunnel_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: geneve.c:206
geneve_tunnel_fib_node_get
static fib_node_t * geneve_tunnel_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: geneve.c:192