FD.io VPP  v19.08.3-2-gbabecb413
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)
 
 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 uword vtep_addr_ref (ip46_address_t *ip)
 
static uword vtep_addr_unref (ip46_address_t *ip)
 
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_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
 
static const 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)
u32 mcast_sw_if_index
Definition: vxlan_gbp.api:40
u32 vni
Definition: vxlan_gbp.api:42

Definition at line 204 of file geneve.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 324 of file geneve.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 54 of file geneve.c.

+ Here is the call graph for this function:
+ 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.

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

◆ format_geneve_header_with_length()

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

Definition at line 118 of file geneve.c.

+ Here is the call graph for this function:

◆ format_geneve_name()

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

Definition at line 92 of file geneve.c.

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

◆ 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:

◆ 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 670 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 284 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 1110 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 99 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 213 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 160 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 170 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 148 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 184 of file geneve.c.

◆ geneve_tunnel_restack_dpo()

static void geneve_tunnel_restack_dpo ( geneve_tunnel_t t)
static

Definition at line 134 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 638 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 345 of file geneve.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 357 of file geneve.c.

+ Here is the call 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 996 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 1053 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 952 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 901 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 649 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   
)
+ Here is the caller graph for this function:

◆ 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 368 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  )
+ Here is the caller graph for this function:

◆ vnet_int_geneve_bypass_mode()

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

Definition at line 940 of file geneve.c.

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

◆ vtep_addr_ref()

static uword vtep_addr_ref ( ip46_address_t *  ip)
static

Definition at line 296 of file geneve.c.

+ Here is the call graph for this function:

◆ vtep_addr_unref()

static uword vtep_addr_unref ( ip46_address_t *  ip)
static

Definition at line 310 of file geneve.c.

+ Here is the call 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>]] [del]",
}
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:670

(constructor) VLIB_CLI_COMMAND (create_geneve_tunnel_command)

Definition at line 890 of file geneve.c.

◆ geneve_main

geneve_main_t geneve_main

Definition at line 39 of file geneve.c.

◆ geneve_vft

const fib_node_vft_t geneve_vft
static
Initial value:
= {
.fnv_last_lock = geneve_tunnel_last_lock_gone,
.fnv_back_walk = 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:160
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:184
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:170

Definition at line 197 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]",
}
static clib_error_t * set_ip6_geneve_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:1053

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_geneve_bypass_command)

Definition at line 1102 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]",
}
static clib_error_t * set_ip4_geneve_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: geneve.c:996

(constructor) VLIB_CLI_COMMAND (set_interface_ip_geneve_bypass_command)

Definition at line 1045 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",
}
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:901

(constructor) VLIB_CLI_COMMAND (show_geneve_tunnel_command)

Definition at line 931 of file geneve.c.