summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_neighbor.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-02-26 17:04:40 -0500
committerDave Barach <dave@barachs.net>2019-02-26 17:12:29 -0500
commit1bb981d89880a1d54dccd94ca6216b927740af4a (patch)
tree07a0f402b575d78799f69db3e1747d1bed0d15e9 /src/vnet/ip/ip6_neighbor.c
parent4ba19b8a75c40cecd3818af2fd657fe5bf1b2f41 (diff)
VPP-1574: minimize RPC barrier sync calls
Grab the thread barrier across a set of RPCs, to greatly increase efficiency. Avoids running afoul of the barrier sync holddown timer. Change-Id: I782dfdb1bed398b290169c83266681c9edd57a3f Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/ip/ip6_neighbor.c')
-rwxr-xr-xsrc/vnet/ip/ip6_neighbor.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index ded5b868702..649f4b7a4ba 100755
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -1021,6 +1021,10 @@ show_ip6_neighbors (vlib_main_t * vm,
ip6_neighbor_t *n, *ns;
clib_error_t *error = 0;
u32 sw_if_index;
+ int verbose = 0;
+
+ if (unformat (input, "verbose"))
+ verbose = 1;
/* Filter entries by interface if given. */
sw_if_index = ~0;
@@ -1029,13 +1033,29 @@ show_ip6_neighbors (vlib_main_t * vm,
ns = ip6_neighbors_entries (sw_if_index);
if (ns)
{
- vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, 0);
- vec_foreach (n, ns)
- {
- vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, n);
- }
+ /*
+ * Show the entire table if it's not too big, otherwise just
+ * show the size of the table.
+ */
+ if (vec_len (ns) < 50)
+ verbose = 1;
+ if (verbose)
+ {
+ vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, 0);
+ vec_foreach (n, ns)
+ {
+ vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, n);
+ }
+ }
+ else
+ vlib_cli_output
+ (vm, "There are %u ip6 neighbors, "
+ "'show ip6 neighbors verbose' to display the entire table...",
+ vec_len (ns));
vec_free (ns);
}
+ else
+ vlib_cli_output (vm, "No ip6 neighbors");
return error;
}