[ovs-dev] [pre-async 4/8] openflow: Merge ofp_flow_stats_request and ofp_aggregate_stats_request.

Ben Pfaff blp at nicira.com
Tue May 24 23:25:16 UTC 2011


---
 include/openflow/openflow.h |   16 ++--------------
 lib/ofp-util.c              |    5 +----
 ofproto/ofproto.c           |    2 +-
 3 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h
index 5329f20..b7c7085 100644
--- a/include/openflow/openflow.h
+++ b/include/openflow/openflow.h
@@ -706,7 +706,7 @@ enum ofp_stats_types {
     OFPST_FLOW,
 
     /* Aggregate flow statistics.
-     * The request body is struct ofp_aggregate_stats_request.
+     * The request body is struct ofp_flow_stats_request.
      * The reply body is struct ofp_aggregate_stats_reply. */
     OFPST_AGGREGATE,
 
@@ -759,7 +759,7 @@ struct ofp_desc_stats {
 };
 OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056);
 
-/* Body for stats request of type OFPST_FLOW. */
+/* Body for stats request of type OFPST_FLOW or OFPST_AGGREGATE. */
 struct ofp_flow_stats_request {
     struct ofp_match match;   /* Fields to match. */
     uint8_t table_id;         /* ID of table to read (from ofp_table_stats)
@@ -792,18 +792,6 @@ struct ofp_flow_stats {
 };
 OFP_ASSERT(sizeof(struct ofp_flow_stats) == 88);
 
-/* Body for stats request of type OFPST_AGGREGATE. */
-struct ofp_aggregate_stats_request {
-    struct ofp_match match;   /* Fields to match. */
-    uint8_t table_id;         /* ID of table to read (from ofp_table_stats)
-                                 or 0xff for all tables. */
-    uint8_t pad;              /* Align to 32 bits. */
-    ovs_be16 out_port;        /* Require matching entries to include this
-                                 as an output port.  A value of OFPP_NONE
-                                 indicates no restriction. */
-};
-OFP_ASSERT(sizeof(struct ofp_aggregate_stats_request) == 44);
-
 /* Body of reply to OFPST_AGGREGATE request. */
 struct ofp_aggregate_stats_reply {
     ovs_32aligned_be64 packet_count; /* Number of packets in flows. */
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index c5987ed..64ce837 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -533,7 +533,7 @@ ofputil_decode_ofpst_request(const struct ofp_header *oh,
 
         { OFPUTIL_OFPST_AGGREGATE_REQUEST,
           OFPST_AGGREGATE, "OFPST_AGGREGATE request",
-          OSM_SIZE + sizeof(struct ofp_aggregate_stats_request), 0 },
+          OSM_SIZE + sizeof(struct ofp_flow_stats_request), 0 },
 
         { OFPUTIL_OFPST_TABLE_REQUEST,
           OFPST_TABLE, "OFPST_TABLE request",
@@ -1138,9 +1138,6 @@ ofputil_encode_flow_stats_request(const struct flow_stats_request *fsr,
         struct ofp_flow_stats_request *ofsr;
         int type;
 
-        BUILD_ASSERT_DECL(sizeof(struct ofp_flow_stats_request)
-                          == sizeof(struct ofp_aggregate_stats_request));
-
         type = fsr->aggregate ? OFPST_AGGREGATE : OFPST_FLOW;
         ofsr = ofputil_make_stats_request(sizeof *ofsr, type, &msg);
         ofputil_cls_rule_to_match(&fsr->match, &ofsr->match);
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 4ffa241..6db3b2c 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2057,7 +2057,7 @@ static int
 handle_aggregate_stats_request(struct ofconn *ofconn,
                                const struct ofp_header *oh)
 {
-    const struct ofp_aggregate_stats_request *request = ofputil_stats_body(oh);
+    const struct ofp_flow_stats_request *request = ofputil_stats_body(oh);
     struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
     struct ofp_aggregate_stats_reply *reply;
     struct cls_rule target;
-- 
1.7.4.4




More information about the dev mailing list