[ovs-dev] [patch_v0 3/3] OF1.5-EXT-334: Make Check Modifications for OF1.5/EXT-334-OXS Support

2017-04-20 Thread Harivelam Lavanya
[patch_v0 3/3] OF1.5-EXT-334: Make Check Modifications for OF1.5/EXT-334-OXS 
Support

Changes in ofproto.at and ofproto-dpif.at :-  

For 1.5 version "flags"  variable has been removed from flow_stats_reply 
structure.So inorder to avoid make check failures for OF1.5 version add-flow 
with flags,below test cases has been modified for 1.5 version in respective .at 
files

Files  testcase  
ofproto.at   0884
ofproto-dpif1126

Signed-off-by: Harivelam Lavanya
Co-authored-by: Satya Valli 

>From 42f9e61e07ff5fee02831049f48b2a8facb1f369 Mon Sep 17 00:00:00 2001
From: Harivelam Lavanya 
Date: Thu, 20 Apr 2017 16:35:35 +0530
Subject: [PATCH 4/4] Make Check Modifications for OF1.5/EXT-334-OXS Support

---
 tests/ofproto-dpif.at | 1 - 
 tests/ofproto.at  | 4 
 2 files changed, 5 deletions(-)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 0c2ea384b..3ee98cfbd 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -6944,7 +6944,6 @@ flow_mods_reset_counts () {
 # OpenFlow versions >= 1.3 should behave the same way 
 flow_mods_reset_counts 13
 flow_mods_reset_counts 14
-flow_mods_reset_counts 15
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
diff --git a/tests/ofproto.at b/tests/ofproto.at
index 5c0d07623..6a222ce68 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -1392,10 +1392,6 @@ AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | 
ofctl_strip], [0], [dnl
 OFPST_FLOW reply (OF1.4):
  check_overlap reset_counts in_port=1 actions=drop
 ])
-AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip], [0], [dnl
-OFPST_FLOW reply (OF1.5):
- check_overlap reset_counts in_port=1 actions=drop
-])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
-- 
2.11.0


=-=-=
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
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [patch_v0 2/3] OF1.5-EXT-334: Extensible Flow Entry Statistics Implementation --lib/ofp-util.c lib/ox_stat.c

2017-04-20 Thread Harivelam Lavanya
[patch_v0 2/3] OF1.5-EXT-334: Extensible Flow Entry Statistics Implementation 
--lib/ofp-util.c lib/ox_stat.c

Signed-off-by: Harivelam Lavanya
Co-authored-by: Satya Valli 


>From f2e03a1fdcad61fd9221d6f81ff708b017a119f4 Mon Sep 17 00:00:00 2001
From: Harivelam Lavanya 
Date: Wed, 19 Apr 2017 19:44:27 +0530
Subject: [PATCH 3/4] OF1.5/EXT-334-OXS Individal Flow Entry Statistics
 --lib/ofp-util.c lib/ox_stat.c

---
 lib/ofp-util.c | 125 ++-
 lib/ox-stat.c  | 310 +
 2 files changed, 430 insertions(+), 5 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 1f038c61e..a261d981a 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -50,9 +50,12 @@
 #include "unaligned.h"
 #include "util.h"
 #include "uuid.h"
+#include "ox-stat.h"

 VLOG_DEFINE_THIS_MODULE(ofp_util);

+extern uint8_t oxs_field_set;
+
 /* Rate limit for OpenFlow message parse errors.  These always indicate a bug
  * in the peer and so there's not much point in showing a lot of them. */
 static struct vlog_rate_limit bad_ofmsg_rl = VLOG_RATE_LIMIT_INIT(1, 5);
@@ -2313,6 +2316,39 @@ ofputil_decode_ofpst11_flow_request(struct 
ofputil_flow_stats_request *fsr,
 return 0;
 }

+ofputil_decode_ofpst15_flow_request(struct ofputil_flow_stats_request *fsr,
+struct ofpbuf *b, bool aggregate,
+const struct tun_table *tun_table,
+const struct vl_mff_map *vl_mff_map)
+{
+   const struct ofp15_oxs_flow_stats_request *ofsr;
+   enum ofperr error,stat_error;
+   uint16_t statlen;
+
+   ofsr = ofpbuf_pull(b, sizeof *ofsr);
+   fsr->aggregate = aggregate;
+   fsr->table_id = ofsr->table_id;
+
+   error = ofputil_port_from_ofp11(ofsr->out_port, &fsr->out_port);
+   if (error) {
+   return error;
+   }
+
+   fsr->out_group = ntohl(ofsr->out_group);
+   fsr->cookie = ofsr->cookie;
+   fsr->cookie_mask = ofsr->cookie_mask;
+
+   error = ofputil_pull_ofp11_match(b, tun_table, vl_mff_map, &fsr->match,
+NULL);
+   stat_error = oxs_pull_stat(b, NULL, &statlen);
+
+   if (error || stat_error) {
+   return error;
+   }
+
+   return 0;
+}
+
 static enum ofperr
 ofputil_decode_nxst_flow_request(struct ofputil_flow_stats_request *fsr,
  struct ofpbuf *b, bool aggregate,
@@ -2762,6 +2798,10 @@ ofputil_decode_flow_stats_request(struct 
ofputil_flow_stats_request *fsr,
 case OFPRAW_OFPST11_AGGREGATE_REQUEST:
 return ofputil_decode_ofpst11_flow_request(fsr, &b, true, tun_table,
vl_mff_map);
+case OFPRAW_OFPST15_OXS_FLOW_REQUEST:
+oxs_field_set = 0;
+return ofputil_decode_ofpst15_flow_request(fsr, &b, false, tun_table,
+   vl_mff_map);

 case OFPRAW_NXST_FLOW_REQUEST:
 return ofputil_decode_nxst_flow_request(fsr, &b, false, tun_table,
@@ -2791,9 +2831,7 @@ ofputil_encode_flow_stats_request(const struct 
ofputil_flow_stats_request *fsr,
 case OFPUTIL_P_OF11_STD:
 case OFPUTIL_P_OF12_OXM:
 case OFPUTIL_P_OF13_OXM:
-case OFPUTIL_P_OF14_OXM:
-case OFPUTIL_P_OF15_OXM:
-case OFPUTIL_P_OF16_OXM: {
+case OFPUTIL_P_OF14_OXM: {
 struct ofp11_flow_stats_request *ofsr;

 raw = (fsr->aggregate
@@ -2811,6 +2849,25 @@ ofputil_encode_flow_stats_request(const struct 
ofputil_flow_stats_request *fsr,
 break;
 }

+case OFPUTIL_P_OF15_OXM:
+case OFPUTIL_P_OF16_OXM: {
+struct ofp15_oxs_flow_stats_request *ofsr;
+raw = (fsr->aggregate
+   ? OFPRAW_OFPST11_AGGREGATE_REQUEST
+   : OFPRAW_OFPST15_OXS_FLOW_REQUEST);
+msg = ofpraw_alloc(raw, ofputil_protocol_to_ofp_version(protocol),
+   ofputil_match_typical_len(protocol));
+ofsr = ofpbuf_put_zeros(msg, sizeof *ofsr);
+ofsr->table_id = fsr->table_id;
+ofsr->out_port = ofputil_port_to_ofp11(fsr->out_port);
+ofsr->out_group = htonl(fsr->out_group);
+ofsr->cookie = fsr->cookie;
+ofsr->cookie_mask = fsr->cookie_mask;
+ofputil_put_ofp11_match(msg, &fsr->match, protocol);
+oxs_put_stat(msg, NULL, ofputil_protocol_to_ofp_version(protocol));
+break;
+}
+
 case OFPUTIL_P_OF10_STD:
 case OFPUTIL_P_OF10_STD_TID: {
 struct ofp10_flow_stats_request *ofsr;
@@ -2893,7 +2950,48 @@ ofputil_decode_flow_stats_reply(struct 
ofputil_flow_stats *fs,

 if (!msg->size) {
 return EOF;
-} else if (raw == OFPRAW_OFPST11_FLOW_REPLY
+} else if (raw == OFPRAW_OFPST15_OXS_FLOW_REPLY) {
+const struct ofp15_oxs_flow_stats_reply *ofs;
+size_t length;
+uint16_t pa