[ovs-dev] [PATCH 2/4] ovs-ofctl:To set importance of a rule for eviction(OF14)

Rishi Bamba rishi.bamba at tcs.com
Fri Oct 10 13:50:14 UTC 2014


Hi Ben,

# In reference to the [Patch 1/4] This patch includes the Design file changes as suggested and test cases for add-flow and dump-flow
# CLI in order to perform testing of the importance parameter in a rule for different protocols of OpenFlow.

---
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 <rishi.bamba at tcs.com>
---
 DESIGN             |  7 +++++--
 tests/ovs-ofctl.at | 29 +++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/DESIGN b/DESIGN
index f864135..e480764 100644
--- a/DESIGN
+++ b/DESIGN
@@ -269,8 +269,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 8eca295..96f2097 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -2651,3 +2651,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

Thank You
Regards
Rishi


----- Original Message -----
From: "Rishi Bamba" <rishi.bamba at tcsin.com>
To: "Ben Pfaff" <blp at nicira.com>
Cc: dev at openvswitch.org, "partha datta" <partha.datta at tcs.com>, "deepankar gupta" <deepankar.gupta at tcs.com>
Sent: Friday, October 10, 2014 7:11:45 PM
Subject: Re: [PATCH 1/4] ovs-ofctl:To set importance of a rule for eviction(OF14)

Hi Ben,

# Thank you for reviewing the patch.As per the comments received ,all the changes are made and incorporated for this patch i.e Clang
# compiler doesn't report any error now and all the test cases are successful including the one added by us for the same.Also along
# with this patch sending three other patches related to the addition of importance in a rule which includes the changes as asked by
# you plus replace-flows and diff-flows CLI enhancement after the addition of "importance" parameter in a rule as per OF14.
---
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".
=====-----=====-----=====
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




More information about the dev mailing list