Hi Ben, --- This patch enhances the diff-flows & replace-flows CLI that takes into account the addition of importance parameter in a rule as per the OpenFlow Specs 1.4.
Signed-off-by: Rishi Bamba <rishi.ba...@tcs.com> --- utilities/ovs-ofctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 8dcd72c..ceffe4a 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -2248,6 +2248,7 @@ struct fte_version { ovs_be64 cookie; uint16_t idle_timeout; uint16_t hard_timeout; + uint16_t importance; uint16_t flags; struct ofpact *ofpacts; size_t ofpacts_len; @@ -2273,6 +2274,7 @@ fte_version_equals(const struct fte_version *a, const struct fte_version *b) return (a->cookie == b->cookie && a->idle_timeout == b->idle_timeout && a->hard_timeout == b->hard_timeout + && a->importance == b->importance && ofpacts_equal(a->ofpacts, a->ofpacts_len, b->ofpacts, b->ofpacts_len)); } @@ -2299,6 +2301,9 @@ fte_version_format(const struct fte *fte, int index, struct ds *s) if (version->hard_timeout != OFP_FLOW_PERMANENT) { ds_put_format(s, " hard_timeout=%"PRIu16, version->hard_timeout); } + if (version->importance != OFP_FLOW_PERMANENT) { + ds_put_format(s, " importance=%"PRIu16, version->importance); + } ds_put_cstr(s, " actions="); ofpacts_format(version->ofpacts, version->ofpacts_len, s); @@ -2396,6 +2401,7 @@ read_flows_from_file(const char *filename, struct classifier *cls, int index) version->cookie = fm.new_cookie; version->idle_timeout = fm.idle_timeout; version->hard_timeout = fm.hard_timeout; + version->importance = fm.importance; version->flags = fm.flags & (OFPUTIL_FF_SEND_FLOW_REM | OFPUTIL_FF_EMERG); version->ofpacts = fm.ofpacts; @@ -2498,6 +2504,7 @@ read_flows_from_switch(struct vconn *vconn, version->cookie = fs.cookie; version->idle_timeout = fs.idle_timeout; version->hard_timeout = fs.hard_timeout; + version->importance = fs.importance; version->flags = 0; version->ofpacts_len = fs.ofpacts_len; version->ofpacts = xmemdup(fs.ofpacts, fs.ofpacts_len); @@ -2525,6 +2532,7 @@ fte_make_flow_mod(const struct fte *fte, int index, uint16_t command, fm.command = command; fm.idle_timeout = version->idle_timeout; fm.hard_timeout = version->hard_timeout; + fm.importance = version->importance; fm.buffer_id = UINT32_MAX; fm.out_port = OFPP_ANY; fm.flags = version->flags; -- 2.1.1 Thank You Regards Rishi ----- Original Message ----- From: "Rishi Bamba" <rishi.ba...@tcsin.com> To: "Ben Pfaff" <b...@nicira.com> Cc: dev@openvswitch.org, "partha datta" <partha.da...@tcs.com>, "deepankar gupta" <deepankar.gu...@tcs.com> Sent: Friday, October 10, 2014 7:20:14 PM Subject: [PATCH 2/4] ovs-ofctl:To set importance of a rule for eviction(OF14) 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 ----- Original Message ----- From: "Rishi Bamba" <rishi.ba...@tcsin.com> To: "Ben Pfaff" <b...@nicira.com> Cc: dev@openvswitch.org, "partha datta" <partha.da...@tcs.com>, "deepankar gupta" <deepankar.gu...@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 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev