[ovs-dev] [subfacet 3/4] ofproto-dpif: Set flow-eviction-threshold globally.
Ethan Jackson
ethan at nicira.com
Fri Jun 7 20:32:12 UTC 2013
> Whoa. Declaring a static variable in a header file? Far out. But it
> isn't going to work.
Doh you're right. I'll just make it an extern. See the incremental below.
Looks alright otherwise?
---
ofproto/ofproto-provider.h | 3 +--
ofproto/ofproto.c | 2 ++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index 7ca1728..23d9180 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -232,8 +232,7 @@ struct rule {
/* Threshold at which to begin flow table eviction. Only affects the
* ofproto-dpif implementation */
-static unsigned flow_eviction_threshold OVS_UNUSED =
- OFPROTO_FLOW_EVICTION_THRESHOLD_DEFAULT;
+extern unsigned flow_eviction_threshold;
static inline struct rule *
rule_from_cls_rule(const struct cls_rule *cls_rule)
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 097aa49..c768d7e 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -220,6 +220,8 @@ static const struct ofproto_class **ofproto_classes;
static size_t n_ofproto_classes;
static size_t allocated_ofproto_classes;
+unsigned flow_eviction_threshold = OFPROTO_FLOW_EVICTION_THRESHOLD_DEFAULT;
+
/* Map from datapath name to struct ofproto, for use by unixctl commands. */
static struct hmap all_ofprotos = HMAP_INITIALIZER(&all_ofprotos);
--
1.7.9.5
More information about the dev
mailing list