summaryrefslogtreecommitdiff
path: root/ofproto/pinsched.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-07-17 10:31:03 -0700
committerBen Pfaff <blp@nicira.com>2014-07-17 10:31:03 -0700
commita413195ecede139380166065bf42699b3c002acd (patch)
treec96401bce2d19635788d5710128cb1493f23e954 /ofproto/pinsched.c
parentff92993540bf668411249408c694047955900758 (diff)
downloadopenvswitch-a413195ecede139380166065bf42699b3c002acd.tar.gz
ofproto: Report controller rate limiting statistics in database.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Diffstat (limited to 'ofproto/pinsched.c')
-rw-r--r--ofproto/pinsched.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c
index 5a59a50d6..351623da8 100644
--- a/ofproto/pinsched.c
+++ b/ofproto/pinsched.c
@@ -295,10 +295,17 @@ pinsched_set_limits(struct pinsched *ps, int rate_limit, int burst_limit)
}
}
-/* Returns the number of packets scheduled to be sent eventually by 'ps'.
- * Returns 0 if 'ps' is null. */
-unsigned int
-pinsched_count_txqlen(const struct pinsched *ps)
+/* Retrieves statistics for 'ps'. The statistics will be all zero if 'ps' is
+ * null. */
+void
+pinsched_get_stats(const struct pinsched *ps, struct pinsched_stats *stats)
{
- return ps ? ps->n_queued : 0;
+ if (ps) {
+ stats->n_queued = ps->n_queued;
+ stats->n_normal = ps->n_normal;
+ stats->n_limited = ps->n_limited;
+ stats->n_queue_dropped = ps->n_queue_dropped;
+ } else {
+ memset(stats, 0, sizeof *stats);
+ }
}