FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
gbp_vxlan.c File Reference
+ Include dependency graph for gbp_vxlan.c:

Go to the source code of this file.

Data Structures

struct  vxlan_tunnel_ref_t_
 A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the tempplate GBP-VXLAN tunnel. More...
 
struct  gbp_vxlan_trace_t_
 
struct  gbp_vxlan_tx_trace_t_
 

Macros

#define GBP_VXLAN_TUN_DBG(...)   vlib_log_debug (gt_logger, __VA_ARGS__);
 
#define foreach_gbp_vxlan_input_next
 
#define foreach_gbp_vxlan_error
 

Typedefs

typedef struct vxlan_tunnel_ref_t_ vxlan_tunnel_ref_t
 A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the tempplate GBP-VXLAN tunnel. More...
 
typedef struct gbp_vxlan_trace_t_ gbp_vxlan_trace_t
 
typedef struct gbp_vxlan_tx_trace_t_ gbp_vxlan_tx_trace_t
 

Enumerations

enum  gbp_vxlan_input_next_t { GBP_VXLAN_INPUT_N_NEXT }
 
enum  gbp_vxlan_input_error_t { GBP_VXLAN_N_ERROR }
 

Functions

static gbp_vxlan_tunnel_tgbp_vxlan_tunnel_get (index_t gti)
 
static vxlan_tunnel_ref_tvxlan_tunnel_ref_get (index_t vxri)
 
static u8format_vxlan_tunnel_ref (u8 *s, va_list *args)
 
static u32 gdb_vxlan_dep_add (gbp_vxlan_tunnel_t *gt, u32 vni, const ip46_address_t *src, const ip46_address_t *dst)
 
u32 vxlan_gbp_tunnel_get_parent (u32 sw_if_index)
 
gbp_vxlan_tunnel_type_t gbp_vxlan_tunnel_get_type (u32 sw_if_index)
 
u32 gbp_vxlan_tunnel_clone_and_lock (u32 sw_if_index, const ip46_address_t *src, const ip46_address_t *dst)
 
static void gdb_vxlan_dep_del (index_t vxri)
 
void vxlan_gbp_tunnel_unlock (u32 sw_if_index)
 
void vxlan_gbp_tunnel_lock (u32 sw_if_index)
 
static uword gbp_vxlan_decap (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip4)
 
static u8format_gbp_vxlan_rx_trace (u8 *s, va_list *args)
 
static uword gbp_vxlan4_decap (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
void gbp_vxlan_walk (gbp_vxlan_cb_t cb, void *ctx)
 
static walk_rc_t gbp_vxlan_tunnel_show_one (gbp_vxlan_tunnel_t *gt, void *ctx)
 
static u8format_gbp_vxlan_tunnel_name (u8 *s, va_list *args)
 
u8format_gbp_vxlan_tunnel_layer (u8 *s, va_list *args)
 
u8format_gbp_vxlan_tunnel (u8 *s, va_list *args)
 
u8format_gbp_vxlan_tx_trace (u8 *s, va_list *args)
 
clib_error_tgbp_vxlan_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static uword gbp_vxlan_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_DEVICE_CLASS (gbp_vxlan_device_class)
 
 VNET_HW_INTERFACE_CLASS (gbp_vxlan_hw_interface_class)
 
int gbp_vxlan_tunnel_add (u32 vni, gbp_vxlan_tunnel_layer_t layer, u32 bd_rd_id, u32 *sw_if_indexp)
 
int gbp_vxlan_tunnel_del (u32 vni)
 
static clib_error_tgbp_vxlan_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tgbp_vxlan_init (vlib_main_t *vm)
 

Variables

uwordgv_db
 DB of added tunnels. More...
 
vlib_log_class_t gt_logger
 Logger. More...
 
gbp_vxlan_tunnel_tgbp_vxlan_tunnel_pool
 Pool of template tunnels. More...
 
vxlan_tunnel_ref_tvxlan_tunnel_ref_pool
 Pool of child tunnels. More...
 
index_tgbp_vxlan_tunnel_db
 DB of template interfaces by SW interface index. More...
 
index_tvxlan_tunnel_ref_db
 DB of child interfaces by SW interface index. More...
 
static char * gbp_vxlan_tunnel_layer_strings []
 
static char * gbp_vxlan_error_strings []
 
vlib_node_registration_t gbp_vxlan4_input_node
 (constructor) VLIB_REGISTER_NODE (gbp_vxlan4_input_node) More...
 
static vlib_cli_command_t gbp_vxlan_show_node
 (constructor) VLIB_CLI_COMMAND (gbp_vxlan_show_node) More...
 

Macro Definition Documentation

◆ foreach_gbp_vxlan_error

#define foreach_gbp_vxlan_error
Value:
_(DECAPPED, "decapped") \
_(LEARNED, "learned")

Definition at line 327 of file gbp_vxlan.c.

◆ foreach_gbp_vxlan_input_next

#define foreach_gbp_vxlan_input_next
Value:
_(DROP, "error-drop") \
_(L2_INPUT, "l2-input") \
_(IP4_INPUT, "ip4-input") \
_(IP6_INPUT, "ip6-input")
DROP
Definition: error.def:41

Definition at line 313 of file gbp_vxlan.c.

◆ GBP_VXLAN_TUN_DBG

#define GBP_VXLAN_TUN_DBG (   ...)    vlib_log_debug (gt_logger, __VA_ARGS__);

Definition at line 76 of file gbp_vxlan.c.

Typedef Documentation

◆ gbp_vxlan_trace_t

◆ gbp_vxlan_tx_trace_t

◆ vxlan_tunnel_ref_t

A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the tempplate GBP-VXLAN tunnel.

Enumeration Type Documentation

◆ gbp_vxlan_input_error_t

Enumerator
GBP_VXLAN_N_ERROR 

Definition at line 331 of file gbp_vxlan.c.

◆ gbp_vxlan_input_next_t

Enumerator
GBP_VXLAN_INPUT_N_NEXT 

Definition at line 319 of file gbp_vxlan.c.

Function Documentation

◆ format_gbp_vxlan_rx_trace()

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

Definition at line 461 of file gbp_vxlan.c.

+ Here is the call graph for this function:

◆ format_gbp_vxlan_tunnel()

u8* format_gbp_vxlan_tunnel ( u8 s,
va_list *  args 
)

Definition at line 542 of file gbp_vxlan.c.

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

◆ format_gbp_vxlan_tunnel_layer()

u8* format_gbp_vxlan_tunnel_layer ( u8 s,
va_list *  args 
)

Definition at line 533 of file gbp_vxlan.c.

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

◆ format_gbp_vxlan_tunnel_name()

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

Definition at line 525 of file gbp_vxlan.c.

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

◆ format_gbp_vxlan_tx_trace()

u8* format_gbp_vxlan_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 576 of file gbp_vxlan.c.

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

◆ format_vxlan_tunnel_ref()

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

Definition at line 94 of file gbp_vxlan.c.

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

◆ gbp_vxlan4_decap()

static uword gbp_vxlan4_decap ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 475 of file gbp_vxlan.c.

+ Here is the call graph for this function:

◆ gbp_vxlan_decap()

static uword gbp_vxlan_decap ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u8  is_ip4 
)
static

Definition at line 356 of file gbp_vxlan.c.

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

◆ gbp_vxlan_init()

static clib_error_t* gbp_vxlan_init ( vlib_main_t vm)
static

Definition at line 847 of file gbp_vxlan.c.

+ Here is the call graph for this function:

◆ gbp_vxlan_interface_admin_up_down()

clib_error_t* gbp_vxlan_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)

Definition at line 588 of file gbp_vxlan.c.

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

◆ gbp_vxlan_interface_tx()

static uword gbp_vxlan_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 616 of file gbp_vxlan.c.

+ Here is the call graph for this function:

◆ gbp_vxlan_show()

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

Definition at line 823 of file gbp_vxlan.c.

+ Here is the call graph for this function:

◆ gbp_vxlan_tunnel_add()

int gbp_vxlan_tunnel_add ( u32  vni,
gbp_vxlan_tunnel_layer_t  layer,
u32  bd_rd_id,
u32 sw_if_indexp 
)

Definition at line 640 of file gbp_vxlan.c.

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

◆ gbp_vxlan_tunnel_clone_and_lock()

u32 gbp_vxlan_tunnel_clone_and_lock ( u32  sw_if_index,
const ip46_address_t *  src,
const ip46_address_t *  dst 
)

Definition at line 224 of file gbp_vxlan.c.

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

◆ gbp_vxlan_tunnel_del()

int gbp_vxlan_tunnel_del ( u32  vni)

Definition at line 765 of file gbp_vxlan.c.

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

◆ gbp_vxlan_tunnel_get()

static gbp_vxlan_tunnel_t* gbp_vxlan_tunnel_get ( index_t  gti)
inlinestatic

Definition at line 82 of file gbp_vxlan.c.

+ Here is the caller graph for this function:

◆ gbp_vxlan_tunnel_get_type()

gbp_vxlan_tunnel_type_t gbp_vxlan_tunnel_get_type ( u32  sw_if_index)

Definition at line 206 of file gbp_vxlan.c.

+ Here is the caller graph for this function:

◆ gbp_vxlan_tunnel_show_one()

static walk_rc_t gbp_vxlan_tunnel_show_one ( gbp_vxlan_tunnel_t gt,
void *  ctx 
)
static

Definition at line 516 of file gbp_vxlan.c.

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

◆ gbp_vxlan_walk()

void gbp_vxlan_walk ( gbp_vxlan_cb_t  cb,
void *  ctx 
)

Definition at line 502 of file gbp_vxlan.c.

+ Here is the caller graph for this function:

◆ gdb_vxlan_dep_add()

static u32 gdb_vxlan_dep_add ( gbp_vxlan_tunnel_t gt,
u32  vni,
const ip46_address_t *  src,
const ip46_address_t *  dst 
)
static

Definition at line 108 of file gbp_vxlan.c.

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

◆ gdb_vxlan_dep_del()

static void gdb_vxlan_dep_del ( index_t  vxri)
static

Definition at line 242 of file gbp_vxlan.c.

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

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( gbp_vxlan_device_class  )
+ Here is the caller graph for this function:

◆ VNET_HW_INTERFACE_CLASS()

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

◆ vxlan_gbp_tunnel_get_parent()

u32 vxlan_gbp_tunnel_get_parent ( u32  sw_if_index)

Definition at line 191 of file gbp_vxlan.c.

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

◆ vxlan_gbp_tunnel_lock()

void vxlan_gbp_tunnel_lock ( u32  sw_if_index)

Definition at line 300 of file gbp_vxlan.c.

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

◆ vxlan_gbp_tunnel_unlock()

void vxlan_gbp_tunnel_unlock ( u32  sw_if_index)

Definition at line 281 of file gbp_vxlan.c.

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

◆ vxlan_tunnel_ref_get()

static vxlan_tunnel_ref_t* vxlan_tunnel_ref_get ( index_t  vxri)
static

Definition at line 88 of file gbp_vxlan.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ gbp_vxlan4_input_node

vlib_node_registration_t gbp_vxlan4_input_node
Initial value:
=
{
.function = gbp_vxlan4_decap,
.name = "gbp-vxlan4",
.vector_size = sizeof (u32),
.n_errors = GBP_VXLAN_N_ERROR,
.error_strings = gbp_vxlan_error_strings,
.n_next_nodes = GBP_VXLAN_INPUT_N_NEXT,
.format_trace = format_gbp_vxlan_rx_trace,
.next_nodes = {
#define _(s,n)
},
}
static char * gbp_vxlan_error_strings[]
Definition: gbp_vxlan.c:339
static u8 * format_gbp_vxlan_rx_trace(u8 *s, va_list *args)
Definition: gbp_vxlan.c:461
unsigned int u32
Definition: types.h:88
static uword gbp_vxlan4_decap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: gbp_vxlan.c:475
#define foreach_gbp_vxlan_input_next
Definition: gbp_vxlan.c:313

(constructor) VLIB_REGISTER_NODE (gbp_vxlan4_input_node)

Definition at line 482 of file gbp_vxlan.c.

◆ gbp_vxlan_error_strings

char* gbp_vxlan_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_gbp_vxlan_error
Definition: gbp_vxlan.c:327

Definition at line 339 of file gbp_vxlan.c.

◆ gbp_vxlan_show_node

vlib_cli_command_t gbp_vxlan_show_node
static
Initial value:
= {
.path = "show gbp vxlan",
.short_help = "show gbp vxlan\n",
.function = gbp_vxlan_show,
}
static clib_error_t * gbp_vxlan_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp_vxlan.c:823

(constructor) VLIB_CLI_COMMAND (gbp_vxlan_show_node)

Definition at line 839 of file gbp_vxlan.c.

◆ gbp_vxlan_tunnel_db

index_t* gbp_vxlan_tunnel_db

DB of template interfaces by SW interface index.

Definition at line 62 of file gbp_vxlan.c.

◆ gbp_vxlan_tunnel_layer_strings

char* gbp_vxlan_tunnel_layer_strings[]
static
Initial value:

Definition at line 70 of file gbp_vxlan.c.

◆ gbp_vxlan_tunnel_pool

gbp_vxlan_tunnel_t* gbp_vxlan_tunnel_pool

Pool of template tunnels.

Definition at line 52 of file gbp_vxlan.c.

◆ gt_logger

vlib_log_class_t gt_logger

Logger.

Definition at line 47 of file gbp_vxlan.c.

◆ gv_db

uword* gv_db

DB of added tunnels.

Definition at line 42 of file gbp_vxlan.c.

◆ vxlan_tunnel_ref_db

index_t* vxlan_tunnel_ref_db

DB of child interfaces by SW interface index.

Definition at line 67 of file gbp_vxlan.c.

◆ vxlan_tunnel_ref_pool

vxlan_tunnel_ref_t* vxlan_tunnel_ref_pool

Pool of child tunnels.

Definition at line 57 of file gbp_vxlan.c.