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, 186 u32 n_left_from, *from, *to_next, next_index, thread_index, seed;
192 n_left_from = frame->n_vectors;
199 while (n_left_from > 0)
205 while (n_left_from > 0 && n_left_to_next > 0)
209 u32 bi0, sw_if_index0, t0;
216 next0 = GBP_LEARN_NEXT_DROP;
231 L2INPUT_FEAT_GBP_LEARN);
238 if ((
vnet_buffer2 (b0)->gbp.flags & VXLAN_GBP_GPFLAGS_D) ||
266 switch (clib_net_to_host_u16 (eh0->
type))
268 case ETHERNET_TYPE_IP4:
277 sw_if_index0, sclass0,
278 &outer_src, &outer_dst);
282 case ETHERNET_TYPE_IP6:
291 sw_if_index0, sclass0,
292 &outer_src, &outer_dst);
296 case ETHERNET_TYPE_ARP:
305 sw_if_index0, sclass0,
306 &outer_src, &outer_dst);
312 sw_if_index0, sclass0,
313 &outer_src, &outer_dst);
339 VXLAN_GBP_GPFLAGS_D);
344 to_next, n_left_to_next,
351 return frame->n_vectors;
362 s =
format (s,
"new:%d throttled:%d d-bit:%d mac:%U itf:%d sclass:%d" 373 .name =
"gbp-learn-l2",
374 .vector_size =
sizeof (
u32),
384 [GBP_LEARN_NEXT_DROP] =
"error-drop",
430 .fib_index = fib_index,
452 .fib_index = fib_index,
480 u32 n_left_from, *from, *to_next, next_index, thread_index, seed;
493 while (n_left_from > 0)
499 while (n_left_from > 0 && n_left_to_next > 0)
503 u32 bi0, sw_if_index0, t0, fib_index0;
511 next0 = GBP_LEARN_NEXT_DROP;
551 (&ip6_0->src_address), seed);
556 fib_index0, sw_if_index0, sclass0,
557 &outer_src, &outer_dst);
582 ip4_0->src_address.as_u32, seed);
587 fib_index0, sw_if_index0, sclass0,
588 &outer_src, &outer_dst);
619 to_next, n_left_to_next,
637 s =
format (s,
"new:%d throttled:%d ip:%U itf:%d sclass:%d",
661 .name =
"gbp-learn-ip4",
662 .vector_size =
sizeof (
u32),
669 .arc_name =
"ip4-unicast",
670 .node_name =
"gbp-learn-ip4",
674 .name =
"gbp-learn-ip6",
675 .vector_size =
sizeof (
u32),
682 .arc_name =
"ip6-unicast",
683 .node_name =
"gbp-learn-ip6",
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static void gbp_learn_l2_cp(const gbp_learn_l2_t *gl2)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static gbp_bridge_domain_t * gbp_bridge_domain_get_by_bd_index(u32 bd_index)
f64 ge_last_time
The last time a packet from seen from this end point.
A Group Based Policy Endpoint.
vlib_node_registration_t gbp_learn_l2_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_l2_node)
gbp_endpoint_fwd_t ge_fwd
struct gbp_learn_l2_trace_t_ gbp_learn_l2_trace_t
per-packet trace data
struct gbp_learn_l3_t_ gbp_learn_l3_t
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
index_t gef_itf
The interface on which the EP is connected.
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.
A bridge Domain Representation.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void gbp_learn_l3_cp(const gbp_learn_l3_t *gl3)
Grouping of global data for the GBP source EPG classification feature.
#define VLIB_NODE_FN(node)
static u32 ip6_address_hash_to_u32(const ip6_address_t *a)
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 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)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
gbp_learn_main_t gbp_learn_main
throttle_t gl_l3_throttle
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip4(const ip4_address_t *ip, u32 fib_index)
gbp_bridge_domain_flags_t gb_flags
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)
enum gbp_bridge_domain_flags_t_ gbp_bridge_domain_flags_t
Bridge Domain Flags.
u32 gl_l2_input_feat_next[32]
Next nodes for L2 output features.
struct gbp_learn_l3_trace_t_ gbp_learn_l3_trace_t
per-packet trace data
static_always_inline gbp_endpoint_t * gbp_endpoint_find_mac(const u8 *mac, u32 bd_index)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
vlib_node_registration_t gbp_learn_ip6_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_ip6_node)
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)
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
vlib_node_registration_t gbp_learn_ip4_node
(constructor) VLIB_REGISTER_NODE (gbp_learn_ip4_node)
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)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
static u8 * format_gbp_learn_l3_trace(u8 *s, va_list *args)
#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.
#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).
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)
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip6(const ip6_address_t *ip, u32 fib_index)
#define VLIB_REGISTER_NODE(x,...)
static void gbp_learn_get_outer(const ethernet_header_t *eh0, ip4_address_t *outer_src, ip4_address_t *outer_dst)
#define vec_free(V)
Free vector's memory (no header).
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static uword gbp_learn_l3(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
#define ip46_address_set_ip4(ip46, ip)
static char * gbp_learn_error_strings[]
u8 * format_gbp_bridge_domain_flags(u8 *s, va_list *args)
throttle_t gl_l2_throttle
throttles for the DP leanring
static_always_inline void ip46_address_set_ip6(ip46_address_t *dst, const ip6_address_t *src)
VNET_FEATURE_INIT(gbp_learn_ip4, static)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
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)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static u8 * format_gbp_learn_l2_trace(u8 *s, va_list *args)
VLIB buffer representation.
struct gbp_learn_l2_t_ gbp_learn_l2_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define foreach_gbp_learn
#define GBP_LEARN_DBG(...)
u8 * format_mac_address_t(u8 *s, va_list *args)
vl_api_address_t ips[n_ips]
#define ip46_address_is_zero(ip46)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)