aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/fib/fib_node.c2
-rw-r--r--src/vnet/fib/ip4_fib.c4
-rw-r--r--src/vnet/fib/ip6_fib.c31
-rw-r--r--src/vnet/fib/mpls_fib.c2
-rw-r--r--src/vnet/mfib/ip4_mfib.c2
-rw-r--r--src/vnet/mfib/ip6_mfib.c9
6 files changed, 34 insertions, 16 deletions
diff --git a/src/vnet/fib/fib_node.c b/src/vnet/fib/fib_node.c
index d2e3f04de27..3e99007da64 100644
--- a/src/vnet/fib/fib_node.c
+++ b/src/vnet/fib/fib_node.c
@@ -237,7 +237,7 @@ fib_memory_show (vlib_main_t * vm,
vlib_cli_output (vm, "FIB memory");
vlib_cli_output (vm, " Tables:");
- vlib_cli_output (vm, "%=30s %=6s %=8s", "SAFI", "Number", "Bytes");
+ vlib_cli_output (vm, "%=30s %=6s %=12s", "SAFI", "Number", "Bytes");
vlib_cli_output (vm, "%U", format_fib_table_memory);
vlib_cli_output (vm, "%U", format_mfib_table_memory);
vlib_cli_output (vm, " Nodes:");
diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c
index 57fc23b6b19..8944637c127 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -566,12 +566,12 @@ u8 *
format_ip4_fib_table_memory (u8 * s, va_list * args)
{
#if USE_DLMALLOC == 0
- s = format(s, "%=30s %=6d %=8ld\n",
+ s = format(s, "%=30s %=6d %=12ld\n",
"IPv4 unicast",
pool_elts(ip4_main.fibs),
mheap_bytes(ip4_main.mtrie_mheap));
#else
- s = format(s, "%=30s %=6d %=8ld\n",
+ s = format(s, "%=30s %=6d %=12ld\n",
"IPv4 unicast",
pool_elts(ip4_main.fibs),
mspace_footprint(ip4_main.mtrie_mheap));
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;
diff --git a/src/vnet/fib/mpls_fib.c b/src/vnet/fib/mpls_fib.c
index 6670c99233f..6440689eab5 100644
--- a/src/vnet/fib/mpls_fib.c
+++ b/src/vnet/fib/mpls_fib.c
@@ -366,7 +366,7 @@ format_mpls_fib_table_memory (u8 * s, va_list * args)
n_tables = pool_elts(mpls_main.fibs);
mem = n_tables * sizeof(mpls_fib_t);
- s = format(s, "%=30s %=6ld %=8ld\n", "MPLS", n_tables, mem);
+ s = format(s, "%=30s %=6ld %=12ld\n", "MPLS", n_tables, mem);
return (s);
}
diff --git a/src/vnet/mfib/ip4_mfib.c b/src/vnet/mfib/ip4_mfib.c
index 87603715d83..1d872f974fd 100644
--- a/src/vnet/mfib/ip4_mfib.c
+++ b/src/vnet/mfib/ip4_mfib.c
@@ -366,7 +366,7 @@ format_ip4_mfib_table_memory (u8 * s, va_list * args)
total_memory += mfib_size;
}));
- s = format(s, "%=30s %=6d %=8ld\n",
+ s = format(s, "%=30s %=6d %=12ld\n",
"IPv4 multicast",
pool_elts(ip4_main.mfibs), total_memory);
diff --git a/src/vnet/mfib/ip6_mfib.c b/src/vnet/mfib/ip6_mfib.c
index aa9fdb9a98b..31a92687e1a 100644
--- a/src/vnet/mfib/ip6_mfib.c
+++ b/src/vnet/mfib/ip6_mfib.c
@@ -521,9 +521,14 @@ VLIB_INIT_FUNCTION(ip6_mfib_module_init);
u8 *
format_ip6_mfib_table_memory (u8 * s, va_list * args)
{
- s = format(s, "%=30s %=6d %=8s\n",
+ u64 bytes_inuse;
+
+ bytes_inuse = alloc_arena_next(&(ip6_main.ip6_mtable.ip6_mhash));
+
+ s = format(s, "%=30s %=6d %=12ld\n",
"IPv6 multicast",
- pool_elts(ip6_main.mfibs), "???");
+ pool_elts(ip6_main.mfibs),
+ bytes_inuse);
return (s);
}