summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/main.texi5
-rw-r--r--doc/ospf6d.texi4
-rw-r--r--ospf6d/ospf6_zebra.c11
-rw-r--r--zebra/interface.c2
-rw-r--r--zebra/zebra_mpls.c16
-rw-r--r--zebra/zebra_rib.c4
-rw-r--r--zebra/zebra_vrf.h7
-rw-r--r--zebra/zserv.c23
8 files changed, 63 insertions, 9 deletions
diff --git a/doc/main.texi b/doc/main.texi
index 706baa25f7..265d6295ef 100644
--- a/doc/main.texi
+++ b/doc/main.texi
@@ -498,6 +498,11 @@ If so, the box can't work as a router.
Display whether the host's IP v6 forwarding is enabled or not.
@end deffn
+@deffn Command {show zebra} {}
+Display various statistics related to the installation and deletion
+of routes, neighbor updates, and LSP's into the kernel.
+@end deffn
+
@deffn Command {show zebra fpm stats} {}
Display statistics related to the zebra code that interacts with the
optional Forwarding Plane Manager (FPM) component.
diff --git a/doc/ospf6d.texi b/doc/ospf6d.texi
index 31f4db0ccc..3ea71fbd20 100644
--- a/doc/ospf6d.texi
+++ b/doc/ospf6d.texi
@@ -151,6 +151,10 @@ Shows requestlist of neighbor.
This command shows internal routing table.
@end deffn
+@deffn {Command} {show ipv6 ospf6 zebra} {}
+Shows state about what is being redistributed between zebra and OSPF6
+@end deffn
+
@node OSPF6 Configuration Examples
@section OSPF6 Configuration Examples
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index fdf2f299cb..305870a64f 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -304,13 +304,12 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient,
return 0;
}
-
-
-
DEFUN (show_zebra,
- show_zebra_cmd,
- "show zebra",
+ show_ospf6_zebra_cmd,
+ "show ipv6 ospf6 zebra",
SHOW_STR
+ IPV6_STR
+ OSPF6_STR
"Zebra information\n")
{
int i;
@@ -836,7 +835,7 @@ ospf6_zebra_init (struct thread_master *master)
install_node (&zebra_node, config_write_ospf6_zebra);
/* Install command element for zebra node. */
- install_element (VIEW_NODE, &show_zebra_cmd);
+ install_element (VIEW_NODE, &show_ospf6_zebra_cmd);
install_default (ZEBRA_NODE);
install_element (ZEBRA_NODE, &redistribute_ospf6_cmd);
install_element (ZEBRA_NODE, &no_redistribute_ospf6_cmd);
diff --git a/zebra/interface.c b/zebra/interface.c
index 7b0d31338d..c60cb8dcbc 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -774,6 +774,7 @@ if_nbr_ipv6ll_to_ipv4ll_neigh_update (struct interface *ifp,
struct in6_addr *address,
int add)
{
+ struct zebra_vrf *zvrf = vrf_info_lookup(ifp->vrf_id);
char buf[16] = "169.254.0.1";
struct in_addr ipv4_ll;
char mac[6];
@@ -782,6 +783,7 @@ if_nbr_ipv6ll_to_ipv4ll_neigh_update (struct interface *ifp,
ipv6_ll_address_to_mac(address, (u_char *)mac);
kernel_neigh_update (add, ifp->ifindex, ipv4_ll.s_addr, mac, 6);
+ zvrf->neigh_updates++;
}
static void
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index d7589fda73..b547c62566 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -927,6 +927,7 @@ lsp_process (struct work_queue *wq, void *data)
zebra_lsp_t *lsp;
zebra_nhlfe_t *oldbest, *newbest;
char buf[BUFSIZ], buf2[BUFSIZ];
+ struct zebra_vrf *zvrf = vrf_info_lookup (VRF_DEFAULT);
lsp = (zebra_lsp_t *)data;
if (!lsp) // unexpected
@@ -955,15 +956,24 @@ lsp_process (struct work_queue *wq, void *data)
{
/* Not already installed */
if (newbest)
- kernel_add_lsp (lsp);
+ {
+ kernel_add_lsp (lsp);
+ zvrf->lsp_installs++;
+ }
}
else
{
/* Installed, may need an update and/or delete. */
if (!newbest)
- kernel_del_lsp (lsp);
+ {
+ kernel_del_lsp (lsp);
+ zvrf->lsp_removals++;
+ }
else if (CHECK_FLAG (lsp->flags, LSP_FLAG_CHANGED))
- kernel_upd_lsp (lsp);
+ {
+ kernel_upd_lsp (lsp);
+ zvrf->lsp_installs++;
+ }
}
return WQ_SUCCESS;
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 12ee9961d5..5f457a6fc5 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1114,6 +1114,7 @@ rib_install_kernel (struct route_node *rn, struct rib *rib, struct rib *old)
rib_table_info_t *info = srcdest_rnode_table_info(rn);
int recursing;
struct prefix *p, *src_p;
+ struct zebra_vrf *zvrf = vrf_info_lookup (rib->vrf_id);
srcdest_rnode_prefixes (rn, &p, &src_p);
@@ -1130,6 +1131,7 @@ rib_install_kernel (struct route_node *rn, struct rib *rib, struct rib *old)
*/
hook_call(rib_update, rn, "installing in kernel");
ret = kernel_route_rib (p, src_p, old, rib);
+ zvrf->installs++;
/* If install succeeds, update FIB flag for nexthops. */
if (!ret)
@@ -1158,6 +1160,7 @@ rib_uninstall_kernel (struct route_node *rn, struct rib *rib)
rib_table_info_t *info = srcdest_rnode_table_info(rn);
int recursing;
struct prefix *p, *src_p;
+ struct zebra_vrf *zvrf = vrf_info_lookup (rib->vrf_id);
srcdest_rnode_prefixes (rn, &p, &src_p);
@@ -1174,6 +1177,7 @@ rib_uninstall_kernel (struct route_node *rn, struct rib *rib)
*/
hook_call(rib_update, rn, "uninstalling from kernel");
ret = kernel_route_rib (p, src_p, rib, NULL);
+ zvrf->removals++;
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h
index df25fad947..790e2e53d2 100644
--- a/zebra/zebra_vrf.h
+++ b/zebra/zebra_vrf.h
@@ -94,6 +94,13 @@ struct zebra_vrf
/* MPLS processing flags */
u_int16_t mpls_flags;
#define MPLS_FLAG_SCHEDULE_LSPS (1 << 0)
+
+ /* Route Installs */
+ uint64_t installs;
+ uint64_t removals;
+ uint64_t neigh_updates;
+ uint64_t lsp_installs;
+ uint64_t lsp_removals;
};
static inline vrf_id_t
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 76c0756ada..0a33b166cd 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -2817,6 +2817,28 @@ DEFUN (no_ip_forwarding,
return CMD_SUCCESS;
}
+DEFUN (show_zebra,
+ show_zebra_cmd,
+ "show zebra",
+ SHOW_STR
+ "Zebra information\n")
+{
+ struct vrf *vrf;
+
+ vty_out (vty, " Route Route Neighbor LSP LSP%s", VTY_NEWLINE);
+ vty_out (vty, "VRF Installs Removals Updates Installs Removals%s", VTY_NEWLINE);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ {
+ struct zebra_vrf *zvrf = vrf->info;
+ vty_out (vty,"%-25s %10ld %10ld %10ld %10ld %10ld%s",
+ vrf->name, zvrf->installs, zvrf->removals,
+ zvrf->neigh_updates, zvrf->lsp_installs, zvrf->lsp_removals,
+ VTY_NEWLINE);
+ }
+
+ return CMD_SUCCESS;
+}
+
/* This command is for debugging purpose. */
DEFUN (show_zebra_client,
show_zebra_client_cmd,
@@ -3005,6 +3027,7 @@ zebra_init (void)
install_element (VIEW_NODE, &show_ip_forwarding_cmd);
install_element (CONFIG_NODE, &ip_forwarding_cmd);
install_element (CONFIG_NODE, &no_ip_forwarding_cmd);
+ install_element (ENABLE_NODE, &show_zebra_cmd);
install_element (ENABLE_NODE, &show_zebra_client_cmd);
install_element (ENABLE_NODE, &show_zebra_client_summary_cmd);