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

Go to the source code of this file.

Data Structures

struct  gbp_learn_main_t_
 Grouping of global data for the GBP source EPG classification feature. More...
 
struct  gbp_learn_l2_t_
 
struct  gbp_learn_l2_trace_t_
 per-packet trace data More...
 
struct  gbp_learn_l3_t_
 
struct  gbp_learn_l3_trace_t_
 per-packet trace data More...
 

Macros

#define GBP_ENDPOINT_HASH_LEARN_RATE   (1e-2)
 The maximum learning rate per-hashed EP. More...
 
#define GBP_LEARN_DBG(...)   vlib_log_debug (gbp_learn_main.gl_logger, __VA_ARGS__);
 
#define foreach_gbp_learn   _(DROP, "drop")
 

Typedefs

typedef struct gbp_learn_main_t_ gbp_learn_main_t
 Grouping of global data for the GBP source EPG classification feature. More...
 
typedef struct gbp_learn_l2_t_ gbp_learn_l2_t
 
typedef struct gbp_learn_l2_trace_t_ gbp_learn_l2_trace_t
 per-packet trace data More...
 
typedef struct gbp_learn_l3_t_ gbp_learn_l3_t
 
typedef struct gbp_learn_l3_trace_t_ gbp_learn_l3_trace_t
 per-packet trace data More...
 

Enumerations

enum  gbp_learn_error_t { GBP_LEARN_N_ERROR }
 
enum  gbp_learn_next_t { GBP_LEARN_N_NEXT }
 

Functions

static void gbp_learn_l2_cp (const gbp_learn_l2_t *gl2)
 
static void gbp_learn_l2_ip4_dp (const u8 *mac, const ip4_address_t *ip, u32 bd_index, u32 sw_if_index, epg_id_t epg, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
 
static void gbp_learn_l2_ip6_dp (const u8 *mac, const ip6_address_t *ip, u32 bd_index, u32 sw_if_index, epg_id_t epg, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
 
static void gbp_learn_l2_dp (const u8 *mac, u32 bd_index, u32 sw_if_index, epg_id_t epg, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
 
static void gbp_learn_get_outer (const ethernet_header_t *eh0, ip4_address_t *outer_src, ip4_address_t *outer_dst)
 
static uword gbp_learn_l2 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_gbp_learn_l2_trace (u8 *s, va_list *args)
 
 VLIB_NODE_FUNCTION_MULTIARCH (gbp_learn_l2_node, gbp_learn_l2)
 
static void gbp_learn_l3_cp (const gbp_learn_l3_t *gl3)
 
static void gbp_learn_ip4_dp (const ip4_address_t *ip, u32 fib_index, u32 sw_if_index, epg_id_t epg, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
 
static void gbp_learn_ip6_dp (const ip6_address_t *ip, u32 fib_index, u32 sw_if_index, epg_id_t epg, const ip4_address_t *outer_src, const ip4_address_t *outer_dst)
 
static uword gbp_learn_l3 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
 
static u8format_gbp_learn_l3_trace (u8 *s, va_list *args)
 
static uword gbp_learn_ip4 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword gbp_learn_ip6 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (gbp_learn_ip4_node, gbp_learn_ip4)
 
 VNET_FEATURE_INIT (gbp_learn_ip4, static)
 
 VLIB_NODE_FUNCTION_MULTIARCH (gbp_learn_ip6_node, gbp_learn_ip6)
 
 VNET_FEATURE_INIT (gbp_learn_ip6, static)
 
void gbp_learn_enable (u32 sw_if_index, gbb_learn_mode_t mode)
 
void gbp_learn_disable (u32 sw_if_index, gbb_learn_mode_t mode)
 
static clib_error_tgbp_learn_init (vlib_main_t *vm)
 

Variables

static gbp_learn_main_t gbp_learn_main
 
static char * gbp_learn_error_strings []
 
vlib_node_registration_t gbp_learn_l2_node
 (constructor) VLIB_REGISTER_NODE (gbp_learn_l2_node) More...
 
vlib_node_registration_t gbp_learn_ip4_node
 (constructor) VLIB_REGISTER_NODE (gbp_learn_ip4_node) More...
 
vlib_node_registration_t gbp_learn_ip6_node
 (constructor) VLIB_REGISTER_NODE (gbp_learn_ip6_node) More...
 

Macro Definition Documentation

◆ foreach_gbp_learn

#define foreach_gbp_learn   _(DROP, "drop")

Definition at line 58 of file gbp_learn.c.

◆ GBP_ENDPOINT_HASH_LEARN_RATE

#define GBP_ENDPOINT_HASH_LEARN_RATE   (1e-2)

The maximum learning rate per-hashed EP.

Definition at line 51 of file gbp_learn.c.

◆ GBP_LEARN_DBG

#define GBP_LEARN_DBG (   ...)    vlib_log_debug (gbp_learn_main.gl_logger, __VA_ARGS__);

Definition at line 55 of file gbp_learn.c.

Typedef Documentation

◆ gbp_learn_l2_t

◆ gbp_learn_l2_trace_t

per-packet trace data

◆ gbp_learn_l3_t

◆ gbp_learn_l3_trace_t

per-packet trace data

◆ gbp_learn_main_t

Grouping of global data for the GBP source EPG classification feature.

Enumeration Type Documentation

◆ gbp_learn_error_t

Enumerator
GBP_LEARN_N_ERROR 

Definition at line 61 of file gbp_learn.c.

◆ gbp_learn_next_t

Enumerator
GBP_LEARN_N_NEXT 

Definition at line 75 of file gbp_learn.c.

Function Documentation

◆ format_gbp_learn_l2_trace()

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

Definition at line 367 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ format_gbp_learn_l3_trace()

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

Definition at line 642 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ gbp_learn_disable()

void gbp_learn_disable ( u32  sw_if_index,
gbb_learn_mode_t  mode 
)

Definition at line 720 of file gbp_learn.c.

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

◆ gbp_learn_enable()

void gbp_learn_enable ( u32  sw_if_index,
gbb_learn_mode_t  mode 
)

Definition at line 706 of file gbp_learn.c.

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

◆ gbp_learn_get_outer()

static void gbp_learn_get_outer ( const ethernet_header_t eh0,
ip4_address_t outer_src,
ip4_address_t outer_dst 
)
inlinestatic

Definition at line 197 of file gbp_learn.c.

+ Here is the caller graph for this function:

◆ gbp_learn_init()

static clib_error_t* gbp_learn_init ( vlib_main_t vm)
static

Definition at line 734 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ gbp_learn_ip4()

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

Definition at line 657 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ gbp_learn_ip4_dp()

static void gbp_learn_ip4_dp ( const ip4_address_t ip,
u32  fib_index,
u32  sw_if_index,
epg_id_t  epg,
const ip4_address_t outer_src,
const ip4_address_t outer_dst 
)
static

Definition at line 431 of file gbp_learn.c.

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

◆ gbp_learn_ip6()

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

Definition at line 664 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ gbp_learn_ip6_dp()

static void gbp_learn_ip6_dp ( const ip6_address_t ip,
u32  fib_index,
u32  sw_if_index,
epg_id_t  epg,
const ip4_address_t outer_src,
const ip4_address_t outer_dst 
)
static

Definition at line 453 of file gbp_learn.c.

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

◆ gbp_learn_l2()

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

Definition at line 215 of file gbp_learn.c.

+ Here is the call graph for this function:

◆ gbp_learn_l2_cp()

static void gbp_learn_l2_cp ( const gbp_learn_l2_t gl2)
static

Definition at line 96 of file gbp_learn.c.

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

◆ gbp_learn_l2_dp()

static void gbp_learn_l2_dp ( const u8 mac,
u32  bd_index,
u32  sw_if_index,
epg_id_t  epg,
const ip4_address_t outer_src,
const ip4_address_t outer_dst 
)
static

Definition at line 165 of file gbp_learn.c.

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

◆ gbp_learn_l2_ip4_dp()

static void gbp_learn_l2_ip4_dp ( const u8 mac,
const ip4_address_t ip,
u32  bd_index,
u32  sw_if_index,
epg_id_t  epg,
const ip4_address_t outer_src,
const ip4_address_t outer_dst 
)
static

Definition at line 124 of file gbp_learn.c.

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

◆ gbp_learn_l2_ip6_dp()

static void gbp_learn_l2_ip6_dp ( const u8 mac,
const ip6_address_t ip,
u32  bd_index,
u32  sw_if_index,
epg_id_t  epg,
const ip4_address_t outer_src,
const ip4_address_t outer_dst 
)
static

Definition at line 146 of file gbp_learn.c.

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

◆ gbp_learn_l3()

static uword gbp_learn_l3 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
fib_protocol_t  fproto 
)
static

Definition at line 488 of file gbp_learn.c.

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

◆ gbp_learn_l3_cp()

static void gbp_learn_l3_cp ( const gbp_learn_l3_t gl3)
static

Definition at line 412 of file gbp_learn.c.

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

◆ VLIB_NODE_FUNCTION_MULTIARCH() [1/3]

VLIB_NODE_FUNCTION_MULTIARCH ( gbp_learn_l2_node  ,
gbp_learn_l2   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [2/3]

VLIB_NODE_FUNCTION_MULTIARCH ( gbp_learn_ip4_node  ,
gbp_learn_ip4   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [3/3]

VLIB_NODE_FUNCTION_MULTIARCH ( gbp_learn_ip6_node  ,
gbp_learn_ip6   
)

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( gbp_learn_ip4  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( gbp_learn_ip6  ,
static   
)

Variable Documentation

◆ gbp_learn_error_strings

char* gbp_learn_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_gbp_learn
Definition: gbp_learn.c:58

Definition at line 69 of file gbp_learn.c.

◆ gbp_learn_ip4_node

vlib_node_registration_t gbp_learn_ip4_node
Initial value:
= {
.function = gbp_learn_ip4,
.name = "gbp-learn-ip4",
.vector_size = sizeof (u32),
.format_trace = format_gbp_learn_l3_trace,
}
static uword gbp_learn_ip4(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: gbp_learn.c:657
unsigned int u32
Definition: types.h:88
static u8 * format_gbp_learn_l3_trace(u8 *s, va_list *args)
Definition: gbp_learn.c:642

(constructor) VLIB_REGISTER_NODE (gbp_learn_ip4_node)

Definition at line 671 of file gbp_learn.c.

◆ gbp_learn_ip6_node

vlib_node_registration_t gbp_learn_ip6_node
Initial value:
= {
.function = gbp_learn_ip6,
.name = "gbp-learn-ip6",
.vector_size = sizeof (u32),
.format_trace = format_gbp_learn_l3_trace,
}
static uword gbp_learn_ip6(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: gbp_learn.c:664
unsigned int u32
Definition: types.h:88
static u8 * format_gbp_learn_l3_trace(u8 *s, va_list *args)
Definition: gbp_learn.c:642

(constructor) VLIB_REGISTER_NODE (gbp_learn_ip6_node)

Definition at line 687 of file gbp_learn.c.

◆ gbp_learn_l2_node

vlib_node_registration_t gbp_learn_l2_node
Initial value:
= {
.function = gbp_learn_l2,
.name = "gbp-learn-l2",
.vector_size = sizeof (u32),
.format_trace = format_gbp_learn_l2_trace,
.error_strings = gbp_learn_error_strings,
.n_next_nodes = GBP_LEARN_N_NEXT,
.next_nodes = {
[GBP_LEARN_NEXT_DROP] = "error-drop",
},
}
static u8 * format_gbp_learn_l2_trace(u8 *s, va_list *args)
Definition: gbp_learn.c:367
unsigned int u32
Definition: types.h:88
static uword gbp_learn_l2(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: gbp_learn.c:215
#define ARRAY_LEN(x)
Definition: clib.h:62
static char * gbp_learn_error_strings[]
Definition: gbp_learn.c:69

(constructor) VLIB_REGISTER_NODE (gbp_learn_l2_node)

Definition at line 381 of file gbp_learn.c.

◆ gbp_learn_main

gbp_learn_main_t gbp_learn_main
static

Definition at line 53 of file gbp_learn.c.