aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/fib/fib_test.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2016-10-07 15:14:33 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-10 18:58:22 +0000
commit33a7dd5ad9a3d3ecd9bd8472ca20ee5f82ae9542 (patch)
tree039a067b44b25df78a3aa2d14d4dc558c79dc9d7 /vnet/vnet/fib/fib_test.c
parentbfe737a1b29afea2e10248b8c9fa800148fbd573 (diff)
FIB2.0: memory leaks during load-balance update (VPP-475)
some other fixes and enhancemets to address failures in the IPv6 Scale testing: - The rate at which VPP sends ARP/ND requests, 1 per-millisecond, is too high. This is reduced to 1 every 10 ms. probably still too high. - If an ARP/ND response is received that does not contain a change to the known MAC address, no further processing is done. - Added stats to get info about the async FIB walks. - When walking FIB entries and performing a load-balance update, it is not necessary to re-insert the LB in the forwarding table. Change-Id: Ifd47e4bdbce94495f44aaf1b78e7d1395ed870d1 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'vnet/vnet/fib/fib_test.c')
-rw-r--r--vnet/vnet/fib/fib_test.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/vnet/vnet/fib/fib_test.c b/vnet/vnet/fib/fib_test.c
index 3dc9c1d7267..c9a937ba559 100644
--- a/vnet/vnet/fib/fib_test.c
+++ b/vnet/vnet/fib/fib_test.c
@@ -4802,11 +4802,16 @@ fib_test_validate_entry (fib_node_index_t fei,
{
const load_balance_t *lb;
dpo_id_t dpo = DPO_NULL;
+ fib_prefix_t pfx;
+ index_t fw_lbi;
+ u32 fib_index;
va_list ap;
int res;
va_start(ap, n_buckets);
+ fib_entry_get_prefix(fei, &pfx);
+ fib_index = fib_entry_get_fib_index(fei);
fib_entry_contribute_forwarding(fei, fct, &dpo);
FIB_TEST_LB((DPO_LOAD_BALANCE == dpo.dpoi_type),
@@ -4816,6 +4821,37 @@ fib_test_validate_entry (fib_node_index_t fei,
res = fib_test_validate_lb_v(lb, n_buckets, ap);
+ /*
+ * ensure that the LB contributed by the entry is the
+ * same as the LB in the forwarding tables
+ */
+ switch (pfx.fp_proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ fw_lbi = ip4_fib_forwarding_lookup(fib_index, &pfx.fp_addr.ip4);
+ break;
+ case FIB_PROTOCOL_IP6:
+ fw_lbi = ip6_fib_table_fwding_lookup(&ip6_main, fib_index, &pfx.fp_addr.ip6);
+ break;
+ case FIB_PROTOCOL_MPLS:
+ {
+ mpls_unicast_header_t hdr;
+
+ vnet_mpls_uc_set_label(&hdr.label_exp_s_ttl, pfx.fp_label);
+ vnet_mpls_uc_set_s(&hdr.label_exp_s_ttl, pfx.fp_eos);
+ hdr.label_exp_s_ttl = clib_host_to_net_u32(hdr.label_exp_s_ttl);
+
+ fw_lbi = mpls_fib_table_forwarding_lookup(fib_index, &hdr);
+ break;
+ }
+ default:
+ fw_lbi = 0;
+ }
+ FIB_TEST_LB((fw_lbi == dpo.dpoi_index),
+ "Contributed LB = FW LB: %U\n %U",
+ format_load_balance, fw_lbi, 0,
+ format_load_balance, dpo.dpoi_index, 0);
+
dpo_reset(&dpo);
va_end(ap);