dpif: Eliminate "struct odp_flow_stats" from client-visible interface.
authorBen Pfaff <blp@nicira.com>
Wed, 26 Jan 2011 15:11:50 +0000 (07:11 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Jan 2011 05:08:38 +0000 (21:08 -0800)
Following this commit, "struct odp_flow_stats" is only used in
Linux-specific parts of OVS userspace code.  This allows the actual Linux
datapath interface to evolve more freely.

Reviewed by Justin Pettit.

lib/dpif-linux.c
lib/dpif-netdev.c
lib/dpif-provider.h
lib/dpif.c
lib/dpif.h
lib/flow.c
lib/flow.h
lib/odp-util.c
lib/odp-util.h
ofproto/ofproto.c
utilities/ovs-dpctl.c

index fb682f2..98acebe 100644 (file)
@@ -459,10 +459,20 @@ dpif_linux_port_poll_wait(const struct dpif *dpif_)
     }
 }
 
+static void
+odp_flow_stats_to_dpif_flow_stats(const struct odp_flow_stats *ofs,
+                                  struct dpif_flow_stats *dfs)
+{
+    dfs->n_packets = ofs->n_packets;
+    dfs->n_bytes = ofs->n_bytes;
+    dfs->used = ofs->used_sec * 1000 + ofs->used_nsec / 1000000;
+    dfs->tcp_flags = ofs->tcp_flags;
+}
+
 static int
 dpif_linux_flow_get(const struct dpif *dpif_, int flags,
                     const struct nlattr *key, size_t key_len,
-                    struct ofpbuf **actionsp, struct odp_flow_stats *stats)
+                    struct ofpbuf **actionsp, struct dpif_flow_stats *stats)
 {
     struct ofpbuf *actions = NULL;
     struct odp_flow odp_flow;
@@ -481,7 +491,7 @@ dpif_linux_flow_get(const struct dpif *dpif_, int flags,
     error = do_ioctl(dpif_, ODP_FLOW_GET, &odp_flow);
     if (!error) {
         if (stats) {
-            *stats = odp_flow.stats;
+            odp_flow_stats_to_dpif_flow_stats(&odp_flow.stats, stats);
         }
         if (actions) {
             actions->size = odp_flow.actions_len;
@@ -499,7 +509,7 @@ static int
 dpif_linux_flow_put(struct dpif *dpif_, int flags,
                     const struct nlattr *key, size_t key_len,
                     const struct nlattr *actions, size_t actions_len,
-                    struct odp_flow_stats *stats)
+                    struct dpif_flow_stats *stats)
 {
     struct odp_flow_put put;
     int error;
@@ -513,7 +523,7 @@ dpif_linux_flow_put(struct dpif *dpif_, int flags,
     put.flags = flags;
     error = do_ioctl(dpif_, ODP_FLOW_PUT, &put);
     if (!error && stats) {
-        *stats = put.flow.stats;
+        odp_flow_stats_to_dpif_flow_stats(&put.flow.stats, stats);
     }
     return error;
 }
@@ -521,7 +531,7 @@ dpif_linux_flow_put(struct dpif *dpif_, int flags,
 static int
 dpif_linux_flow_del(struct dpif *dpif_,
                     const struct nlattr *key, size_t key_len,
-                    struct odp_flow_stats *stats)
+                    struct dpif_flow_stats *stats)
 {
     struct odp_flow odp_flow;
     int error;
@@ -531,7 +541,7 @@ dpif_linux_flow_del(struct dpif *dpif_,
     odp_flow.key_len = key_len;
     error = do_ioctl(dpif_, ODP_FLOW_DEL, &odp_flow);
     if (!error && stats) {
-        *stats = odp_flow.stats;
+        odp_flow_stats_to_dpif_flow_stats(&odp_flow.stats, stats);
     }
     return error;
 }
@@ -541,6 +551,7 @@ struct dpif_linux_flow_state {
     struct odp_flow flow;
     uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
     uint32_t actionsbuf[65536 / sizeof(uint32_t)];
+    struct dpif_flow_stats stats;
 };
 
 static int
@@ -559,7 +570,7 @@ static int
 dpif_linux_flow_dump_next(const struct dpif *dpif, void *state_,
                           const struct nlattr **key, size_t *key_len,
                           const struct nlattr **actions, size_t *actions_len,
-                          const struct odp_flow_stats **stats)
+                          const struct dpif_flow_stats **stats)
 {
     struct dpif_linux_flow_state *state = state_;
     int error;
@@ -586,7 +597,9 @@ dpif_linux_flow_dump_next(const struct dpif *dpif, void *state_,
             *actions_len = state->flow.actions_len;
         }
         if (stats) {
-            *stats = &state->flow.stats;
+            odp_flow_stats_to_dpif_flow_stats(&state->flow.stats,
+                                              &state->stats);
+            *stats = &state->stats;
         }
     }
     return error;
index 80b890f..9272ef7 100644 (file)
@@ -111,7 +111,7 @@ struct dp_netdev_flow {
     struct flow key;
 
     /* Statistics. */
-    struct timespec used;       /* Last used time. */
+    long long int used;         /* Last used time, in monotonic msecs. */
     long long int packet_count; /* Number of packets matched. */
     long long int byte_count;   /* Number of bytes matched. */
     uint16_t tcp_ctl;           /* Bitwise-OR of seen tcp_ctl values. */
@@ -621,14 +621,12 @@ dp_netdev_lookup_flow(const struct dp_netdev *dp, const struct flow *key)
 }
 
 static void
-get_odp_flow_stats(struct dp_netdev_flow *flow, struct odp_flow_stats *stats)
+get_dpif_flow_stats(struct dp_netdev_flow *flow, struct dpif_flow_stats *stats)
 {
     stats->n_packets = flow->packet_count;
     stats->n_bytes = flow->byte_count;
-    stats->used_sec = flow->used.tv_sec;
-    stats->used_nsec = flow->used.tv_nsec;
+    stats->used = flow->used;
     stats->tcp_flags = TCP_FLAGS(flow->tcp_ctl);
-    stats->reserved = 0;
 }
 
 static int
@@ -660,7 +658,7 @@ dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len,
 static int
 dpif_netdev_flow_get(const struct dpif *dpif, int flags,
                      const struct nlattr *nl_key, size_t nl_key_len,
-                     struct ofpbuf **actionsp, struct odp_flow_stats *stats)
+                     struct ofpbuf **actionsp, struct dpif_flow_stats *stats)
 {
     struct dp_netdev *dp = get_dp_netdev(dpif);
     struct dp_netdev_flow *flow;
@@ -678,7 +676,7 @@ dpif_netdev_flow_get(const struct dpif *dpif, int flags,
     }
 
     if (stats) {
-        get_odp_flow_stats(flow, stats);
+        get_dpif_flow_stats(flow, stats);
     }
     if (actionsp) {
         *actionsp = ofpbuf_clone_data(flow->actions, flow->actions_len);
@@ -792,8 +790,7 @@ add_flow(struct dpif *dpif, const struct flow *key,
 static void
 clear_stats(struct dp_netdev_flow *flow)
 {
-    flow->used.tv_sec = 0;
-    flow->used.tv_nsec = 0;
+    flow->used = 0;
     flow->packet_count = 0;
     flow->byte_count = 0;
     flow->tcp_ctl = 0;
@@ -803,7 +800,7 @@ static int
 dpif_netdev_flow_put(struct dpif *dpif, int flags,
                     const struct nlattr *nl_key, size_t nl_key_len,
                     const struct nlattr *actions, size_t actions_len,
-                    struct odp_flow_stats *stats)
+                    struct dpif_flow_stats *stats)
 {
     struct dp_netdev *dp = get_dp_netdev(dpif);
     struct dp_netdev_flow *flow;
@@ -834,7 +831,7 @@ dpif_netdev_flow_put(struct dpif *dpif, int flags,
             int error = set_flow_actions(flow, actions, actions_len);
             if (!error) {
                 if (stats) {
-                    get_odp_flow_stats(flow, stats);
+                    get_dpif_flow_stats(flow, stats);
                 }
                 if (flags & ODPPF_ZERO_STATS) {
                     clear_stats(flow);
@@ -850,7 +847,7 @@ dpif_netdev_flow_put(struct dpif *dpif, int flags,
 static int
 dpif_netdev_flow_del(struct dpif *dpif,
                      const struct nlattr *nl_key, size_t nl_key_len,
-                     struct odp_flow_stats *stats)
+                     struct dpif_flow_stats *stats)
 {
     struct dp_netdev *dp = get_dp_netdev(dpif);
     struct dp_netdev_flow *flow;
@@ -865,7 +862,7 @@ dpif_netdev_flow_del(struct dpif *dpif,
     flow = dp_netdev_lookup_flow(dp, &key);
     if (flow) {
         if (stats) {
-            get_odp_flow_stats(flow, stats);
+            get_dpif_flow_stats(flow, stats);
         }
         dp_netdev_free_flow(dp, flow);
         return 0;
@@ -879,7 +876,7 @@ struct dp_netdev_flow_state {
     uint32_t offset;
     struct nlattr *actions;
     uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
-    struct odp_flow_stats stats;
+    struct dpif_flow_stats stats;
 };
 
 static int
@@ -898,7 +895,7 @@ static int
 dpif_netdev_flow_dump_next(const struct dpif *dpif, void *state_,
                            const struct nlattr **key, size_t *key_len,
                            const struct nlattr **actions, size_t *actions_len,
-                           const struct odp_flow_stats **stats)
+                           const struct dpif_flow_stats **stats)
 {
     struct dp_netdev_flow_state *state = state_;
     struct dp_netdev *dp = get_dp_netdev(dpif);
@@ -932,7 +929,7 @@ dpif_netdev_flow_dump_next(const struct dpif *dpif, void *state_,
     }
 
     if (stats) {
-        get_odp_flow_stats(flow, &state->stats);
+        get_dpif_flow_stats(flow, &state->stats);
         *stats = &state->stats;
     }
 
@@ -1064,7 +1061,7 @@ static void
 dp_netdev_flow_used(struct dp_netdev_flow *flow, struct flow *key,
                     const struct ofpbuf *packet)
 {
-    time_timespec(&flow->used);
+    flow->used = time_msec();
     flow->packet_count++;
     flow->byte_count += packet->size;
     if (key->dl_type == htons(ETH_TYPE_IP) && key->nw_proto == IPPROTO_TCP) {
index bded290..639d8d5 100644 (file)
@@ -223,7 +223,7 @@ struct dpif_class {
      * flow's statistics. */
     int (*flow_get)(const struct dpif *dpif, int flags,
                     const struct nlattr *key, size_t key_len,
-                    struct ofpbuf **actionsp, struct odp_flow_stats *stats);
+                    struct ofpbuf **actionsp, struct dpif_flow_stats *stats);
 
     /* Adds or modifies a flow in 'dpif'.  The flow is specified by the Netlink
      * attributes with types ODP_KEY_ATTR_* in the 'key_len' bytes starting at
@@ -248,7 +248,7 @@ struct dpif_class {
     int (*flow_put)(struct dpif *dpif, int flags,
                     const struct nlattr *key, size_t key_len,
                     const struct nlattr *actions, size_t actions_len,
-                    struct odp_flow_stats *stats);
+                    struct dpif_flow_stats *stats);
 
     /* Deletes a flow from 'dpif' and returns 0, or returns ENOENT if 'dpif'
      * does not contain such a flow.  The flow is specified by the Netlink
@@ -259,7 +259,7 @@ struct dpif_class {
      * flow's statistics before its deletion. */
     int (*flow_del)(struct dpif *dpif,
                     const struct nlattr *key, size_t key_len,
-                    struct odp_flow_stats *stats);
+                    struct dpif_flow_stats *stats);
 
     /* Deletes all flows from 'dpif' and clears all of its queues of received
      * packets. */
@@ -292,7 +292,7 @@ struct dpif_class {
     int (*flow_dump_next)(const struct dpif *dpif, void *state,
                           const struct nlattr **key, size_t *key_len,
                           const struct nlattr **actions, size_t *actions_len,
-                          const struct odp_flow_stats **stats);
+                          const struct dpif_flow_stats **stats);
 
     /* Releases resources from 'dpif' for 'state', which was initialized by a
      * successful call to the 'flow_dump_start' function for 'dpif'.  */
index 487b60a..c225e2b 100644 (file)
@@ -37,6 +37,7 @@
 #include "poll-loop.h"
 #include "shash.h"
 #include "svec.h"
+#include "timeval.h"
 #include "util.h"
 #include "valgrind.h"
 #include "vlog.h"
@@ -79,7 +80,7 @@ static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(60, 5);
 static void log_flow_message(const struct dpif *dpif, int error,
                              const char *operation,
                              const struct nlattr *key, size_t key_len,
-                             const struct odp_flow_stats *stats,
+                             const struct dpif_flow_stats *stats,
                              const struct nlattr *actions, size_t actions_len);
 static void log_operation(const struct dpif *, const char *operation,
                           int error);
@@ -687,6 +688,20 @@ dpif_port_poll_wait(const struct dpif *dpif)
     dpif->dpif_class->port_poll_wait(dpif);
 }
 
+/* Appends a human-readable representation of 'stats' to 's'. */
+void
+dpif_flow_stats_format(const struct dpif_flow_stats *stats, struct ds *s)
+{
+    ds_put_format(s, "packets:%"PRIu64", bytes:%"PRIu64", used:",
+                  stats->n_packets, stats->n_bytes);
+    if (stats->used) {
+        ds_put_format(s, "%.3fs", (time_msec() - stats->used) / 1000.0);
+    } else {
+        ds_put_format(s, "never");
+    }
+    /* XXX tcp_flags? */
+}
+
 /* Deletes all flows from 'dpif'.  Returns 0 if successful, otherwise a
  * positive errno value.  */
 int
@@ -718,7 +733,7 @@ dpif_flow_flush(struct dpif *dpif)
 int
 dpif_flow_get(const struct dpif *dpif, int flags,
               const struct nlattr *key, size_t key_len,
-              struct ofpbuf **actionsp, struct odp_flow_stats *stats)
+              struct ofpbuf **actionsp, struct dpif_flow_stats *stats)
 {
     int error;
 
@@ -775,7 +790,7 @@ int
 dpif_flow_put(struct dpif *dpif, int flags,
               const struct nlattr *key, size_t key_len,
               const struct nlattr *actions, size_t actions_len,
-              struct odp_flow_stats *stats)
+              struct dpif_flow_stats *stats)
 {
     int error;
 
@@ -820,7 +835,7 @@ dpif_flow_put(struct dpif *dpif, int flags,
 int
 dpif_flow_del(struct dpif *dpif,
               const struct nlattr *key, size_t key_len,
-              struct odp_flow_stats *stats)
+              struct dpif_flow_stats *stats)
 {
     int error;
 
@@ -873,7 +888,7 @@ bool
 dpif_flow_dump_next(struct dpif_flow_dump *dump,
                     const struct nlattr **key, size_t *key_len,
                     const struct nlattr **actions, size_t *actions_len,
-                    const struct odp_flow_stats **stats)
+                    const struct dpif_flow_stats **stats)
 {
     const struct dpif *dpif = dump->dpif;
     int error = dump->error;
@@ -1169,7 +1184,7 @@ should_log_flow_message(int error)
 static void
 log_flow_message(const struct dpif *dpif, int error, const char *operation,
                  const struct nlattr *key, size_t key_len,
-                 const struct odp_flow_stats *stats,
+                 const struct dpif_flow_stats *stats,
                  const struct nlattr *actions, size_t actions_len)
 {
     struct ds ds = DS_EMPTY_INITIALIZER;
@@ -1184,7 +1199,7 @@ log_flow_message(const struct dpif *dpif, int error, const char *operation,
     odp_flow_key_format(key, key_len, &ds);
     if (stats) {
         ds_put_cstr(&ds, ", ");
-        format_odp_flow_stats(&ds, stats);
+        dpif_flow_stats_format(stats, &ds);
     }
     if (actions || actions_len) {
         ds_put_cstr(&ds, ", actions:");
index 22e3580..390cf67 100644 (file)
@@ -30,6 +30,7 @@ extern "C" {
 #endif
 
 struct dpif;
+struct ds;
 struct netdev;
 struct nlattr;
 struct ofpbuf;
@@ -107,17 +108,26 @@ int dpif_port_dump_done(struct dpif_port_dump *);
 int dpif_port_poll(const struct dpif *, char **devnamep);
 void dpif_port_poll_wait(const struct dpif *);
 
+struct dpif_flow_stats {
+    uint64_t n_packets;
+    uint64_t n_bytes;
+    long long int used;
+    uint8_t tcp_flags;
+};
+
+void dpif_flow_stats_format(const struct dpif_flow_stats *, struct ds *);
+
 int dpif_flow_flush(struct dpif *);
 int dpif_flow_put(struct dpif *, int flags,
                   const struct nlattr *key, size_t key_len,
                   const struct nlattr *actions, size_t actions_len,
-                  struct odp_flow_stats *);
+                  struct dpif_flow_stats *);
 int dpif_flow_del(struct dpif *,
                   const struct nlattr *key, size_t key_len,
-                  struct odp_flow_stats *);
+                  struct dpif_flow_stats *);
 int dpif_flow_get(const struct dpif *, int flags,
                   const struct nlattr *key, size_t key_len,
-                  struct ofpbuf **actionsp, struct odp_flow_stats *);
+                  struct ofpbuf **actionsp, struct dpif_flow_stats *);
 
 struct dpif_flow_dump {
     const struct dpif *dpif;
@@ -128,7 +138,7 @@ void dpif_flow_dump_start(struct dpif_flow_dump *, const struct dpif *);
 bool dpif_flow_dump_next(struct dpif_flow_dump *,
                          const struct nlattr **key, size_t *key_len,
                          const struct nlattr **actions, size_t *actions_len,
-                         const struct odp_flow_stats **);
+                         const struct dpif_flow_stats **);
 int dpif_flow_dump_done(struct dpif_flow_dump *);
 
 int dpif_execute(struct dpif *, const struct nlattr *actions,
index 38dee7b..87ca0f2 100644 (file)
@@ -22,9 +22,9 @@
 #include <string.h>
 #include "byte-order.h"
 #include "coverage.h"
+#include "dpif.h"
 #include "dynamic-string.h"
 #include "hash.h"
-#include "ofp-util.h"
 #include "ofpbuf.h"
 #include "openflow/openflow.h"
 #include "openvswitch/datapath-protocol.h"
@@ -235,9 +235,9 @@ flow_extract(struct ofpbuf *packet, ovs_be64 tun_id, uint16_t in_port,
  */
 void
 flow_extract_stats(const struct flow *flow, struct ofpbuf *packet,
-        struct odp_flow_stats *stats)
+                   struct dpif_flow_stats *stats)
 {
-    memset(stats, '\0', sizeof(*stats));
+    memset(stats, 0, sizeof(*stats));
 
     if ((flow->dl_type == htons(ETH_TYPE_IP)) && packet->l4) {
         if ((flow->nw_proto == IP_TYPE_TCP) && packet->l7) {
index 06da995..54f28d5 100644 (file)
@@ -27,6 +27,7 @@
 #include "openvswitch/datapath-protocol.h"
 #include "util.h"
 
+struct dpif_flow_stats;
 struct ds;
 struct flow_wildcards;
 struct ofp_match;
@@ -66,7 +67,7 @@ BUILD_ASSERT_DECL(sizeof(struct flow) == FLOW_SIG_SIZE + FLOW_PAD_SIZE);
 int flow_extract(struct ofpbuf *, uint64_t tun_id, uint16_t in_port,
                  struct flow *);
 void flow_extract_stats(const struct flow *flow, struct ofpbuf *packet,
-        struct odp_flow_stats *stats);
+                        struct dpif_flow_stats *);
 char *flow_to_string(const struct flow *);
 void flow_format(struct ds *, const struct flow *);
 void flow_print(FILE *, const struct flow *);
index 60807ba..41acd6c 100644 (file)
@@ -177,20 +177,6 @@ format_odp_actions(struct ds *ds, const struct nlattr *actions,
         ds_put_cstr(ds, "drop");
     }
 }
-
-void
-format_odp_flow_stats(struct ds *ds, const struct odp_flow_stats *s)
-{
-    ds_put_format(ds, "packets:%llu, bytes:%llu, used:",
-                  (unsigned long long int) s->n_packets,
-                  (unsigned long long int) s->n_bytes);
-    if (s->used_sec) {
-        long long int used = s->used_sec * 1000 + s->used_nsec / 1000000;
-        ds_put_format(ds, "%.3fs", (time_msec() - used) / 1000.0);
-    } else {
-        ds_put_format(ds, "never");
-    }
-}
 \f
 /* Returns the correct length of the payload for a flow key attribute of the
  * specified 'type', or -1 if 'type' is unknown. */
index 2062c06..a7c0982 100644 (file)
@@ -60,7 +60,6 @@ int odp_action_len(uint16_t type);
 void format_odp_action(struct ds *, const struct nlattr *);
 void format_odp_actions(struct ds *, const struct nlattr *odp_actions,
                         size_t actions_len);
-void format_odp_flow_stats(struct ds *, const struct odp_flow_stats *);
 
 /* By my calculations currently the longest valid nlattr-formatted flow key is
  * 80 bytes long, so this leaves some safety margin.
index ab945b0..edd1cc2 100644 (file)
@@ -248,7 +248,7 @@ static void facet_flush_stats(struct ofproto *, struct facet *);
 static void facet_make_actions(struct ofproto *, struct facet *,
                                const struct ofpbuf *packet);
 static void facet_update_stats(struct ofproto *, struct facet *,
-                               const struct odp_flow_stats *);
+                               const struct dpif_flow_stats *);
 
 /* ofproto supports two kinds of OpenFlow connections:
  *
@@ -2135,7 +2135,7 @@ static void
 facet_execute(struct ofproto *ofproto, struct facet *facet,
               struct ofpbuf *packet)
 {
-    struct odp_flow_stats stats;
+    struct dpif_flow_stats stats;
 
     assert(ofpbuf_headroom(packet) >= sizeof(struct ofp_packet_in));
 
@@ -2360,7 +2360,7 @@ facet_uninstall(struct ofproto *p, struct facet *facet)
 {
     if (facet->installed) {
         uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
-        struct odp_flow_stats stats;
+        struct dpif_flow_stats stats;
         struct ofpbuf key;
 
         ofpbuf_use_stack(&key, keybuf, sizeof keybuf);
@@ -2500,7 +2500,7 @@ facet_revalidate(struct ofproto *ofproto, struct facet *facet)
     if (actions_changed || facet->may_install != facet->installed) {
         if (facet->may_install) {
             uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
-            struct odp_flow_stats stats;
+            struct dpif_flow_stats stats;
             struct ofpbuf key;
 
             ofpbuf_use_stack(&key, keybuf, sizeof keybuf);
@@ -3476,7 +3476,7 @@ query_stats(struct ofproto *p, struct rule *rule,
      * to a rule. */
     ofpbuf_use_stack(&key, keybuf, sizeof keybuf);
     LIST_FOR_EACH (facet, list_node, &rule->facets) {
-        struct odp_flow_stats stats;
+        struct dpif_flow_stats stats;
 
         ofpbuf_clear(&key);
         odp_flow_key_from_flow(&key, &facet->flow);
@@ -3854,17 +3854,11 @@ handle_queue_stats_request(struct ofconn *ofconn, const struct ofp_header *oh)
     return 0;
 }
 
-static long long int
-msec_from_nsec(uint64_t sec, uint32_t nsec)
-{
-    return !sec ? 0 : sec * 1000 + nsec / 1000000;
-}
-
 static void
 facet_update_time(struct ofproto *ofproto, struct facet *facet,
-                  const struct odp_flow_stats *stats)
+                  const struct dpif_flow_stats *stats)
 {
-    long long int used = msec_from_nsec(stats->used_sec, stats->used_nsec);
+    long long int used = stats->used;
     if (used > facet->used) {
         facet->used = used;
         if (used > facet->rule->used) {
@@ -3882,7 +3876,7 @@ facet_update_time(struct ofproto *ofproto, struct facet *facet,
  * cleared out of the datapath. */
 static void
 facet_update_stats(struct ofproto *ofproto, struct facet *facet,
-                   const struct odp_flow_stats *stats)
+                   const struct dpif_flow_stats *stats)
 {
     if (stats->n_packets) {
         facet_update_time(ofproto, facet, stats);
@@ -4518,7 +4512,7 @@ ofproto_expire(struct ofproto *ofproto)
 static void
 ofproto_update_used(struct ofproto *p)
 {
-    const struct odp_flow_stats *stats;
+    const struct dpif_flow_stats *stats;
     struct dpif_flow_dump dump;
     const struct nlattr *key;
     size_t key_len;
@@ -4663,7 +4657,7 @@ facet_active_timeout(struct ofproto *ofproto, struct facet *facet)
          * ofproto_update_used() zeroed TCP flags. */
         if (facet->installed) {
             uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
-            struct odp_flow_stats stats;
+            struct dpif_flow_stats stats;
             struct ofpbuf key;
 
             ofpbuf_use_stack(&key, keybuf, sizeof keybuf);
index 3167864..f79909a 100644 (file)
@@ -480,7 +480,7 @@ do_dump_dps(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 static void
 do_dump_flows(int argc OVS_UNUSED, char *argv[])
 {
-    const struct odp_flow_stats *stats;
+    const struct dpif_flow_stats *stats;
     const struct nlattr *actions;
     struct dpif_flow_dump dump;
     const struct nlattr *key;
@@ -498,7 +498,7 @@ do_dump_flows(int argc OVS_UNUSED, char *argv[])
         ds_clear(&ds);
         odp_flow_key_format(key, key_len, &ds);
         ds_put_cstr(&ds, ", ");
-        format_odp_flow_stats(&ds, stats);
+        dpif_flow_stats_format(stats, &ds);
         ds_put_cstr(&ds, ", actions:");
         format_odp_actions(&ds, actions, actions_len);
         printf("%s\n", ds_cstr(&ds));