testcase: Add frame modification config 96/996/7
authorBilly O'Mahony <billy.o.mahony@intel.com>
Tue, 7 Jul 2015 13:26:14 +0000 (14:26 +0100)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Mon, 27 Jul 2015 16:24:32 +0000 (16:24 +0000)
* Added a new standard set of flow table that defaults to routing phy1 to phy2
  and vice-versa and allows frame modification and tuple matches to be added
  independently of routing.
* Add a FrameMod testcase attribute - implement this for value 'vlan'
* With FrameMod == 'vlan' the reported tx_fps and rx_fps figures do not match
  even for RFC2544 throughtput 0% packet loss - this is a pre-existing bug
  and a fix will be done as a separate patch. The rx_fps figure is the
  reliable figure.

JIRA: VSPERF-27

Change-Id: Idd137b7a101305e7aebb6fabdfb6a7a4dcf8661b
Signed-off-by: Billy O'Mahony<billy.o.mahony@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Eugene Snider <Eugene.Snider@huawei.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Gurpreet Singh <gurpreet.singh@spirent.com>
Reviewed-by: Tv Rao <tv.rao@freescale.com>
conf/01_testcases.conf
core/vswitch_controller_p2p.py
docs/quickstart.md
src/ovs/ofctl.py
testcases/testcase.py

index 53d63e7..f0fe8ad 100755 (executable)
@@ -35,15 +35,24 @@ PERFORMANCE_TESTS = [
         "Traffic Type": "rfc2544",
         "Collector": "cpu",
         "Deployment": "p2p",
-        "Description": "RFC2544 Throughput Phy2Phy Loopback",
         "biDirectional": "True",
+        "Description": "LTD.Throughput.RFC2544.PacketLossRatio",
     },
     {
         "Name": "back2back",
         "Traffic Type": "back2back",
         "Collector": "cpu",
         "Deployment": "p2p",
-        "Description": "RFC 2544 Back To Back Frames Test",
         "biDirectional": "True",
+        "Description": "LTD.Throughput.RFC2544.BackToBackFrames",
+    },
+    {
+        "Name": "phy2phy_tput_mod_vlan",
+        "Traffic Type": "rfc2544",
+        "Collector": "cpu",
+        "Deployment": "p2p",
+        "Frame Modification": "vlan",
+        "biDirectional": "False",
+        "Description": "LTD.Throughput.RFC2544.PacketLossRatioFrameModification"
     },
 ]
index a71f42f..f2ed73d 100644 (file)
@@ -59,7 +59,34 @@ class VswitchControllerP2P(IVswitchController):
             (_, phy2_number) = self._vswitch.add_phy_port(BRIDGE_NAME)
 
             self._vswitch.del_flow(BRIDGE_NAME)
-            flow = add_ports_to_flow(_FLOW_TEMPLATE, phy1_number, phy2_number)
+
+            # table#0 - flows designed to force 5 & 13 tuple matches go here
+            flow = {'table':'0', 'priority':'1', 'actions': ['goto_table:1']}
+            self._vswitch.add_flow(BRIDGE_NAME, flow)
+
+            # table#1 - flows to route packets between ports goes here. The
+            # chosen port is communicated to subsequent tables by setting the
+            # metadata value to the egress port number
+            flow = {'table':'1', 'priority':'1', 'in_port':'1',
+                    'actions': ['write_actions(output:2)', 'write_metadata:2',
+                        'goto_table:2']}
+            self._vswitch.add_flow(BRIDGE_NAME, flow)
+            flow = {'table':'1', 'priority':'1', 'in_port':'2',
+                    'actions': ['write_actions(output:1)', 'write_metadata:1',
+                        'goto_table:2']}
+            self._vswitch.add_flow(BRIDGE_NAME, flow)
+
+            # Frame modification table. Frame modification flow rules are
+            # isolated in this table so that they can be turned on or off
+            # without affecting the routing or tuple-matching flow rules.
+            flow = {'table':'2', 'priority':'1', 'actions': ['goto_table:3']}
+            self._vswitch.add_flow(BRIDGE_NAME, flow)
+
+            # Egress table
+            # (TODO) Billy O'Mahony - the drop action here actually required in
+            # order to egress the packet. This is the subject of a thread on
+            # ovs-discuss 2015-06-30.
+            flow = {'table':'3', 'priority':'1', 'actions': ['drop']}
             self._vswitch.add_flow(BRIDGE_NAME, flow)
 
             flow = add_ports_to_flow(_FLOW_TEMPLATE, phy2_number, phy1_number)
index b56af67..9ab15c1 100755 (executable)
@@ -3,6 +3,9 @@
 ## Hardware Requirements
 VSPERF requires the following hardware to run tests: IXIA traffic generator (IxNetwork), a machine that runs the IXIA client software and a CentOS Linux release 7.1.1503 (Core) host.
 
+## vSwitch Requirements
+The vSwitch must support Open Flow 1.3 or greater.
+
 ## Installation
 
 Follow the [installation instructions] to install.
index c6aaddc..a2a15ce 100644 (file)
@@ -124,7 +124,7 @@ class OFBridge(OFBase):
 
         :return: None
         """
-        cmd = ['sudo', _OVS_OFCTL_BIN, '--timeout', str(self.timeout)] + args
+        cmd = ['sudo', _OVS_OFCTL_BIN, '-O', 'OpenFlow13', '--timeout', str(self.timeout)] + args
         return tasks.run_task(
             cmd, self.logger, 'Running ovs-ofctl...', check_error)
 
index 5ad91f2..83e038d 100644 (file)
@@ -31,7 +31,10 @@ class TestCase(object):
     def __init__(self, cfg, results_dir):
         """Pull out fields from test config
 
-        No external actions yet.
+        :param cfg: A dictionary of string-value pairs describing the test
+            configuration. Both the key and values strings use well-known
+            values.
+        :param results_dir: Where the csv formatted results are written.
         """
         self._logger = logging.getLogger(__name__)
         self.name = cfg['Name']
@@ -40,6 +43,9 @@ class TestCase(object):
         self._deployment = cfg['Deployment']
         self._collector = cfg['Collector']
         self._bidir = cfg['biDirectional']
+        self._frame_mod = cfg.get('Frame Modification', None)
+        if self._frame_mod:
+            self._frame_mod = self._frame_mod.lower()
         self._results_dir = results_dir
 
     def run(self):
@@ -64,12 +70,20 @@ class TestCase(object):
             self._collector,
             loader.get_collector_class())
 
+
         self._logger.debug("Setup:")
         collector_ctl.log_cpu_stats()
         with vswitch_ctl:
             if vnf_ctl:
                 vnf_ctl.start()
                 traffic = {'traffic_type': self._traffic_type, 'bidir': self._bidir}
+                vswitch = vswitch_ctl.get_vswitch()
+                if self._frame_mod == "vlan":
+                    flow = {'table':'2', 'priority':'1000', 'metadata':'2', 'actions': ['push_vlan:0x8100','goto_table:3']}
+                    vswitch.add_flow('br0', flow)
+                    flow = {'table':'2', 'priority':'1000', 'metadata':'1', 'actions': ['push_vlan:0x8100','goto_table:3']}
+                    vswitch.add_flow('br0', flow)
+
             with traffic_ctl:
                 traffic_ctl.send_traffic(traffic)