From 7caf7a6be0fae6b341181b3e6286372e2e93b4b8 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Fri, 11 Dec 2015 14:29:18 +0000 Subject: testcase: scalability - configurable installation of flows to the vswitch Stream specific flows can be pre-installed into the vswitch based on the value of testcase specific configuration option "Pre-installed Flows". In case, it is set to 'Yes', then specific flow for each stream will be inserted into the switch. Otherwise only generic flows will be installed. Default value of "Pre-installed Flows" is set to 'No'. Its value can be overridden by CLI parameter pre-installed_flows. This configuration parameter is an enhancement of "MultiSream" feature and it is ignored if "MultiStream" is disabled. Python module 'netaddr' is required by this implementation and it has been added to requirements.txt file. Change-Id: I8a17577a702bf2be2753134eb203b936a87fc2e5 JIRA: VSPERF-83 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Brian Castelli --- vswitches/ovs_dpdk_vhost.py | 4 ++-- vswitches/ovs_vanilla.py | 4 ++-- vswitches/vswitch.py | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'vswitches') diff --git a/vswitches/ovs_dpdk_vhost.py b/vswitches/ovs_dpdk_vhost.py index cf60a5e2..2c7b81ff 100644 --- a/vswitches/ovs_dpdk_vhost.py +++ b/vswitches/ovs_dpdk_vhost.py @@ -148,11 +148,11 @@ class OvsDpdkVhost(IVSwitch): bridge = self._bridges[switch_name] bridge.del_port(port_name) - def add_flow(self, switch_name, flow): + def add_flow(self, switch_name, flow, cache='off'): """See IVswitch for general description """ bridge = self._bridges[switch_name] - bridge.add_flow(flow) + bridge.add_flow(flow, cache=cache) def del_flow(self, switch_name, flow=None): """See IVswitch for general description diff --git a/vswitches/ovs_vanilla.py b/vswitches/ovs_vanilla.py index c6617404..3078de02 100644 --- a/vswitches/ovs_vanilla.py +++ b/vswitches/ovs_vanilla.py @@ -164,11 +164,11 @@ class OvsVanilla(IVSwitch): bridge = self._bridges[switch_name] bridge.del_port(port_name) - def add_flow(self, switch_name, flow): + def add_flow(self, switch_name, flow, cache='off'): """See IVswitch for general description """ bridge = self._bridges[switch_name] - bridge.add_flow(flow) + bridge.add_flow(flow, cache=cache) def del_flow(self, switch_name, flow=None): """See IVswitch for general description diff --git a/vswitches/vswitch.py b/vswitches/vswitch.py index fbec861a..a28c0f6b 100644 --- a/vswitches/vswitch.py +++ b/vswitches/vswitch.py @@ -89,11 +89,18 @@ class IVSwitch(object): """ raise NotImplementedError() - def add_flow(self, switch_name, flow): + def add_flow(self, switch_name, flow, cache='off'): """Add a flow rule to the logical switch :param switch_name: The switch on which to operate :param flow: Flow description as a dictionary + :param cache: Optional. Specifies if flow should be inserted + to the switch or cached to increase performance during manipulation + with large number of flows. + Values: + 'off' - cache is off and flow is inserted directly to the switch + 'on' - cache is on and flow is inserted into the cache + 'flush' - cache content will be inserted into the switch Example flow dictionary: flow = { -- cgit 1.2.3-korg