|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
27 #define GBP_LEARN_DBG(...) \
28 vlib_log_debug (gbp_learn_main.gl_logger, __VA_ARGS__);
30 #define foreach_gbp_learn \
35 #define _(sym,str) GBP_LEARN_ERROR_##sym,
42 #define _(sym,string) string,
49 #define _(sym,str) GBP_LEARN_NEXT_##sym,
70 ip46_address_t *
ips = NULL;
101 .bd_index = bd_index,
104 .outer_src.ip4 = *outer_src,
105 .outer_dst.ip4 = *outer_dst,
120 .bd_index = bd_index,
123 .outer_src.ip4 = *outer_src,
124 .outer_dst.ip4 = *outer_dst,
139 .bd_index = bd_index,
141 .outer_src.ip4 = *outer_src,
142 .outer_dst.ip4 = *outer_dst,
231 u32 bi0, sw_if_index0, t0;
238 next0 = GBP_LEARN_NEXT_DROP;
253 L2INPUT_FEAT_GBP_LEARN);
260 if ((
vnet_buffer2 (b0)->gbp.flags & VXLAN_GBP_GPFLAGS_D) ||
288 switch (clib_net_to_host_u16 (eh0->
type))
290 case ETHERNET_TYPE_IP4:
299 sw_if_index0, sclass0,
300 &outer_src, &outer_dst);
304 case ETHERNET_TYPE_IP6:
313 sw_if_index0, sclass0,
314 &outer_src, &outer_dst);
318 case ETHERNET_TYPE_ARP:
327 sw_if_index0, sclass0,
328 &outer_src, &outer_dst);
334 sw_if_index0, sclass0,
335 &outer_src, &outer_dst);
355 t->
new = (NULL == ge0);
361 VXLAN_GBP_GPFLAGS_D);
366 to_next, n_left_to_next,
373 return frame->n_vectors;
384 s =
format (s,
"new:%d throttled:%d d-bit:%d mac:%U itf:%d sclass:%d"
395 .name =
"gbp-learn-l2",
396 .vector_size =
sizeof (
u32),
406 [GBP_LEARN_NEXT_DROP] =
"error-drop",
424 ip46_address_t *
ips = NULL;
452 .fib_index = fib_index,
454 .outer_src.ip4 = *outer_src,
455 .outer_dst.ip4 = *outer_dst,
474 .fib_index = fib_index,
476 .outer_src.ip4 = *outer_src,
477 .outer_dst.ip4 = *outer_dst,
525 u32 bi0, sw_if_index0, t0, fib_index0;
533 next0 = GBP_LEARN_NEXT_DROP;
574 (&ip6_0->src_address), seed);
579 fib_index0, sw_if_index0, sclass0,
580 &outer_src, &outer_dst);
606 ip4_0->src_address.as_u32, seed);
611 fib_index0, sw_if_index0, sclass0,
612 &outer_src, &outer_dst);
636 t->
new = (NULL == ge0);
643 to_next, n_left_to_next,
650 return frame->n_vectors;
661 s =
format (s,
"new:%d throttled:%d ip:%U itf:%d sclass:%d",
685 .name =
"gbp-learn-ip4",
686 .vector_size =
sizeof (
u32),
693 .arc_name =
"ip4-unicast",
694 .node_name =
"gbp-learn-ip4",
698 .name =
"gbp-learn-ip6",
699 .vector_size =
sizeof (
u32),
706 .arc_name =
"ip6-unicast",
707 .node_name =
"gbp-learn-ip6",
@ GBP_BD_FLAG_DO_NOT_LEARN
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static void gbp_learn_l2_cp(const gbp_learn_l2_t *gl2)
@ GBP_ENDPOINT_FLAG_LEARNT
gbp_endpoint_fwd_t ge_fwd
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
@ GBP_ENDPOINT_FLAG_REMOTE
sclass_t gef_sclass
Endpoint Group's sclass.
nat44_ei_hairpin_src_next_t next_index
struct gbp_learn_l3_trace_t_ gbp_learn_l3_trace_t
per-packet trace data
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Grouping of global data for the GBP source EPG classification feature.
static void ip46_address_set_ip4(ip46_address_t *ip46, const ip4_address_t *ip)
@ VLIB_NODE_TYPE_INTERNAL
static_always_inline void ip46_address_set_ip6(ip46_address_t *dst, const ip6_address_t *src)
vlib_main_t vlib_node_runtime_t * node
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void gbp_learn_l2_dp(const u8 *mac, u32 bd_index, u32 sw_if_index, sclass_t sclass, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static void gbp_learn_l3_cp(const gbp_learn_l3_t *gl3)
struct gbp_learn_l2_trace_t_ gbp_learn_l2_trace_t
per-packet trace data
static void gbp_learn_l2_ip4_dp(const u8 *mac, const ip4_address_t *ip, u32 bd_index, u32 sw_if_index, sclass_t sclass, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip4(const ip4_address_t *ip, u32 fib_index)
vl_api_address_t ips[n_ips]
#define VLIB_NODE_FN(node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static_always_inline gbp_endpoint_t * gbp_endpoint_find_mac(const u8 *mac, u32 bd_index)
vlib_node_registration_t gbp_learn_ip4_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_ip4_node)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
u8 * format_mac_address_t(u8 *s, va_list *args)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t gbp_learn_ip6_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_ip6_node)
static u8 * format_gbp_learn_l3_trace(u8 *s, va_list *args)
u32 gbp_itf_get_sw_if_index(gbp_itf_hdl_t hdl)
static void gbp_learn_ip4_dp(const ip4_address_t *ip, u32 fib_index, u32 sw_if_index, sclass_t sclass, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
gbp_learn_main_t gbp_learn_main
static void gbp_learn_l2_ip6_dp(const u8 *mac, const ip6_address_t *ip, u32 bd_index, u32 sw_if_index, sclass_t sclass, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
gbp_itf_hdl_t gef_itf
The interface on which the EP is connected.
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static int gbp_endpoint_update_required(const gbp_endpoint_t *ge0, u32 rx_sw_if_index, sclass_t sclass)
struct _vlib_node_registration vlib_node_registration_t
static u8 ip46_address_is_zero(const ip46_address_t *ip46)
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
static u32 ip6_address_hash_to_u32(const ip6_address_t *a)
int gbp_endpoint_is_learnt(const gbp_endpoint_t *ge)
#define vec_free(V)
Free vector's memory (no header).
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
struct gbp_learn_l3_t_ gbp_learn_l3_t
int gbp_endpoint_update_and_lock(gbp_endpoint_src_t src, u32 sw_if_index, const ip46_address_t *ips, const mac_address_t *mac, index_t gbdi, index_t grdi, sclass_t sclass, gbp_endpoint_flags_t flags, const ip46_address_t *tun_src, const ip46_address_t *tun_dst, u32 *handle)
f64 ge_last_time
The last time a packet from seen from this end point.
description fragment has unexpected format
gbp_bridge_domain_flags_t gb_flags
static uword gbp_learn_l3(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
vlib_put_next_frame(vm, node, next_index, 0)
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)
format_function_t format_ip46_address
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip6(const ip6_address_t *ip, u32 fib_index)
static void gbp_learn_get_outer(const ethernet_header_t *eh0, ip4_address_t *outer_src, ip4_address_t *outer_dst)
static u8 * format_gbp_learn_l2_trace(u8 *s, va_list *args)
static char * gbp_learn_error_strings[]
throttle_t gl_l3_throttle
u8 * format_gbp_bridge_domain_flags(u8 *s, va_list *args)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
VNET_FEATURE_INIT(gbp_learn_ip4, static)
A bridge Domain Representation.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
enum gbp_bridge_domain_flags_t_ gbp_bridge_domain_flags_t
Bridge Domain Flags.
#define foreach_gbp_learn
u32 gl_l2_input_feat_next[32]
Next nodes for L2 output features.
A Group Based Policy Endpoint.
static f64 vlib_time_now(vlib_main_t *vm)
struct gbp_learn_l2_t_ gbp_learn_l2_t
#define GBP_LEARN_DBG(...)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static void gbp_learn_ip6_dp(const ip6_address_t *ip, u32 fib_index, u32 sw_if_index, sclass_t sclass, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
vlib_node_registration_t gbp_learn_l2_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_l2_node)
vl_api_fib_path_type_t type
static gbp_bridge_domain_t * gbp_bridge_domain_get_by_bd_index(u32 bd_index)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
throttle_t gl_l2_throttle
throttles for the DP leanring