aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-03-21 19:40:49 -0700
committerEthan Jackson <ethan@nicira.com>2013-04-01 12:22:58 -0700
commit37419873b42963ff9da99b7f47cbde39f20f6184 (patch)
treeaaf29e438cf0f6568dc587737d2e001103b511c2 /ofproto
parentdffa93198738a0cae64cd2343d53445e3161d92d (diff)
ofproto-dpif: Rate limit calls to facet_learn().
In the TCP_CRR benchmark, ovs-vswitchd spends so much time in update_stats() that it has a significant impact on flow setup performance. Further work is needed in this area, but for now, simply rate limiting facet_learn() has a roughly 10% improvement with complex flow tables. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 6fe55481..62c7f316 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -486,6 +486,8 @@ struct facet {
* overhead. (A facet always has at least one subfacet and in the common
* case has exactly one subfacet.) */
struct subfacet one_subfacet;
+
+ long long int learn_rl; /* Rate limiter for facet_learn(). */
};
static struct facet *facet_create(struct rule_dpif *,
@@ -4363,6 +4365,8 @@ facet_create(struct rule_dpif *rule, const struct flow *flow, uint32_t hash)
netflow_flow_init(&facet->nf_flow);
netflow_flow_update_time(ofproto->netflow, &facet->nf_flow, facet->used);
+ facet->learn_rl = time_msec() + 500;
+
return facet;
}
@@ -4439,6 +4443,12 @@ facet_learn(struct facet *facet)
struct subfacet, list_node);
struct action_xlate_ctx ctx;
+ if (time_msec() < facet->learn_rl) {
+ return;
+ }
+
+ facet->learn_rl = time_msec() + 500;
+
if (!facet->has_learn
&& !facet->has_normal
&& (!facet->has_fin_timeout