diff mbox

[ovs-dev,3/6] OF1.5/EXT-334 OXS/Aggregate Flow Statistics -1

Message ID 1495040466-24989-1-git-send-email-satyavalli.rama@tcs.com
State Changes Requested
Headers show

Commit Message

SatyaValli May 17, 2017, 5:01 p.m. UTC
From: SatyaValli <satyavalli.rama@tcs.com>

OXS support Aggregate Multipart Statistiscs

Signed-off-by:  Satya Valli <satyavalli.rama@tcs.com>
Co-authored-by: Muttamsetty Surya <muttamsetty.surya@tcs.com>
---
 include/openvswitch/ofp-msgs.h | 6 ++++++
 lib/ofp-print.c                | 6 ++++++
 lib/ofp-util.c                 | 9 ++++++++-
 lib/rconn.c                    | 2 ++
 ofproto/ofproto.c              | 4 ++++
 5 files changed, 26 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index 089db47..7d49bc7 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -307,11 +307,15 @@  enum ofpraw {
     OFPRAW_OFPST10_AGGREGATE_REQUEST,
     /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */
     OFPRAW_OFPST11_AGGREGATE_REQUEST,
+    /* OFPST 1.5+ (18): struct ofp15_oxs_flow_stats_request, uint8_t[8][]. */
+    OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST,
     /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */
     OFPRAW_NXST_AGGREGATE_REQUEST,
 
     /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */
     OFPRAW_OFPST_AGGREGATE_REPLY,
+    /* OFPST 1.5+ (18): uint8_t[] . */
+    OFPRAW_OFPST15_OXS_AGGREGATE_REPLY,
     /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */
     OFPRAW_NXST_AGGREGATE_REPLY,
 
@@ -640,9 +644,11 @@  enum ofptype {
     OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST.
                                       * OFPRAW_OFPST11_AGGREGATE_REQUEST.
                                       * OFPRAW_NXST_AGGREGATE_REQUEST. */
+    OFPTYPE_OXS_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST. */
     OFPTYPE_OXS_FLOW_STATS_REPLY,    /* OFPRAW_OFPST15_OXS_FLOW_REPLY. */
     OFPTYPE_AGGREGATE_STATS_REPLY,   /* OFPRAW_OFPST_AGGREGATE_REPLY.
                                       * OFPRAW_NXST_AGGREGATE_REPLY. */
+    OFPTYPE_OXS_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST15_OXS_AGGREGATE_REPLY. */
     OFPTYPE_TABLE_STATS_REQUEST,     /* OFPRAW_OFPST_TABLE_REQUEST. */
     OFPTYPE_TABLE_STATS_REPLY,       /* OFPRAW_OFPST10_TABLE_REPLY.
                                       * OFPRAW_OFPST11_TABLE_REPLY.
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 0f855fa..c209c19 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -3564,6 +3564,7 @@  ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
         break;
 
     case OFPTYPE_OXS_FLOW_STATS_REQUEST:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
         ofp_print_stats(string, oh);
         ofp_print_flow_stats_request(string, oh);
         break;
@@ -3597,6 +3598,11 @@  ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
         ofp_print_flow_stats_reply(string, oh);
         break;
 
+    case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
+        ofp_print_stats(string, oh);
+        ofp_print_aggregate_stats_reply(string, oh);
+        break;
+
     case OFPTYPE_QUEUE_STATS_REPLY:
         ofp_print_stats(string, oh);
         ofp_print_ofpst_queue_reply(string, oh, verbosity);
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 4813d77..adb87eb 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -2805,6 +2805,11 @@  ofputil_decode_flow_stats_request(struct ofputil_flow_stats_request *fsr,
         return ofputil_decode_ofpst15_flow_request(fsr, &b, false, tun_table,
                                                    vl_mff_map);
 
+    case OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST:
+        oxs_field_set = 0;
+        return ofputil_decode_ofpst15_flow_request(fsr, &b, true, tun_table,
+                                                   vl_mff_map);
+
     case OFPRAW_NXST_FLOW_REQUEST:
         return ofputil_decode_nxst_flow_request(fsr, &b, false, tun_table,
                                                 vl_mff_map);
@@ -2835,7 +2840,7 @@  ofputil_encode_flow_stats_request(const struct ofputil_flow_stats_request *fsr,
         struct ofp15_oxs_flow_stats_request *ofsr;
 
         raw = (fsr->aggregate
-               ? OFPRAW_OFPST11_AGGREGATE_REQUEST
+               ? OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST 
                : OFPRAW_OFPST15_OXS_FLOW_REQUEST);
         msg = ofpraw_alloc(raw, ofputil_protocol_to_ofp_version(protocol),
                            ofputil_match_typical_len(protocol));
@@ -10267,6 +10272,7 @@  ofputil_is_bundlable(enum ofptype type)
     case OFPTYPE_FLOW_STATS_REQUEST:
     case OFPTYPE_OXS_FLOW_STATS_REQUEST:
     case OFPTYPE_AGGREGATE_STATS_REQUEST:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
     case OFPTYPE_TABLE_STATS_REQUEST:
     case OFPTYPE_TABLE_FEATURES_STATS_REQUEST:
     case OFPTYPE_TABLE_DESC_REQUEST:
@@ -10299,6 +10305,7 @@  ofputil_is_bundlable(enum ofptype type)
     case OFPTYPE_PORT_STATS_REPLY:
     case OFPTYPE_TABLE_STATS_REPLY:
     case OFPTYPE_AGGREGATE_STATS_REPLY:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
     case OFPTYPE_PORT_DESC_STATS_REPLY:
     case OFPTYPE_ROLE_REPLY:
     case OFPTYPE_FLOW_MONITOR_PAUSED:
diff --git a/lib/rconn.c b/lib/rconn.c
index 13890e7..4cf6a37 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -1396,6 +1396,8 @@  is_admitted_msg(const struct ofpbuf *b)
     case OFPTYPE_OXS_FLOW_STATS_REPLY:
     case OFPTYPE_AGGREGATE_STATS_REQUEST:
     case OFPTYPE_AGGREGATE_STATS_REPLY:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
     case OFPTYPE_TABLE_STATS_REQUEST:
     case OFPTYPE_TABLE_STATS_REPLY:
     case OFPTYPE_PORT_STATS_REQUEST:
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 4b95c9d..9400878 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -8098,6 +8098,9 @@  handle_openflow__(struct ofconn *ofconn, const struct ofpbuf *msg)
     case OFPTYPE_AGGREGATE_STATS_REQUEST:
         return handle_aggregate_stats_request(ofconn, oh);
 
+    case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
+        return handle_aggregate_stats_request(ofconn, oh);
+
     case OFPTYPE_TABLE_STATS_REQUEST:
         return handle_table_stats_request(ofconn, oh);
 
@@ -8175,6 +8178,7 @@  handle_openflow__(struct ofconn *ofconn, const struct ofpbuf *msg)
     case OFPTYPE_PORT_STATS_REPLY:
     case OFPTYPE_TABLE_STATS_REPLY:
     case OFPTYPE_AGGREGATE_STATS_REPLY:
+    case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
     case OFPTYPE_PORT_DESC_STATS_REPLY:
     case OFPTYPE_ROLE_REPLY:
     case OFPTYPE_FLOW_MONITOR_PAUSED: