summaryrefslogtreecommitdiffstats
path: root/core/vswitch_controller_op2p.py
diff options
context:
space:
mode:
authorDino Simeon Madarang <dino.simeonx.madarang@intel.com>2016-01-26 13:49:59 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-02-03 10:17:23 +0000
commit26d5dcc91e9bbf92a28892382094022997d07b5a (patch)
tree4ab23aced5a4d5f5dce9104a30f929a614bcd410 /core/vswitch_controller_op2p.py
parentf463c563912abb806fe0d2fe85a4cf6825f416cc (diff)
Add simple VxLAN decapsulation performance test
Measure OVS DPDK VXLAN decapsulation performance. The DUT is configured as a VTEP (VXLAN Tunnel Endpoint) which performs decapsulation of frames and sends traffic to the 2nd traffic generator port. This test is unidirectional. Recent changes: * Userguide update * Move src/dstport from L2 to L4 (conf, TCL) * Fix 'TestCase' object has no attribute '_tunnel_operation' error when running non overlay tests * Fix merge conflict * Move doc to docs/userguide/integration.rst * Add setting of DUT_NIC1_MAC and setting of other variables to docs/userguide/integration.rst Change-Id: Ia44f8888ef727831543c80f5c98c866686c5c92c JIRA: VSPERF-190 Signed-off-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com> Signed-off-by: Robert Wojciechowicz <robertx.wojciechowicz@intel.com> Signed-off-by: Timo Puha <timox.puha@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com> Reviewed-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com
Diffstat (limited to 'core/vswitch_controller_op2p.py')
-rw-r--r--core/vswitch_controller_op2p.py74
1 files changed, 71 insertions, 3 deletions
diff --git a/core/vswitch_controller_op2p.py b/core/vswitch_controller_op2p.py
index 69c88c35..ac817153 100644
--- a/core/vswitch_controller_op2p.py
+++ b/core/vswitch_controller_op2p.py
@@ -35,7 +35,7 @@ class VswitchControllerOP2P(IVswitchController):
_deployment_scenario: A string describing the scenario to set-up in the
constructor.
"""
- def __init__(self, vswitch_class, traffic):
+ def __init__(self, vswitch_class, traffic, tunnel_operation=None):
"""Initializes up the prerequisites for the OP2P deployment scenario.
:vswitch_class: the vSwitch class to be used.
@@ -45,10 +45,20 @@ class VswitchControllerOP2P(IVswitchController):
self._vswitch = vswitch_class()
self._deployment_scenario = "OP2P"
self._traffic = traffic.copy()
+ self._tunnel_operation = tunnel_operation
self._logger.debug('Creation using ' + str(self._vswitch_class))
def setup(self):
- """ Sets up the switch for overlay P2P
+ """ Sets up the switch for overlay P2P (tunnel encap or decap)
+ """
+ self._logger.debug('Setting up ' + str(self._tunnel_operation))
+ if self._tunnel_operation == "encapsulation":
+ self._setup_encap()
+ else:
+ self._setup_decap()
+
+ def _setup_encap(self):
+ """ Sets up the switch for overlay P2P encapsulation test
Create 2 bridges br0 (integration bridge) and br-ext and a VXLAN port
for encapsulation.
@@ -95,7 +105,7 @@ class VswitchControllerOP2P(IVswitchController):
if settings.getValue('VSWITCH').endswith('Vanilla'):
tasks.run_task(['sudo', 'arp', '-s', vtep_ip2, tg_port2_mac],
self._logger,
- 'Set ' + bridge_ext + 'status to up')
+ 'Set ' + bridge_ext + ' status to up')
else:
self._vswitch.set_tunnel_arp(vtep_ip2,
tg_port2_mac,
@@ -111,6 +121,64 @@ class VswitchControllerOP2P(IVswitchController):
self._vswitch.stop()
raise
+ def _setup_decap(self):
+ """ Sets up the switch for overlay P2P decapsulation test
+ """
+ self._logger.debug('Setup using ' + str(self._vswitch_class))
+
+ try:
+ self._vswitch.start()
+ bridge = settings.getValue('TUNNEL_INTEGRATION_BRIDGE')
+ bridge_ext = settings.getValue('TUNNEL_EXTERNAL_BRIDGE')
+ bridge_ext_ip = settings.getValue('TUNNEL_EXTERNAL_BRIDGE_IP')
+ tgen_ip1 = settings.getValue('TRAFFICGEN_PORT1_IP')
+ self._vswitch.add_switch(bridge)
+
+ tasks.run_task(['sudo', 'ifconfig', bridge,
+ settings.getValue('VTEP_IP1')],
+ self._logger, 'Assign ' +
+ settings.getValue('VTEP_IP1') + ' to ' + bridge, False)
+
+ tunnel_type = self._traffic['tunnel_type']
+
+ self._vswitch.add_switch(bridge_ext)
+ self._vswitch.add_phy_port(bridge)
+ (_, phy2_number) = self._vswitch.add_phy_port(bridge_ext)
+ vxlan_vni = 'options:key=' + settings.getValue('VXLAN_VNI')
+ (_, phy3_number) = self._vswitch.add_tunnel_port(bridge_ext,
+ tgen_ip1,
+ tunnel_type,
+ params=[vxlan_vni])
+
+ tasks.run_task(['sudo', 'ip', 'addr', 'add',
+ bridge_ext_ip,
+ 'dev', bridge_ext],
+ self._logger, 'Assign ' +
+ bridge_ext_ip
+ + ' to ' + bridge_ext)
+
+ tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', bridge_ext,
+ 'up'],
+ self._logger,
+ 'Set ' + bridge_ext + ' status to up')
+
+ self._vswitch.set_tunnel_arp(tgen_ip1,
+ settings.getValue('TRAFFICGEN_PORT1_MAC'),
+ bridge)
+ self._vswitch.set_tunnel_arp(bridge_ext_ip.split('/')[0],
+ settings.getValue('DUT_NIC1_MAC'),
+ bridge_ext)
+
+ # Test is unidirectional for now
+ self._vswitch.del_flow(bridge_ext)
+ flow1 = add_ports_to_flow(_FLOW_TEMPLATE, phy3_number,
+ phy2_number)
+ self._vswitch.add_flow(bridge_ext, flow1)
+
+ except:
+ self._vswitch.stop()
+ raise
+
def stop(self):
"""Tears down the switch created in setup().
"""