Add max_idle field to flow stats messages.
authorBen Pfaff <blp@nicira.com>
Fri, 2 May 2008 01:26:21 +0000 (18:26 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 2 May 2008 17:58:52 +0000 (10:58 -0700)
datapath/datapath.c
include/openflow.h
lib/ofp-print.c
switch/datapath.c

index 1f7d432ea199a7921d7acd4e728bba56ed9c3d18..e75aaa5b919b81c180a8d0bb41307f8accac0f12 100644 (file)
@@ -858,6 +858,7 @@ fill_flow_stats(struct ofp_flow_stats *ofs, struct sw_flow *flow,
        ofs->packet_count    = cpu_to_be64(flow->packet_count);
        ofs->byte_count      = cpu_to_be64(flow->byte_count);
        ofs->priority        = htons(flow->priority);
+       ofs->max_idle        = htons(flow->max_idle);
        ofs->table_id        = table_idx;
        memset(ofs->pad, 0, sizeof ofs->pad);
 }
index 10eee8b0542751904e8e19086ae54c544f44d575..e1dd9f57bdcfcc536dcd38d582081565f9139821 100644 (file)
@@ -426,6 +426,7 @@ struct ofp_flow_stats {
     uint64_t byte_count;      /* Number of bytes in flow. */
     uint16_t priority;        /* Priority of the entry.  Only meaningful 
                                  when this is not an exact-match entry. */
+    uint16_t max_idle;        /* Only used for non-aggregated results. */
     uint8_t table_id;         /* ID of table flow came from. */
     uint8_t pad[5];           /* Align to 64-bits. */
 };
index d5dc0d8774d74ade26f3a2f5cb3b55945f218bfe..ef4c1383dde6a3ffa8fb14e747afb2a9ada16d85 100644 (file)
@@ -486,6 +486,7 @@ ofp_flow_stats_reply(struct ds *string, const void *body, size_t len,
         ds_put_format(string, "n_packets=%"PRIu64", ",
                     ntohll(fs->packet_count));
         ds_put_format(string, "n_bytes=%"PRIu64", ", ntohll(fs->byte_count));
+        ds_put_format(string, "max_idle=%"PRIu16", ", ntohs(fs->max_idle));
         ofp_print_match(string, &fs->match);
      }
 }
index c1b124b2a1cf0fd0896307f884c93b3413d5a8be..8438b4738199b0c77b77fafe541c9e6d496da3d8 100644 (file)
@@ -733,6 +733,7 @@ fill_flow_stats(struct ofp_flow_stats *ofs, struct sw_flow *flow,
     ofs->packet_count    = htonll(flow->packet_count);
     ofs->byte_count      = htonll(flow->byte_count);
     ofs->priority        = htons(flow->priority);
+    ofs->max_idle        = htons(flow->max_idle);
     ofs->table_id        = table_idx;
     memset(ofs->pad, 0, sizeof ofs->pad);
 }