summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2011-07-28 16:38:50 -0700
committerBen Pfaff <blp@nicira.com>2011-07-28 16:39:29 -0700
commit084f529087b7d3a3b3e0df470ad4ad39800cbab5 (patch)
tree79170401dae9f4aadcd442c8c11b85c8ec969c3e /vswitchd
parentb85d8d61a6c3b9c2fa578fa62c795a93544764af (diff)
downloadopenvswitch-084f529087b7d3a3b3e0df470ad4ad39800cbab5.tar.gz
ofproto-dpif: Allow setting of flow eviction threshold
Allow setting the number of flows present in the flow hash at which point eviction of entries from the kernel flow hash will begin to occur. The value may be set using a bridge's other-config column. e.g. ovs-vsctl set bridge br3 other-config:flow-eviction-threshold=10000 default is 1000, reflecting constant value previously used. Increasing this value can result in reduced CPU usage and packet loss in situations where the number of active flows is significantly larger than 1000.
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c18
-rw-r--r--vswitchd/vswitch.xml15
2 files changed, 33 insertions, 0 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 35ee3e737..6a4ebe58d 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -148,6 +148,7 @@ static void bridge_add_ofproto_ports(struct bridge *);
static void bridge_del_ofproto_ports(struct bridge *);
static void bridge_refresh_ofp_port(struct bridge *);
static void bridge_configure_datapath_id(struct bridge *);
+static void bridge_configure_flow_eviction_threshold(struct bridge *);
static void bridge_configure_netflow(struct bridge *);
static void bridge_configure_sflow(struct bridge *, int *sflow_bridge_number);
static void bridge_configure_remotes(struct bridge *,
@@ -412,6 +413,7 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
}
bridge_configure_mirrors(br);
bridge_configure_datapath_id(br);
+ bridge_configure_flow_eviction_threshold(br);
bridge_configure_remotes(br, managers, n_managers);
bridge_configure_netflow(br);
bridge_configure_sflow(br, &sflow_bridge_number);
@@ -962,6 +964,22 @@ bridge_get_other_config(const struct ovsrec_bridge *br_cfg, const char *key)
&ovsrec_bridge_col_other_config, key);
}
+/* Set Flow eviction threshold */
+static void
+bridge_configure_flow_eviction_threshold(struct bridge *br)
+{
+ const char *threshold_str;
+ unsigned threshold;
+
+ threshold_str = bridge_get_other_config(br->cfg, "flow-eviction-threshold");
+ if (threshold_str) {
+ threshold = strtoul(threshold_str, NULL, 10);
+ } else {
+ threshold = OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT;
+ }
+ ofproto_set_flow_eviction_threshold(br->ofproto, threshold);
+}
+
static void
bridge_pick_local_hw_addr(struct bridge *br, uint8_t ea[ETH_ADDR_LEN],
struct iface **hw_addr_iface)
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index e72401fdc..b3029eb26 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -438,6 +438,21 @@
does not have QoS configured, or if the port does not have a queue
with the specified ID, the default queue is used instead.
</dd>
+ <dt><code>flow-eviction-threshold</code></dt>
+ <dd>
+ A number of flows as a nonnegative integer. This sets number
+ of flows at which eviction from the kernel flow table will
+ be triggered.
+ If there are a large number of flows then increasing this
+ value to around the number of flows present
+ can result in reduced CPU usage and packet loss.
+ </dd>
+ <dd>
+ The default is 1000.
+ </dd>
+ <dd>
+ Values below 100 will be rounded up to 100.
+ </dd>
</dl>
</column>
</group>