FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
vxlan_gbp.c File Reference

VXLAN GBP. More...

+ Include dependency graph for vxlan_gbp.c:

Go to the source code of this file.

Macros

#define foreach_copy_field
 
#define VXLAN_GBP_HASH_NUM_BUCKETS   (2 * 1024)
 
#define VXLAN_GBP_HASH_MEMORY_SIZE   (1 << 20)
 

Functions

u8format_vxlan_gbp_tunnel_mode (u8 *s, va_list *args)
 
u8format_vxlan_gbp_tunnel (u8 *s, va_list *args)
 
static u8format_vxlan_gbp_name (u8 *s, va_list *args)
 
static clib_error_tvxlan_gbp_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_DEVICE_CLASS (vxlan_gbp_device_class, static)
 
static u8format_vxlan_gbp_header_with_length (u8 *s, va_list *args)
 
 VNET_HW_INTERFACE_CLASS (vxlan_gbp_hw_class)
 
static void vxlan_gbp_tunnel_restack_dpo (vxlan_gbp_tunnel_t *t)
 
static vxlan_gbp_tunnel_tvxlan_gbp_tunnel_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t vxlan_gbp_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 DIP to encap node. More...
 
static fib_node_tvxlan_gbp_tunnel_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void vxlan_gbp_tunnel_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
static void vxlan_gbp_rewrite (vxlan_gbp_tunnel_t *t, bool is_ip6)
 
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 *dst, fib_node_index_t mfei, adj_index_t ai)
 
static void mcast_shared_remove (ip46_address_t *dst)
 
void vxlan_gbp_register_udp_ports (void)
 
void vxlan_gbp_unregister_udp_ports (void)
 
int vnet_vxlan_gbp_tunnel_add_del (vnet_vxlan_gbp_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
 
int vnet_vxlan_gbp_tunnel_del (u32 sw_if_index)
 
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_tvxlan_gbp_tunnel_add_del_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_vxlan_gbp_tunnel_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void vnet_int_vxlan_gbp_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable)
 
static clib_error_tset_ip_vxlan_gbp_bypass (u32 is_ip6, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip4_vxlan_gbp_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_ip6_vxlan_gbp_bypass (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tvxlan_gbp_init (vlib_main_t *vm)
 

Variables

static vlib_punt_hdl_t punt_hdl
 
vxlan_gbp_main_t vxlan_gbp_main
 
static const fib_node_vft_t vxlan_gbp_vft
 
static vlib_cli_command_t create_vxlan_gbp_tunnel_command
 (constructor) VLIB_CLI_COMMAND (create_vxlan_gbp_tunnel_command) More...
 
static vlib_cli_command_t show_vxlan_gbp_tunnel_command
 (constructor) VLIB_CLI_COMMAND (show_vxlan_gbp_tunnel_command) More...
 
static vlib_cli_command_t set_interface_ip_vxlan_gbp_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_vxlan_gbp_bypass_command) More...
 
static vlib_cli_command_t set_interface_ip6_vxlan_gbp_bypass_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip6_vxlan_gbp_bypass_command) More...
 

Detailed Description

VXLAN GBP.

VXLAN GBP provides the features of vxlan and carry group policy id.

Definition in file vxlan_gbp.c.

Macro Definition Documentation

◆ foreach_copy_field

#define foreach_copy_field
Value:
_(vni) \
_(mode) \
_(encap_fib_index) \
_(src) \
_(dst)
u16 vni
Definition: flow_types.api:160
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
vl_api_tunnel_mode_t mode
Definition: gre.api:48

Definition at line 215 of file vxlan_gbp.c.

◆ VXLAN_GBP_HASH_MEMORY_SIZE

#define VXLAN_GBP_HASH_MEMORY_SIZE   (1 << 20)

Definition at line 1140 of file vxlan_gbp.c.

◆ VXLAN_GBP_HASH_NUM_BUCKETS

#define VXLAN_GBP_HASH_NUM_BUCKETS   (2 * 1024)

Definition at line 1139 of file vxlan_gbp.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 304 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ format_vxlan_gbp_header_with_length()

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

Definition at line 114 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ format_vxlan_gbp_name()

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

Definition at line 76 of file vxlan_gbp.c.

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

◆ format_vxlan_gbp_tunnel()

u8* format_vxlan_gbp_tunnel ( u8 s,
va_list *  args 
)

Definition at line 54 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ format_vxlan_gbp_tunnel_mode()

u8* format_vxlan_gbp_tunnel_mode ( u8 s,
va_list *  args 
)

Definition at line 37 of file vxlan_gbp.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 695 of file vxlan_gbp.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 326 of file vxlan_gbp.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 *  dst)
inlinestatic

Definition at line 337 of file vxlan_gbp.c.

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

◆ set_ip4_vxlan_gbp_bypass()

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

Definition at line 1026 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ set_ip6_vxlan_gbp_bypass()

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

Definition at line 1083 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ set_ip_vxlan_gbp_bypass()

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

Definition at line 982 of file vxlan_gbp.c.

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

◆ show_vxlan_gbp_tunnel_command_fn()

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

Definition at line 911 of file vxlan_gbp.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 706 of file vxlan_gbp.c.

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

◆ VNET_DEVICE_CLASS()

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

◆ VNET_HW_INTERFACE_CLASS()

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

◆ vnet_int_vxlan_gbp_bypass_mode()

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

Definition at line 970 of file vxlan_gbp.c.

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

◆ vnet_vxlan_gbp_tunnel_add_del()

int vnet_vxlan_gbp_tunnel_add_del ( vnet_vxlan_gbp_tunnel_add_del_args_t a,
u32 sw_if_indexp 
)

Definition at line 384 of file vxlan_gbp.c.

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

◆ vnet_vxlan_gbp_tunnel_del()

int vnet_vxlan_gbp_tunnel_del ( u32  sw_if_index)

Definition at line 665 of file vxlan_gbp.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 275 of file vxlan_gbp.c.

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

◆ vtep_addr_unref()

static uword vtep_addr_unref ( ip46_address_t *  ip)
static

Definition at line 289 of file vxlan_gbp.c.

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

◆ vxlan_gbp_init()

clib_error_t* vxlan_gbp_init ( vlib_main_t vm)

Definition at line 1143 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ vxlan_gbp_interface_admin_up_down()

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

Definition at line 94 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ vxlan_gbp_register_udp_ports()

void vxlan_gbp_register_udp_ports ( void  )
inline

Definition at line 348 of file vxlan_gbp.c.

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

◆ vxlan_gbp_rewrite()

static void vxlan_gbp_rewrite ( vxlan_gbp_tunnel_t t,
bool  is_ip6 
)
static

Definition at line 224 of file vxlan_gbp.c.

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

◆ vxlan_gbp_tunnel_add_del_command_fn()

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

Definition at line 727 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ vxlan_gbp_tunnel_back_walk()

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

Definition at line 171 of file vxlan_gbp.c.

+ Here is the call graph for this function:

◆ vxlan_gbp_tunnel_fib_node_get()

static fib_node_t* vxlan_gbp_tunnel_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 181 of file vxlan_gbp.c.

◆ vxlan_gbp_tunnel_from_fib_node()

static vxlan_gbp_tunnel_t* vxlan_gbp_tunnel_from_fib_node ( fib_node_t node)
static

Definition at line 158 of file vxlan_gbp.c.

+ Here is the caller graph for this function:

◆ vxlan_gbp_tunnel_last_lock_gone()

static void vxlan_gbp_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 195 of file vxlan_gbp.c.

◆ vxlan_gbp_tunnel_restack_dpo()

static void vxlan_gbp_tunnel_restack_dpo ( vxlan_gbp_tunnel_t t)
static

Definition at line 130 of file vxlan_gbp.c.

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

◆ vxlan_gbp_unregister_udp_ports()

void vxlan_gbp_unregister_udp_ports ( void  )
inline

Definition at line 366 of file vxlan_gbp.c.

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

Variable Documentation

◆ create_vxlan_gbp_tunnel_command

vlib_cli_command_t create_vxlan_gbp_tunnel_command
static
Initial value:
= {
.path = "create vxlan-gbp tunnel",
.short_help =
"create vxlan-gbp tunnel src <local-vtep-addr>"
" {dst <remote-vtep-addr>|group <mcast-vtep-addr> <intf-name>} vni <nn>"
" [instance <id>]"
" [encap-vrf-id <nn>] [decap-next [l2|node <name>]] [del]",
}
static clib_error_t * vxlan_gbp_tunnel_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gbp.c:727

(constructor) VLIB_CLI_COMMAND (create_vxlan_gbp_tunnel_command)

Definition at line 899 of file vxlan_gbp.c.

◆ punt_hdl

vlib_punt_hdl_t punt_hdl
static

Definition at line 32 of file vxlan_gbp.c.

◆ set_interface_ip6_vxlan_gbp_bypass_command

vlib_cli_command_t set_interface_ip6_vxlan_gbp_bypass_command
static
Initial value:
= {
.path = "set interface ip6 vxlan-gbp-bypass",
.short_help = "set interface ip6 vxlan-gbp-bypass <interface> [del]",
}
static clib_error_t * set_ip6_vxlan_gbp_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gbp.c:1083

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_vxlan_gbp_bypass_command)

Definition at line 1132 of file vxlan_gbp.c.

◆ set_interface_ip_vxlan_gbp_bypass_command

vlib_cli_command_t set_interface_ip_vxlan_gbp_bypass_command
static
Initial value:
= {
.path = "set interface ip vxlan-gbp-bypass",
.short_help = "set interface ip vxlan-gbp-bypass <interface> [del]",
}
static clib_error_t * set_ip4_vxlan_gbp_bypass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gbp.c:1026

(constructor) VLIB_CLI_COMMAND (set_interface_ip_vxlan_gbp_bypass_command)

Definition at line 1075 of file vxlan_gbp.c.

◆ show_vxlan_gbp_tunnel_command

vlib_cli_command_t show_vxlan_gbp_tunnel_command
static
Initial value:
= {
.path = "show vxlan-gbp tunnel",
.short_help = "show vxlan-gbp tunnel [raw]",
}
static clib_error_t * show_vxlan_gbp_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gbp.c:911

(constructor) VLIB_CLI_COMMAND (show_vxlan_gbp_tunnel_command)

Definition at line 961 of file vxlan_gbp.c.

◆ vxlan_gbp_main

vxlan_gbp_main_t vxlan_gbp_main

Definition at line 34 of file vxlan_gbp.c.

◆ vxlan_gbp_vft

const fib_node_vft_t vxlan_gbp_vft
static
Initial value:
= {
.fnv_back_walk = vxlan_gbp_tunnel_back_walk,
}
static void vxlan_gbp_tunnel_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: vxlan_gbp.c:195
static fib_node_back_walk_rc_t vxlan_gbp_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 DIP to encap n...
Definition: vxlan_gbp.c:171
static fib_node_t * vxlan_gbp_tunnel_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: vxlan_gbp.c:181

Definition at line 208 of file vxlan_gbp.c.