aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-11-27 01:03:25 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-27 19:00:42 +0000
commit3919425550dfea28a915858588a7e9fe4094ec0a (patch)
tree8fdac87066a285cb211ae5447a72d51ab726e934 /src
parent1a5e301fcdcd109d14112aafc5f5ee48d1462458 (diff)
Fix - sh ip fib mtrie sum
Change-Id: I62a6ee78ee9ad73fd58a46fbdca54fd964fec113 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/fib/ip4_fib.c10
-rw-r--r--src/vnet/ip/ip4_mtrie.c21
2 files changed, 18 insertions, 13 deletions
diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c
index 48dc2c6cd3b..36cf6e73629 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -555,6 +555,11 @@ ip4_show_fib (vlib_main_t * vm,
vec_free(s);
/* Show summary? */
+ if (mtrie)
+ {
+ vlib_cli_output (vm, "%U", format_ip4_fib_mtrie, &fib->mtrie, verbose);
+ continue;
+ }
if (! verbose)
{
vlib_cli_output (vm, "%=20s%=16s", "Prefix length", "Count");
@@ -567,11 +572,6 @@ ip4_show_fib (vlib_main_t * vm,
}
continue;
}
- if (mtrie)
- {
- vlib_cli_output (vm, "%U", format_ip4_fib_mtrie, &fib->mtrie);
- continue;
- }
if (!matching)
{
diff --git a/src/vnet/ip/ip4_mtrie.c b/src/vnet/ip/ip4_mtrie.c
index 4dbf8c966a8..f114da01b77 100644
--- a/src/vnet/ip/ip4_mtrie.c
+++ b/src/vnet/ip/ip4_mtrie.c
@@ -764,6 +764,7 @@ u8 *
format_ip4_fib_mtrie (u8 * s, va_list * va)
{
ip4_fib_mtrie_t *m = va_arg (*va, ip4_fib_mtrie_t *);
+ int verbose = va_arg (*va, int);
ip4_fib_mtrie_16_ply_t *p;
u32 base_address = 0;
int i;
@@ -771,18 +772,22 @@ format_ip4_fib_mtrie (u8 * s, va_list * va)
s = format (s, "%d plies, memory usage %U\n",
pool_elts (ip4_ply_pool),
format_memory_size, mtrie_memory_usage (m));
- s = format (s, "root-ply");
- p = &m->root_ply;
- for (i = 0; i < ARRAY_LEN (p->leaves); i++)
+ if (verbose)
{
- u16 slot;
+ s = format (s, "root-ply");
+ p = &m->root_ply;
- slot = clib_host_to_net_u16 (i);
-
- if (p->dst_address_bits_of_leaves[slot] > 0)
+ for (i = 0; i < ARRAY_LEN (p->leaves); i++)
{
- FORMAT_PLY (s, p, slot, base_address, 16, 2);
+ u16 slot;
+
+ slot = clib_host_to_net_u16 (i);
+
+ if (p->dst_address_bits_of_leaves[slot] > 0)
+ {
+ FORMAT_PLY (s, p, slot, base_address, 16, 2);
+ }
}
}