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 1f7d432..e75aaa5 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 10eee8b..e1dd9f5 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 d5dc0d8..ef4c138 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 c1b124b..8438b47 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);
 }