76 #define _(n,s) [GBP_VXLAN_TUN_##n] = s, 81 #define GBP_VXLAN_TUN_DBG(...) \ 82 vlib_log_debug (gt_logger, __VA_ARGS__); 114 const ip46_address_t *
src,
const ip46_address_t *
dst)
123 .mode = (GBP_VXLAN_TUN_L2 == gt->
gt_layer ?
134 if (VNET_API_ERROR_TUNNEL_EXIST == rv)
143 ASSERT (~0 != sw_if_index);
176 ofeat = L2OUTPUT_FEAT_GBP_POLICY_MAC;
180 ifeat |= L2INPUT_FEAT_GBP_LEARN;
202 return (sw_if_index);
240 const ip46_address_t *
src,
241 const ip46_address_t *
dst)
293 pool_put (vxlan_tunnel_ref_pool, vxr);
347 gt - gbp_vxlan_tunnel_pool);
355 u32 dev_instance = va_arg (*args,
u32);
357 return format (s,
"gbp-vxlan-%d", dev_instance);
372 u32 dev_instance = va_arg (*args,
u32);
377 s =
format (s,
"GBP VXLAN tunnel: hw:%d sw:%d vni:%d %U",
380 if (GBP_VXLAN_TUN_L2 == gt->
gt_layer)
383 s =
format (s,
" RD:%d fib-index:[%d,%d]",
388 s =
format (s,
" children:[");
410 s =
format (s,
"GBP-VXLAN: vni:%d", t->
vni);
447 clib_warning (
"you shouldn't be here, leaking buffers...");
453 .name =
"GBP VXLAN tunnel-template",
491 if (layer == GBP_VXLAN_TUN_L2)
497 return (VNET_API_ERROR_BD_NOT_MODIFIABLE);
506 return (VNET_API_ERROR_NO_SUCH_FIB);
511 pool_get (gbp_vxlan_tunnel_pool, gt);
519 gbp_vxlan_device_class.index,
521 gbp_vxlan_hw_interface_class.index,
532 if (layer == GBP_VXLAN_TUN_L2)
587 rv = VNET_API_ERROR_IF_ALREADY_EXISTS;
613 gt - gbp_vxlan_tunnel_pool);
619 if (GBP_VXLAN_TUN_L2 == gt->
gt_layer)
645 pool_put (gbp_vxlan_tunnel_pool, gt);
648 return VNET_API_ERROR_NO_SUCH_ENTRY;
671 .path =
"show gbp vxlan",
672 .short_help =
"show gbp vxlan\n",
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
A real VXLAN-GBP tunnel (from vnet/vxlan-gbp/...)
u32 grd_table_id[FIB_PROTOCOL_IP_MAX]
VNET_DEVICE_CLASS(gbp_vxlan_device_class)
static vlib_punt_hdl_t punt_hdl
handle registered with the ;unt infra
void gbp_itf_set_l2_input_feature(index_t gii, index_t useri, l2input_feat_masks_t feats)
u32 gbp_vxlan_tunnel_clone_and_lock(u32 sw_if_index, const ip46_address_t *src, const ip46_address_t *dst)
void gbp_route_domain_unlock(index_t index)
u32 grd_vni_sw_if_index
The RD's VNI interface on which packets from unkown endpoints arrive.
#define hash_set(h, key, value)
static walk_rc_t gbp_vxlan_tunnel_show_one(gbp_vxlan_tunnel_t *gt, void *ctx)
#define hash_unset(h, key)
#define GBP_VXLAN_TUN_DBG(...)
vnet_main_t * vnet_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
u32 gb_vni
The index of the BD's VNI interface on which packets from unkown endpoints arrive.
clib_error_t * vxlan_gbp_init(vlib_main_t *vm)
u8 * format_gbp_vxlan_tx_trace(u8 *s, va_list *args)
ip46_address_t gt_src
The source address to use for child tunnels.
int vnet_vxlan_gbp_tunnel_add_del(vnet_vxlan_gbp_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
A bridge Domain Representation.
void vxlan_gbp_unregister_udp_ports(void)
int gbp_vxlan_tunnel_add(u32 vni, gbp_vxlan_tunnel_layer_t layer, u32 bd_rd_id, const ip4_address_t *src, u32 *sw_if_indexp)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int vlib_punt_hdl_t
Typedef for a client handle.
void gbp_vxlan_walk(gbp_vxlan_cb_t cb, void *ctx)
vxlan_gbp_main_t vxlan_gbp_main
static clib_error_t * gbp_vxlan_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * format_gbp_vxlan_tunnel_name(u8 *s, va_list *args)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
u8 * format_gbp_vxlan_tunnel(u8 *s, va_list *args)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static gbp_bridge_domain_t * gbp_bridge_domain_get(index_t i)
format_function_t format_vnet_sw_if_index_name
gbp_vxlan_tunnel_t * gbp_vxlan_tunnel_pool
Pool of template tunnels.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void gbp_itf_unlock(index_t gii)
int ip_table_bind(fib_protocol_t fproto, u32 sw_if_index, u32 table_id, u8 is_api)
gbp_vxlan_tunnel_layer_t vxr_layer
enum walk_rc_t_ walk_rc_t
Walk return code.
index_t * gt_tuns
list of child vxlan-gbp tunnels built from this template
void vxlan_gbp_tunnel_unlock(u32 sw_if_index)
vnet_flood_class_t flood_class
u8 * format_gbp_vxlan_tunnel_layer(u8 *s, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
static u8 * format_vxlan_tunnel_ref(u8 *s, va_list *args)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
#define vlib_call_init_function(vm, x)
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
static u32 gdb_vxlan_dep_add(gbp_vxlan_tunnel_t *gt, const ip46_address_t *src, const ip46_address_t *dst)
vlib_punt_hdl_t vlib_punt_client_register(const char *who)
Register a new clinet.
struct gbp_vxlan_tx_trace_t_ gbp_vxlan_tx_trace_t
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_punt_reason_t punt_no_such_tunnel[FIB_PROTOCOL_IP_MAX]
Punt reasons for no such tunnel.
void gbp_learn_enable(u32 sw_if_index, gbb_learn_mode_t mode)
u32 gt_bd_index
BD index (if L2)
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
walk_rc_t(* gbp_vxlan_cb_t)(gbp_vxlan_tunnel_t *gt, void *ctx)
#define pool_put(P, E)
Free an object E in pool P.
This is the object type deifend above.
#define vec_del1(v, i)
Delete the element at index I.
void gbp_itf_set_l2_output_feature(index_t gii, index_t useri, l2output_feat_masks_t feats)
static clib_error_t * punt_init(vlib_main_t *vm)
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
#define ip46_address_is_ip4(ip46)
enum gbp_vxlan_tunnel_layer_t_ gbp_vxlan_tunnel_layer_t
#define vec_free(V)
Free vector's memory (no header).
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
#define clib_warning(format, args...)
int gbp_vxlan_tunnel_del(u32 vni)
index_t * gbp_vxlan_tunnel_db
DB of template interfaces by SW interface index.
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
static clib_error_t * gbp_vxlan_init(vlib_main_t *vm)
void gbp_endpoint_flush(gbp_endpoint_src_t src, u32 sw_if_index)
remove all learnt endpoints using the interface
void vxlan_gbp_register_udp_ports(void)
#define VLIB_CLI_COMMAND(x,...)
gbp_vxlan_tunnel_layer_t gt_layer
gbp_route_domain_t * gbp_route_domain_get(index_t i)
static vxlan_tunnel_ref_t * vxlan_tunnel_ref_get(index_t vxri)
clib_error_t * gbp_vxlan_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
int vnet_vxlan_gbp_tunnel_del(u32 sw_if_index)
index_t gt_gbd
Reference to the GPB-BD.
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vlib_log_class_t gt_logger
Logger.
int vlib_punt_register(vlib_punt_hdl_t client, vlib_punt_reason_t reason, const char *node_name)
Register a node to receive particular punted buffers.
gbp_vxlan_tunnel_t * gbp_vxlan_tunnel_get(index_t gti)
u32 vxlan_gbp_tunnel_get_parent(u32 sw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
A route Domain Representation.
static void gdb_vxlan_dep_del(index_t vxri)
enum gbp_vxlan_tunnel_type_t_ gbp_vxlan_tunnel_type_t
The different types of interfaces that endpoints are learned on.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
a point 2 point interface
gbp_vxlan_tunnel_type_t gbp_vxlan_tunnel_get_type(u32 sw_if_index)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
void gbp_learn_disable(u32 sw_if_index, gbb_learn_mode_t mode)
GBP VXLAN (template) tunnel.
index_t * vxlan_tunnel_ref_db
DB of child interfaces by SW interface index.
A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the tempplate GBP-VXLAN tunn...
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
#define vec_foreach(var, vec)
Vector iterator.
index_t gt_itf
gbp-itf config for this interface
index_t gt_grd
References to the GBP-RD.
u32 gt_bd_rd_id
The BD or RD value (depending on the layer) that the tunnel is bound to.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
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 tunn...
void gbp_bridge_domain_unlock(index_t index)
index_t gbp_itf_add_and_lock(u32 sw_if_index, u32 bd_index)
uword * gv_db
DB of added tunnels.
static char * gbp_vxlan_tunnel_layer_strings[]
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static uword gbp_vxlan_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
VNET_HW_INTERFACE_CLASS(gbp_vxlan_hw_interface_class)
vxlan_tunnel_ref_t * vxlan_tunnel_ref_pool
Pool of child tunnels.
u32 gt_fib_index[FIB_PROTOCOL_IP_MAX]
FIB inidices (if L3)
index_t gbp_route_domain_find_and_lock(u32 rd_id)
void vxlan_gbp_tunnel_lock(u32 sw_if_index)