aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-03-21 13:31:14 -0700
committerEthan Jackson <ethan@nicira.com>2013-04-01 12:22:57 -0700
commitdffa93198738a0cae64cd2343d53445e3161d92d (patch)
treecb192bf542c10a644f15250d6aec407ca6e5b236 /ofproto
parent780b1c693744517304a750845b24e4d17efb4736 (diff)
ofproto-dpif: Rate limit facet_check_consistency()
With complex flow tables, facet_check_consistency() can be expensive enough to show up in flow setup performance benchmarks. In my testing this patch gives us a roughly 10% improvement in TCP_CRR and ovs-benchmark. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index dc416bc9..6fe55481 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -684,6 +684,7 @@ struct ofproto_dpif {
struct hmap facets;
struct hmap subfacets;
struct governor *governor;
+ long long int consistency_rl;
/* Revalidation. */
struct table_dpif tables[N_TABLES];
@@ -1237,6 +1238,7 @@ construct(struct ofproto *ofproto_)
hmap_init(&ofproto->facets);
hmap_init(&ofproto->subfacets);
ofproto->governor = NULL;
+ ofproto->consistency_rl = LLONG_MIN;
for (i = 0; i < N_TABLES; i++) {
struct table_dpif *table = &ofproto->tables[i];
@@ -1458,10 +1460,13 @@ run(struct ofproto *ofproto_)
mac_learning_run(ofproto->ml, &ofproto->backer->revalidate_set);
/* Check the consistency of a random facet, to aid debugging. */
- if (!hmap_is_empty(&ofproto->facets)
+ if (time_msec() >= ofproto->consistency_rl
+ && !hmap_is_empty(&ofproto->facets)
&& !ofproto->backer->need_revalidate) {
struct facet *facet;
+ ofproto->consistency_rl = time_msec() + 250;
+
facet = CONTAINER_OF(hmap_random_node(&ofproto->facets),
struct facet, hmap_node);
if (!tag_set_intersects(&ofproto->backer->revalidate_set,