aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorJoe Stringer <joe@wand.net.nz>2013-06-26 17:25:55 +0900
committerBen Pfaff <blp@nicira.com>2013-06-26 08:28:19 -0700
commit7155fa52f0e585eb515ceebf3790d90554bbe18e (patch)
treed875a1080a7a49af21b3f96e99243bd3064fa12e /vswitchd
parent7431e17196fdb1c3189d67e3aeed4adeab4cf479 (diff)
ofproto-dpif: Add 'force-miss-model' configuration
This adds support for specifying flow miss handling behaviour at runtime, through a new "other-config" option in the Open_vSwitch table. This takes precedence over flow-eviction-threshold. By default, the behaviour is the same as before. If force-miss-model is set to 'with-facets', then flow miss handling will always result in the creation of new facets and flow-eviction-threshold will be ignored. If force-miss-model is set to 'without-facets', then flow miss handling will never result in the creation of new facets (effectively the same as setting the flow-eviction-threshold to 0, which is not currently configurable). We intend to use this configuration option in the testsuite to force particular code paths to be used, allowing us to improve test coverage. Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c23
-rw-r--r--vswitchd/vswitch.xml22
2 files changed, 45 insertions, 0 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index abae7f58..4ac2b26f 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -196,6 +196,7 @@ static size_t bridge_get_controllers(const struct bridge *br,
static void bridge_add_del_ports(struct bridge *,
const unsigned long int *splinter_vlans);
static void bridge_refresh_ofp_port(struct bridge *);
+static void bridge_configure_flow_miss_model(const char *opt);
static void bridge_configure_datapath_id(struct bridge *);
static void bridge_configure_netflow(struct bridge *);
static void bridge_configure_forward_bpdu(struct bridge *);
@@ -499,6 +500,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
smap_get_int(&ovs_cfg->other_config, "flow-eviction-threshold",
OFPROTO_FLOW_EVICTION_THRESHOLD_DEFAULT));
+ bridge_configure_flow_miss_model(smap_get(&ovs_cfg->other_config,
+ "force-miss-model"));
+
/* Destroy "struct bridge"s, "struct port"s, and "struct iface"s according
* to 'ovs_cfg' while update the "if_cfg_queue", with only very minimal
* configuration otherwise.
@@ -804,6 +808,25 @@ port_configure(struct port *port)
free(s.lacp_slaves);
}
+static void
+bridge_configure_flow_miss_model(const char *opt)
+{
+ enum ofproto_flow_miss_model model = OFPROTO_HANDLE_MISS_AUTO;
+
+ if (opt) {
+ if (strcmp(opt, "with-facets")) {
+ model = OFPROTO_HANDLE_MISS_WITH_FACETS;
+ VLOG_INFO("Handling all flow misses by creating facets.\n");
+ }
+ if (strcmp(opt, "without-facets")) {
+ model = OFPROTO_HANDLE_MISS_WITHOUT_FACETS;
+ VLOG_INFO("Handling all flow misses without creating facets.\n");
+ }
+ }
+
+ ofproto_set_flow_miss_model(model);
+}
+
/* Pick local port hardware address and datapath ID for 'br'. */
static void
bridge_configure_datapath_id(struct bridge *br)
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index b9628494..12780d6c 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -136,6 +136,28 @@
The default is 2500. Values below 100 will be rounded up to 100.
</p>
</column>
+
+ <column name="other_config" key="force-miss-model">
+ <p>
+ Specifies userspace behaviour for handling flow misses. This takes
+ precedence over flow-eviction-threshold.
+ </p>
+ <p>
+ <dl>
+ <dt><code>auto</code></dt>
+ <dd>Handle automatically based on the flow-eviction-threshold and
+ the flow setup governer (default, recommended).</dd>
+ <dt><code>with-facets</code></dt>
+ <dd>Always create facets. Expensive kernel flow creation and
+ statistics tracking is always performed, even on flows with only
+ a small number of packets.</dd>
+ <dt><code>without-facets</code></dt>
+ <dd>Always handle without facets. Forces flow misses to be handled
+ in userspace. May cause an increase in CPU usage and packet loss
+ on high throughput.</dd>
+ </dl>
+ </p>
+ </column>
</group>
<group title="Status">