FD.io VPP  v19.04.4-rc0-5-ge88582fac
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 203 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 323 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 53 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 41 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 117 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 91 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 70 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 662 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 283 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 1102 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 98 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 212 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 159 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 169 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 147 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 183 of file geneve.c.

◆ geneve_tunnel_restack_dpo()

static void geneve_tunnel_restack_dpo ( geneve_tunnel_t t)
static

Definition at line 133 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 630 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 344 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 356 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 988 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 1045 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 944 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 893 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 641 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 367 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 932 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 295 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 309 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:662

(constructor) VLIB_CLI_COMMAND (create_geneve_tunnel_command)

Definition at line 882 of file geneve.c.

◆ geneve_main

geneve_main_t geneve_main

Definition at line 38 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:159
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:183
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:169

Definition at line 196 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 ip 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:1045

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_geneve_bypass_command)

Definition at line 1094 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:988

(constructor) VLIB_CLI_COMMAND (set_interface_ip_geneve_bypass_command)

Definition at line 1037 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:893

(constructor) VLIB_CLI_COMMAND (show_geneve_tunnel_command)

Definition at line 923 of file geneve.c.