aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-03-23 15:11:21 -0700
committerEthan Jackson <ethan@nicira.com>2013-03-24 13:37:47 -0700
commit7cd875dbc82730c5c308ec05822a8b8d444c8a2f (patch)
tree70daf7e55b4953e394f55d68e75a7c85680595c9 /ofproto
parent8a02b5ee895add9b5ec4407ad5e525654a41a3dc (diff)
ofproto-dpif: Push statistics in rule_get_stats().
As time goes on, and flow tables become more complicated, the tradeoff between keeping up to date statistics, and the CPU resources needed to maintain them, will become more important. Commit 5c0243a (ofproto-dpif: xlate actions once with subfacets.) delayed the reporting of some statistics in an effort to achieve higher flow setup performance. Future commits will continue in the same direction. This patch helps to alleviate the issue, by pushing statistics rule_get_stats(), when users actually want them. Presumably, this happens rarely, and thus will not have a negative impact on ovs-vswitchd performance. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 2d92dc33..dc416bc9 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5407,9 +5407,14 @@ rule_destruct(struct rule *rule_)
static void
rule_get_stats(struct rule *rule_, uint64_t *packets, uint64_t *bytes)
{
+ struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule_->ofproto);
struct rule_dpif *rule = rule_dpif_cast(rule_);
struct facet *facet;
+ HMAP_FOR_EACH (facet, hmap_node, &ofproto->facets) {
+ facet_push_stats(facet);
+ }
+
/* Start from historical data for 'rule' itself that are no longer tracked
* in facets. This counts, for example, facets that have expired. */
*packets = rule->packet_count;