From: rishibamba <[email protected]>

This patch enables a user to set importance for a new rule via add-flow
OF1.1+ in the OVS and display the same via dump-flows command OF1.1+ .
The changes are made in accordance with OpenFlow 1.4 specs to implement
Eviction on the basis of "importance".

Changes made to DESIGN and added test cases

Signed-off-by: Rishi Bamba <[email protected]>
---
 DESIGN.md          |  7 +++++--
 tests/ovs-ofctl.at | 29 +++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/DESIGN.md b/DESIGN.md
index 6f8d090..bd0ed27 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -277,8 +277,11 @@ The table for 1.3 is the same as the one shown above for 
1.2.
 OpenFlow 1.4
 ------------
 
-OpenFlow 1.4 does not change flow_mod semantics.
-
+OpenFlow 1.4 adds the "importance" field to flow_mods, but it does not
+explicitly specify which kinds of flow_mods set the importance.For
+consistency, Open vSwitch uses the same rule for importance as for
+idle_timeout and hard_timeout, that is, only an "ADD" flow_mod sets
+the importance.  (This issue has been filed with the ONF as EXT-496.)
 
 OFPT_PACKET_IN
 ==============
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index d29b4de..258b906 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -2712,3 +2712,32 @@ AT_CHECK([tail -1 stdout], [0],
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+dnl Check importance parameter added in OF1.4.
+dnl It validates whether importance set via add-flow via OpenFlow1.1+ gets
+dnl set or not by validating it againt the dump-flows output via OpenFlow1.1+
+dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 
1.1+
+dnl then the importance will be considered zero whether provided as an 
argument.
+
+AT_SETUP([ovs-ofctl rule with importance])
+OVS_VSWITCHD_START
+dnl Flow with importance parameter added via OF1.1+ and later version
+AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 
priority=21,importance=21,actions=normal])
+AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal])
+
+dnl Importance parameter will only be visible of flows that are added via 
OF1.1+ if dumped via OF1.1+
+AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip], [0], [dnl
+OFPST_FLOW reply (OF1.3):
+ priority=22 actions=NORMAL
+ importance=21, priority=21 actions=NORMAL
+])
+
+dnl Importance parameter will not be visible if flow is dumped with later 
version of OF1.1+ whether added via OF1.1+
+AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
+NXST_FLOW reply:
+ priority=22 actions=NORMAL
+ priority=21 actions=NORMAL
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
-- 
2.1.1

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to