|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
74 #define _(n,s) [GBP_VXLAN_TUN_##n] = s,
79 #define GBP_VXLAN_TUN_DBG(...) \
80 vlib_log_debug (gt_logger, __VA_ARGS__);
135 const ip46_address_t *
src,
const ip46_address_t *
dst)
144 .mode = (GBP_VXLAN_TUN_L2 == gt->
gt_layer ?
155 if (VNET_API_ERROR_TUNNEL_EXIST ==
rv)
196 ofeat = L2OUTPUT_FEAT_GBP_POLICY_MAC;
200 ifeat |= L2INPUT_FEAT_GBP_LEARN;
272 const ip46_address_t *
src,
273 const ip46_address_t *
dst)
329 u32 dev_instance = va_arg (*args,
u32);
331 return format (s,
"gbp-vxlan-%d", dev_instance);
346 u32 dev_instance = va_arg (*args,
u32);
351 s =
format (s,
" [%d] gbp-vxlan-tunnel: hw:%d sw:%d vni:%d %U",
355 if (GBP_VXLAN_TUN_L2 == gt->
gt_layer)
360 s =
format (s,
" dependents:");
381 s =
format (s,
"GBP-VXLAN: vni:%d", t->
vni);
418 clib_warning (
"you shouldn't be here, leaking buffers...");
419 return frame->n_vectors;
424 .name =
"GBP VXLAN tunnel-template",
462 if (layer == GBP_VXLAN_TUN_L2)
468 return (VNET_API_ERROR_BD_NOT_MODIFIABLE);
477 return (VNET_API_ERROR_NO_SUCH_FIB);
490 gbp_vxlan_device_class.index,
492 gbp_vxlan_hw_interface_class.index,
503 if (layer == GBP_VXLAN_TUN_L2)
541 rv = VNET_API_ERROR_IF_ALREADY_EXISTS;
575 if (GBP_VXLAN_TUN_L2 == gt->
gt_layer)
593 return VNET_API_ERROR_NO_SUCH_ENTRY;
619 .path =
"show gbp vxlan",
620 .short_help =
"show gbp vxlan\n",
644 .runs_after =
VLIB_INITS(
"punt_init",
"vxlan_gbp_init"),
void gbp_itf_l2_set_input_feature(gbp_itf_hdl_t gh, l2input_feat_masks_t feats)
@ GBP_BD_FLAG_DO_NOT_LEARN
static uword gbp_vxlan_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static clib_error_t * gbp_vxlan_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
#define hash_set(h, key, value)
clib_error_t * gbp_vxlan_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the template GBP-VXLAN tunne...
gbp_itf_hdl_t gbp_vxlan_tunnel_clone_and_lock(u32 sw_if_index, const ip46_address_t *src, const ip46_address_t *dst)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static index_t * gbp_vxlan_tunnel_db
DB of template interfaces by SW interface index.
static u8 * format_gbp_vxlan_tunnel_name(u8 *s, va_list *args)
uword * gv_db
DB of added tunnels.
@ VXLAN_GBP_TUNNEL_MODE_L2
u32 gb_vni
The index of the BD's VNI interface on which packets from unkown endpoints arrive.
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
vlib_main_t vlib_node_runtime_t * node
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
u32 vxlan_gbp_tunnel_get_parent(u32 sw_if_index)
struct gbp_vxlan_tx_trace_t_ gbp_vxlan_tx_trace_t
@ foreach_gbp_vxlan_tunnel_layer
int vnet_vxlan_gbp_tunnel_del(u32 sw_if_index)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vxlan_tunnel_ref_t * vxlan_tunnel_ref_pool
Pool of child tunnels.
gbp_itf_hdl_t gbp_itf_l2_add_and_lock_w_free(u32 sw_if_index, index_t gbi, gbp_itf_free_fn_t ff)
u8 * format_gbp_vxlan_tunnel_layer(u8 *s, va_list *args)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
@ VNET_HW_INTERFACE_FLAG_LINK_UP
gbp_vxlan_tunnel_type_t gbp_vxlan_tunnel_get_type(u32 sw_if_index)
gbp_vxlan_tunnel_layer_t vxr_layer
gbp_itf_hdl_t gbp_itf_l3_add_and_lock(u32 sw_if_index, index_t gri)
static gbp_bridge_domain_t * gbp_bridge_domain_get(index_t i)
ip46_address_t gt_src
The source address to use for child tunnels.
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.
@ VXLAN_GBP_TUNNEL_MODE_L3
#define GBP_VXLAN_TUN_DBG(...)
#define hash_unset(h, key)
static walk_rc_t gbp_vxlan_tunnel_show_one(gbp_vxlan_tunnel_t *gt, void *ctx)
static gbp_itf_hdl_t gdb_vxlan_dep_add(gbp_vxlan_tunnel_t *gt, const ip46_address_t *src, const ip46_address_t *dst)
void gbp_itf_l2_set_output_feature(gbp_itf_hdl_t gh, l2output_feat_masks_t feats)
gbp_itf_hdl_t vxlan_gbp_tunnel_lock_itf(u32 sw_if_index)
#define GBP_ITF_L3_FEAT_LEARN
@ GBP_VXLAN_TEMPLATE_TUNNEL
This is the object type defined above.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
enum gbp_vxlan_tunnel_layer_t_ gbp_vxlan_tunnel_layer_t
gbp_itf_hdl_t gt_itf
gbp-itf config for this interface
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
VNET_DEVICE_CLASS(gbp_vxlan_device_class)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
void vxlan_gbp_unregister_udp_ports(void)
vnet_flood_class_t flood_class
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
void gbp_itf_lock(gbp_itf_hdl_t gh)
u8 * format_gbp_itf_hdl(u8 *s, va_list *args)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define VLIB_CLI_COMMAND(x,...)
gbp_vxlan_tunnel_layer_t gt_layer
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
walk_rc_t(* gbp_vxlan_cb_t)(gbp_vxlan_tunnel_t *gt, void *ctx)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
static char * gbp_vxlan_tunnel_layer_strings[]
static gbp_vxlan_tunnel_t * gbp_vxlan_tunnel_pool
Pool of template tunnels.
void gbp_endpoint_flush(gbp_endpoint_src_t src, u32 sw_if_index)
remove all learnt endpoints using the interface
GBP VXLAN (template) tunnel.
void vxlan_gbp_register_udp_ports(void)
static u8 * format_vxlan_tunnel_ref(u8 *s, va_list *args)
const static gbp_itf_hdl_t GBP_ITF_HDL_INVALID
void gbp_itf_l3_set_input_feature(gbp_itf_hdl_t gh, gbp_itf_l3_feat_t feats)
#define vec_free(V)
Free vector's memory (no header).
index_t gt_gbd
Reference to the GPB-BD.
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
static vlib_punt_hdl_t punt_hdl
handle registered with the ;unt infra
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
@ VNET_FLOOD_CLASS_NO_FLOOD
format_function_t format_ip46_address
#define VLIB_INIT_FUNCTION(x)
static clib_error_t * gbp_vxlan_init(vlib_main_t *vm)
VNET_HW_INTERFACE_CLASS(gbp_vxlan_hw_interface_class)
gbp_itf_hdl_t gbp_itf_l3_add_and_lock_w_free(u32 sw_if_index, index_t gri, gbp_itf_free_fn_t ff)
u8 * format_gbp_vxlan_tunnel(u8 *s, va_list *args)
#define vec_foreach(var, vec)
Vector iterator.
gbp_itf_hdl_t gbp_itf_l2_add_and_lock(u32 sw_if_index, index_t gbi)
int vlib_punt_hdl_t
Typedef for a client handle.
int vnet_vxlan_gbp_tunnel_add_del(vnet_vxlan_gbp_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
A bridge Domain Representation.
index_t gbp_route_domain_find_and_lock(u32 rd_id)
static void gdb_vxlan_dep_del(u32 sw_if_index)
u8 * format_gbp_vxlan_tx_trace(u8 *s, va_list *args)
vlib_punt_reason_t punt_no_such_tunnel[FIB_PROTOCOL_IP_MAX]
Punt reasons for no such tunnel.
void vxlan_gbp_tunnel_unlock(u32 sw_if_index)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
static index_t * vxlan_tunnel_ref_db
DB of child interfaces by SW interface index.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
index_t gt_grd
References to the GBP-RD.
@ VNET_HW_INTERFACE_CLASS_FLAG_P2P
a point 2 point interface
index_t * gt_tuns
list of child vxlan-gbp tunnels built from this template
#define clib_warning(format, args...)
@ VXLAN_GBP_TUNNEL
A real VXLAN-GBP tunnel (from vnet/vxlan-gbp/...)
static vxlan_tunnel_ref_t * vxlan_tunnel_ref_get(index_t vxri)
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)
enum gbp_vxlan_tunnel_type_t_ gbp_vxlan_tunnel_type_t
The different types of interfaces that endpoints are learned on.
struct vxlan_tunnel_ref_t_ vxlan_tunnel_ref_t
A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel of the template GBP-VXLAN tunne...
vlib_punt_hdl_t vlib_punt_client_register(const char *who)
Register a new clinet.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static vlib_log_class_t gt_logger
Logger.
vl_api_interface_index_t sw_if_index
void gbp_vxlan_walk(gbp_vxlan_cb_t cb, void *ctx)
enum walk_rc_t_ walk_rc_t
Walk return code.
static vlib_cli_command_t gbp_vxlan_show_node
(constructor) VLIB_CLI_COMMAND (gbp_vxlan_show_node)
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
gbp_vxlan_tunnel_t * gbp_vxlan_tunnel_get(index_t gti)
vxlan_gbp_main_t vxlan_gbp_main
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
int gbp_vxlan_tunnel_del(u32 vni)
#define vec_del1(v, i)
Delete the element at index I.
void gbp_route_domain_unlock(index_t index)
void gbp_itf_unlock(gbp_itf_hdl_t *gh)
void gbp_bridge_domain_unlock(index_t gbdi)
u32 gt_bd_rd_id
The BD or RD value (depending on the layer) that the tunnel is bound to.
vl_api_wireguard_peer_flags_t flags