FD.io VPP  v19.04.2-12-g66b1689
Vector Packet Processing
gbp_endpoint.c File Reference
+ Include dependency graph for gbp_endpoint.c:

Go to the source code of this file.

Data Structures

struct  gbp_endpoint_flush_ctx_t_
 

Macros

#define GBP_ENDPOINT_DBG(...)   vlib_log_debug (gbp_ep_logger, __VA_ARGS__);
 
#define GBP_ENDPOINT_INFO(...)   vlib_log_notice (gbp_ep_logger, __VA_ARGS__);
 
#define FOR_EACH_GBP_ENDPOINT_ATTR(_item)
 
#define GBP_EP_HASH_NUM_BUCKETS   (2 * 1024)
 
#define GBP_EP_HASH_MEMORY_SIZE   (1 << 20)
 

Typedefs

typedef struct gbp_endpoint_flush_ctx_t_ gbp_endpoint_flush_ctx_t
 

Functions

u8format_gbp_endpoint_flags (u8 *s, va_list *args)
 
int gbp_endpoint_is_remote (const gbp_endpoint_t *ge)
 
int gbp_endpoint_is_local (const gbp_endpoint_t *ge)
 
int gbp_endpoint_is_external (const gbp_endpoint_t *ge)
 
static void gbp_endpoint_extract_key_mac_itf (const clib_bihash_kv_16_8_t *key, mac_address_t *mac, u32 *sw_if_index)
 
static void gbp_endpoint_extract_key_ip_itf (const clib_bihash_kv_24_8_t *key, ip46_address_t *ip, u32 *sw_if_index)
 
gbp_endpoint_tgbp_endpoint_find_ip (const ip46_address_t *ip, u32 fib_index)
 
static void gbp_endpoint_add_itf (u32 sw_if_index, index_t gei)
 
static bool gbp_endpoint_add_mac (const mac_address_t *mac, u32 bd_index, index_t gei)
 
static bool gbp_endpoint_add_ip (const ip46_address_t *ip, u32 fib_index, index_t gei)
 
static void gbp_endpoint_del_mac (const mac_address_t *mac, u32 bd_index)
 
static void gbp_endpoint_del_ip (const ip46_address_t *ip, u32 fib_index)
 
static index_t gbp_endpoint_index (const gbp_endpoint_t *ge)
 
static ip46_type_t ip46_address_get_type (const ip46_address_t *a)
 
static int gbp_endpoint_ip_is_equal (const fib_prefix_t *fp, const ip46_address_t *ip)
 
static void gbp_endpoint_ips_update (gbp_endpoint_t *ge, const ip46_address_t *ips, const gbp_route_domain_t *grd)
 
static gbp_endpoint_tgbp_endpoint_alloc (const ip46_address_t *ips, const gbp_route_domain_t *grd, const mac_address_t *mac, const gbp_bridge_domain_t *gbd)
 
static int gbp_endpoint_loc_is_equal (gbp_endpoint_loc_t *a, gbp_endpoint_loc_t *b)
 
static int gbp_endpoint_loc_cmp_for_sort (gbp_endpoint_loc_t *a, gbp_endpoint_loc_t *b)
 
static gbp_endpoint_loc_tgbp_endpoint_loc_find (gbp_endpoint_t *ge, gbp_endpoint_src_t src)
 
static int gbp_endpoint_loc_unlock (gbp_endpoint_t *ge, gbp_endpoint_loc_t *gel)
 
static void gbp_endpoint_loc_destroy (gbp_endpoint_loc_t *gel)
 
static gbp_endpoint_loc_tgbp_endpoint_loc_find_or_add (gbp_endpoint_t *ge, gbp_endpoint_src_t src)
 
static int gbp_endpoint_find_for_update (const ip46_address_t *ips, const gbp_route_domain_t *grd, const mac_address_t *mac, const gbp_bridge_domain_t *gbd, gbp_endpoint_t **ge)
 Find an EP inthe DBs and check that if we find it in the L2 DB it has the same IPs as this update. More...
 
static gbp_endpoint_src_t gbp_endpoint_get_best_src (const gbp_endpoint_t *ge)
 
static void gbp_endpoint_n_learned (int n)
 
static void gbp_endpoint_loc_update (gbp_endpoint_loc_t *gel, const gbp_bridge_domain_t *gb, u32 sw_if_index, index_t ggi, gbp_endpoint_flags_t flags, const ip46_address_t *tun_src, const ip46_address_t *tun_dst)
 
static void gbb_endpoint_fwd_reset (gbp_endpoint_t *ge)
 
static void gbb_endpoint_fwd_recalc (gbp_endpoint_t *ge)
 
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)
 
void gbp_endpoint_unlock (gbp_endpoint_src_t src, index_t gei)
 
u32 gbp_endpoint_child_add (index_t gei, fib_node_type_t type, fib_node_index_t index)
 
void gbp_endpoint_child_remove (index_t gei, u32 sibling)
 
static walk_rc_t gbp_endpoint_flush_cb (index_t gei, void *args)
 
void gbp_endpoint_flush (gbp_endpoint_src_t src, u32 sw_if_index)
 remove all learnt endpoints using the interface More...
 
void gbp_endpoint_walk (gbp_endpoint_cb_t cb, void *ctx)
 
static clib_error_tgbp_endpoint_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
u8format_gbp_endpoint_src (u8 *s, va_list *args)
 
static u8format_gbp_endpoint_fwd (u8 *s, va_list *args)
 
static u8format_gbp_endpoint_key (u8 *s, va_list *args)
 
static u8format_gbp_endpoint_loc (u8 *s, va_list *args)
 
u8format_gbp_endpoint (u8 *s, va_list *args)
 
static walk_rc_t gbp_endpoint_show_one (index_t gei, void *ctx)
 
static void gbp_endpoint_walk_ip_itf (const clib_bihash_kv_24_8_t *kvp, void *arg)
 
static void gbp_endpoint_walk_mac_itf (const clib_bihash_kv_16_8_t *kvp, void *arg)
 
static clib_error_tgbp_endpoint_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void gbp_endpoint_check (index_t gei, f64 start_time)
 
static void gbp_endpoint_scan_l2 (vlib_main_t *vm)
 
static void gbp_endpoint_scan_l3 (vlib_main_t *vm)
 
void gbp_endpoint_scan (vlib_main_t *vm)
 
static fib_node_tgbp_endpoint_get_node (fib_node_index_t index)
 
static gbp_endpoint_tgbp_endpoint_from_fib_node (fib_node_t *node)
 
static void gbp_endpoint_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t gbp_endpoint_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static clib_error_tgbp_endpoint_init (vlib_main_t *vm)
 

Variables

static const char * gbp_endpoint_attr_names [] = GBP_ENDPOINT_ATTR_NAMES
 
gbp_ep_db_t gbp_ep_db
 EP DBs. More...
 
fib_node_type_t gbp_endpoint_fib_type
 
vlib_log_class_t gbp_ep_logger
 
gbp_endpoint_tgbp_endpoint_pool
 Pool of GBP endpoints. More...
 
static u32 gbp_n_learnt_endpoints
 A count of the number of dynamic entries. More...
 
static vlib_cli_command_t gbp_endpoint_cli_node
 (constructor) VLIB_CLI_COMMAND (gbp_endpoint_cli_node) More...
 
static vlib_cli_command_t gbp_endpoint_show_node
 (constructor) VLIB_CLI_COMMAND (gbp_endpoint_show_node) More...
 
static const fib_node_vft_t gbp_endpoint_vft
 

Macro Definition Documentation

#define FOR_EACH_GBP_ENDPOINT_ATTR (   _item)
Value:

Definition at line 64 of file gbp_endpoint.c.

#define GBP_ENDPOINT_DBG (   ...)    vlib_log_debug (gbp_ep_logger, __VA_ARGS__);

Definition at line 48 of file gbp_endpoint.c.

#define GBP_ENDPOINT_INFO (   ...)    vlib_log_notice (gbp_ep_logger, __VA_ARGS__);

Definition at line 51 of file gbp_endpoint.c.

#define GBP_EP_HASH_MEMORY_SIZE   (1 << 20)
#define GBP_EP_HASH_NUM_BUCKETS   (2 * 1024)

Typedef Documentation

Function Documentation

u8* format_gbp_endpoint ( u8 s,
va_list *  args 
)

Definition at line 1242 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_gbp_endpoint_flags ( u8 s,
va_list *  args 
)

Definition at line 70 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1180 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1195 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1214 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_gbp_endpoint_src ( u8 s,
va_list *  args 
)

Definition at line 1165 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbb_endpoint_fwd_recalc ( gbp_endpoint_t ge)
static

Definition at line 617 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbb_endpoint_fwd_reset ( gbp_endpoint_t ge)
static

Definition at line 564 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool gbp_endpoint_add_ip ( const ip46_address_t *  ip,
u32  fib_index,
index_t  gei 
)
static

Definition at line 161 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_add_itf ( u32  sw_if_index,
index_t  gei 
)
static

Definition at line 138 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static bool gbp_endpoint_add_mac ( const mac_address_t mac,
u32  bd_index,
index_t  gei 
)
static

Definition at line 146 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static gbp_endpoint_t* gbp_endpoint_alloc ( const ip46_address_t *  ips,
const gbp_route_domain_t grd,
const mac_address_t mac,
const gbp_bridge_domain_t gbd 
)
static

Definition at line 244 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_back_walk_rc_t gbp_endpoint_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 1542 of file gbp_endpoint.c.

static void gbp_endpoint_check ( index_t  gei,
f64  start_time 
)
static

Definition at line 1363 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gbp_endpoint_child_add ( index_t  gei,
fib_node_type_t  type,
fib_node_index_t  index 
)

Definition at line 1001 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_child_remove ( index_t  gei,
u32  sibling 
)

Definition at line 1008 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* gbp_endpoint_cli ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1079 of file gbp_endpoint.c.

+ Here is the call graph for this function:

static void gbp_endpoint_del_ip ( const ip46_address_t *  ip,
u32  fib_index 
)
static

Definition at line 185 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_del_mac ( const mac_address_t mac,
u32  bd_index 
)
static

Definition at line 175 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_extract_key_ip_itf ( const clib_bihash_kv_24_8_t key,
ip46_address_t *  ip,
u32 sw_if_index 
)
static

Definition at line 113 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static void gbp_endpoint_extract_key_mac_itf ( const clib_bihash_kv_16_8_t key,
mac_address_t mac,
u32 sw_if_index 
)
static

Definition at line 105 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int gbp_endpoint_find_for_update ( const ip46_address_t *  ips,
const gbp_route_domain_t grd,
const mac_address_t mac,
const gbp_bridge_domain_t gbd,
gbp_endpoint_t **  ge 
)
static

Find an EP inthe DBs and check that if we find it in the L2 DB it has the same IPs as this update.

Definition at line 378 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

gbp_endpoint_t* gbp_endpoint_find_ip ( const ip46_address_t *  ip,
u32  fib_index 
)

Definition at line 122 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_flush ( gbp_endpoint_src_t  src,
u32  sw_if_index 
)

remove all learnt endpoints using the interface

Definition at line 1042 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static walk_rc_t gbp_endpoint_flush_cb ( index_t  gei,
void *  args 
)
static

Definition at line 1021 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static gbp_endpoint_t* gbp_endpoint_from_fib_node ( fib_node_t node)
static

Definition at line 1506 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static gbp_endpoint_src_t gbp_endpoint_get_best_src ( const gbp_endpoint_t ge)
static

Definition at line 449 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static fib_node_t* gbp_endpoint_get_node ( fib_node_index_t  index)
static

Definition at line 1496 of file gbp_endpoint.c.

+ Here is the call graph for this function:

static index_t gbp_endpoint_index ( const gbp_endpoint_t ge)
static

Definition at line 195 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static clib_error_t* gbp_endpoint_init ( vlib_main_t vm)
static

Definition at line 1561 of file gbp_endpoint.c.

+ Here is the call graph for this function:

static int gbp_endpoint_ip_is_equal ( const fib_prefix_t fp,
const ip46_address_t *  ip 
)
static

Definition at line 207 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static void gbp_endpoint_ips_update ( gbp_endpoint_t ge,
const ip46_address_t *  ips,
const gbp_route_domain_t grd 
)
static

Definition at line 213 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int gbp_endpoint_is_external ( const gbp_endpoint_t ge)

Definition at line 99 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

int gbp_endpoint_is_local ( const gbp_endpoint_t ge)

Definition at line 93 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

int gbp_endpoint_is_remote ( const gbp_endpoint_t ge)

Definition at line 87 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static void gbp_endpoint_last_lock_gone ( fib_node_t node)
static

Definition at line 1513 of file gbp_endpoint.c.

+ Here is the call graph for this function:

static int gbp_endpoint_loc_cmp_for_sort ( gbp_endpoint_loc_t a,
gbp_endpoint_loc_t b 
)
static

Definition at line 279 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static void gbp_endpoint_loc_destroy ( gbp_endpoint_loc_t gel)
static

Definition at line 326 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static gbp_endpoint_loc_t* gbp_endpoint_loc_find ( gbp_endpoint_t ge,
gbp_endpoint_src_t  src 
)
static

Definition at line 285 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static gbp_endpoint_loc_t* gbp_endpoint_loc_find_or_add ( gbp_endpoint_t ge,
gbp_endpoint_src_t  src 
)
static

Definition at line 337 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int gbp_endpoint_loc_is_equal ( gbp_endpoint_loc_t a,
gbp_endpoint_loc_t b 
)
static

Definition at line 273 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static int gbp_endpoint_loc_unlock ( gbp_endpoint_t ge,
gbp_endpoint_loc_t gel 
)
static

Definition at line 302 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_loc_update ( gbp_endpoint_loc_t gel,
const gbp_bridge_domain_t gb,
u32  sw_if_index,
index_t  ggi,
gbp_endpoint_flags_t  flags,
const ip46_address_t *  tun_src,
const ip46_address_t *  tun_dst 
)
static

Definition at line 477 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_n_learned ( int  n)
static

Definition at line 458 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_scan ( vlib_main_t vm)

Definition at line 1489 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_scan_l2 ( vlib_main_t vm)
static

Definition at line 1385 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_scan_l3 ( vlib_main_t vm)
static

Definition at line 1437 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* gbp_endpoint_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1308 of file gbp_endpoint.c.

+ Here is the call graph for this function:

static walk_rc_t gbp_endpoint_show_one ( index_t  gei,
void *  ctx 
)
static

Definition at line 1263 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_unlock ( gbp_endpoint_src_t  src,
index_t  gei 
)

Definition at line 920 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Definition at line 824 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_walk ( gbp_endpoint_cb_t  cb,
void *  ctx 
)

Definition at line 1065 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

static void gbp_endpoint_walk_ip_itf ( const clib_bihash_kv_24_8_t kvp,
void *  arg 
)
static

Definition at line 1274 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_endpoint_walk_mac_itf ( const clib_bihash_kv_16_8_t kvp,
void *  arg 
)
static

Definition at line 1291 of file gbp_endpoint.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ip46_type_t ip46_address_get_type ( const ip46_address_t *  a)
static

Definition at line 201 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

Variable Documentation

const char* gbp_endpoint_attr_names[] = GBP_ENDPOINT_ATTR_NAMES
static

Definition at line 37 of file gbp_endpoint.c.

vlib_cli_command_t gbp_endpoint_cli_node
static
Initial value:
= {
.path = "gbp endpoint",
.short_help = "gbp endpoint [del] <interface> epg <ID> ip <IP> mac <MAC>",
.function = gbp_endpoint_cli,
}
static clib_error_t * gbp_endpoint_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (gbp_endpoint_cli_node)

Definition at line 1157 of file gbp_endpoint.c.

fib_node_type_t gbp_endpoint_fib_type

Definition at line 44 of file gbp_endpoint.c.

gbp_endpoint_t* gbp_endpoint_pool

Pool of GBP endpoints.

Definition at line 57 of file gbp_endpoint.c.

vlib_cli_command_t gbp_endpoint_show_node
static
Initial value:
= {
.path = "show gbp endpoint",
.short_help = "show gbp endpoint\n",
.function = gbp_endpoint_show,
}
static clib_error_t * gbp_endpoint_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (gbp_endpoint_show_node)

Definition at line 1355 of file gbp_endpoint.c.

const fib_node_vft_t gbp_endpoint_vft
static
Initial value:
= {
.fnv_last_lock = gbp_endpoint_last_lock_gone,
}
static fib_node_back_walk_rc_t gbp_endpoint_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
static fib_node_t * gbp_endpoint_get_node(fib_node_index_t index)
static void gbp_endpoint_last_lock_gone(fib_node_t *node)

Definition at line 1553 of file gbp_endpoint.c.

gbp_ep_db_t gbp_ep_db

EP DBs.

DP functions and databases.

Definition at line 42 of file gbp_endpoint.c.

vlib_log_class_t gbp_ep_logger

Definition at line 46 of file gbp_endpoint.c.

u32 gbp_n_learnt_endpoints
static

A count of the number of dynamic entries.

Definition at line 62 of file gbp_endpoint.c.