diff options
author | Neale Ranns <nranns@cisco.com> | 2019-05-28 11:09:40 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-05-30 11:52:00 +0000 |
commit | 05cac30a9228ddc543b3327cb8a494d79eb5b90d (patch) | |
tree | 506bb9193a551f05a1f2d96d7104bbc778d50514 /src/vnet/fib/ip6_fib.c | |
parent | 6439fea6639b0579ed3b0c8ebbb6929ef157c522 (diff) |
FIB: correctly report IPv6 FIB Unicast and Multicast memory usage (VPP-1578)"
and document scaling
Change-Id: I65d8999e65616d77e525963c770d91e9b0d5e593
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/ip6_fib.c')
-rw-r--r-- | src/vnet/fib/ip6_fib.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/vnet/fib/ip6_fib.c b/src/vnet/fib/ip6_fib.c index 60d13659925..ba90c5ff1d3 100644 --- a/src/vnet/fib/ip6_fib.c +++ b/src/vnet/fib/ip6_fib.c @@ -573,16 +573,10 @@ format_ip6_fib_table_memory (u8 * s, va_list * args) { uword bytes_inuse; - bytes_inuse = - alloc_arena_next - (&(ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash)) - - alloc_arena (&(ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash)); + bytes_inuse = (alloc_arena_next(&(ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash)) + + alloc_arena_next(&(ip6_main.ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash))); - bytes_inuse += - alloc_arena_next(&(ip6_main.ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash)) - - alloc_arena(&(ip6_main.ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash)); - - s = format(s, "%=30s %=6d %=8ld\n", + s = format(s, "%=30s %=6d %=12ld\n", "IPv6 unicast", pool_elts(ip6_main.fibs), bytes_inuse); @@ -623,6 +617,7 @@ ip6_show_fib (vlib_main_t * vm, u32 mask_len = 128; int table_id = -1, fib_index = ~0; int detail = 0; + int hash = 0; verbose = 1; matching = 0; @@ -638,6 +633,11 @@ ip6_show_fib (vlib_main_t * vm, unformat (input, "det")) detail = 1; + else if (unformat (input, "hash") || + unformat (input, "mem") || + unformat (input, "memory")) + hash = 1; + else if (unformat (input, "%U/%d", unformat_ip6_address, &matching_address, &mask_len)) matching = 1; @@ -653,6 +653,19 @@ ip6_show_fib (vlib_main_t * vm, break; } + if (hash) + { + vlib_cli_output (vm, "IPv6 Non-Forwarding Hash Table:\n%U\n", + BV (format_bihash), + &im6->ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash, + detail); + vlib_cli_output (vm, "IPv6 Forwarding Hash Table:\n%U\n", + BV (format_bihash), + &im6->ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash, + detail); + return (NULL); + } + pool_foreach (fib_table, im6->fibs, ({ fib_source_t source; |