summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEverton Marques <everton.marques@gmail.com>2009-08-17 18:18:59 -0300
committerEverton Marques <everton.marques@gmail.com>2009-10-02 10:44:32 -0300
commit3056a82ce680fae73a7a8a3e617641a7be07329c (patch)
tree0a021de778dc2d651137f1aa47d9425b8ff964ed
parentd731f60597048350bb72f79390e26ca6635258da (diff)
downloadquagga-3056a82ce680fae73a7a8a3e617641a7be07329c.tar.bz2
quagga-3056a82ce680fae73a7a8a3e617641a7be07329c.tar.xz
[pim] More RPF cache refresh statistics
-rw-r--r--pimd/pim_cmd.c25
-rw-r--r--pimd/pim_zebra.c1
-rw-r--r--pimd/pimd.c1
-rw-r--r--pimd/pimd.h1
4 files changed, 18 insertions, 10 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index df6897e3..ea396bcf 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1022,25 +1022,32 @@ static void pim_show_upstream_rpf(struct vty *vty)
}
}
-static void show_rpf_refresh_stats(struct vty *vty)
+static void show_rpf_refresh_stats(struct vty *vty, time_t now)
{
+ char refresh_uptime[10];
+
+ pim_time_uptime(refresh_uptime, sizeof(refresh_uptime), now - qpim_rpf_cache_refresh_last);
+
vty_out(vty,
"RPF Cache Refresh Delay: %ld msecs%s"
"RPF Cache Refresh Timer: %ld msecs%s"
"RPF Cache Refresh Requests: %lld%s"
- "RPF Cache Refresh Events: %lld%s",
+ "RPF Cache Refresh Events: %lld%s"
+ "RPF Cache Refresh Last: %s%s",
qpim_rpf_cache_refresh_delay_msec, VTY_NEWLINE,
pim_time_timer_remain_msec(qpim_rpf_cache_refresher), VTY_NEWLINE,
qpim_rpf_cache_refresh_requests, VTY_NEWLINE,
- qpim_rpf_cache_refresh_events, VTY_NEWLINE);
+ qpim_rpf_cache_refresh_events, VTY_NEWLINE,
+ refresh_uptime, VTY_NEWLINE);
}
static void pim_show_rpf(struct vty *vty)
{
struct listnode *up_node;
struct pim_upstream *up;
+ time_t now = pim_time_monotonic_sec();
- show_rpf_refresh_stats(vty);
+ show_rpf_refresh_stats(vty, now);
vty_out(vty, "%s", VTY_NEWLINE);
@@ -1079,9 +1086,7 @@ static void igmp_show_querier(struct vty *vty)
{
struct listnode *node;
struct interface *ifp;
- time_t now;
-
- now = pim_time_monotonic_sec();
+ time_t now = pim_time_monotonic_sec();
vty_out(vty, "Interface Address Querier StartCount Query-Timer Other-Timer%s", VTY_NEWLINE);
@@ -1914,15 +1919,15 @@ DEFUN (show_ip_multicast,
IP_STR
"Multicast global information\n")
{
+ time_t now = pim_time_monotonic_sec();
+
if (PIM_MROUTE_IS_ENABLED) {
- time_t now;
char uptime[10];
vty_out(vty, "Mroute socket descriptor: %d%s",
qpim_mroute_socket_fd,
VTY_NEWLINE);
- now = pim_time_monotonic_sec();
pim_time_uptime(uptime, sizeof(uptime), now - qpim_mroute_socket_creation);
vty_out(vty, "Mroute socket uptime: %s%s",
uptime,
@@ -1951,7 +1956,7 @@ DEFUN (show_ip_multicast,
vty_out(vty, "%s", VTY_NEWLINE);
- show_rpf_refresh_stats(vty);
+ show_rpf_refresh_stats(vty, now);
show_multicast_interfaces(vty);
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 9764532b..3530434d 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -447,6 +447,7 @@ static int on_rpf_cache_refresh(struct thread *t)
/* update kernel multicast forwarding cache (MFC) */
scan_oil();
+ qpim_rpf_cache_refresh_last = pim_time_monotonic_sec();
++qpim_rpf_cache_refresh_events;
return 0;
diff --git a/pimd/pimd.c b/pimd/pimd.c
index e8afe779..f1a084f1 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -56,6 +56,7 @@ long qpim_rpf_cache_refresh_delay_msec = 10000;
struct thread *qpim_rpf_cache_refresher = 0;
int64_t qpim_rpf_cache_refresh_requests = 0;
int64_t qpim_rpf_cache_refresh_events = 0;
+int64_t qpim_rpf_cache_refresh_last = 0;
struct in_addr qpim_inaddr_any;
static void pim_free()
diff --git a/pimd/pimd.h b/pimd/pimd.h
index aaf5faae..6ee91e7f 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -82,6 +82,7 @@ long qpim_rpf_cache_refresh_delay_msec;
struct thread *qpim_rpf_cache_refresher;
int64_t qpim_rpf_cache_refresh_requests;
int64_t qpim_rpf_cache_refresh_events;
+int64_t qpim_rpf_cache_refresh_last;
struct in_addr qpim_inaddr_any;
#define PIM_JP_HOLDTIME (qpim_t_periodic * 7 / 2)