From 204a30e7f8d2c7b51208767c715916729b6017b2 Mon Sep 17 00:00:00 2001 From: Billy O'Mahony Date: Tue, 7 Jul 2015 14:26:14 +0100 Subject: testcase: Add frame modification config * 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 Reviewed-by: Al Morton Reviewed-by: Eugene Snider Reviewed-by: Maryam Tahhan Reviewed-by: Gurpreet Singh Reviewed-by: Tv Rao --- core/vswitch_controller_p2p.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/vswitch_controller_p2p.py b/core/vswitch_controller_p2p.py index a71f42f5..f2ed73dd 100644 --- a/core/vswitch_controller_p2p.py +++ b/core/vswitch_controller_p2p.py @@ -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) -- cgit 1.2.3-korg