datapath: Drop flow information from odp_stats.
authorBen Pfaff <blp@nicira.com>
Wed, 5 Jan 2011 00:43:50 +0000 (16:43 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Jan 2011 05:08:38 +0000 (21:08 -0800)
Userspace used to use the n_flows information here to decide how much
memory needed to be allocated to list flows, but that isn't necessary any
longer now that listing flows uses an iterator abstraction.  The
cur_capacity and max_capacity members are just curiosities and don't
provide much information; if the implementation ever changes away from
the current hash table implementation then they could become meaningless
anyhow.

But more than anything, these aren't really the kind of statistics that
networking people usually care about.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
include/openvswitch/datapath-protocol.h
lib/dpif-netdev.c
utilities/ovs-dpctl.c

index ffa22e2..3d32cd4 100644 (file)
@@ -1199,13 +1199,9 @@ static int execute_packet(struct datapath *dp, const struct odp_execute __user *
 
 static int get_dp_stats(struct datapath *dp, struct odp_stats __user *statsp)
 {
-       struct tbl *table = get_table_protected(dp);
        struct odp_stats stats;
        int i;
 
-       stats.n_flows = tbl_count(table);
-       stats.cur_capacity = tbl_n_buckets(table);
-       stats.max_capacity = TBL_MAX_BUCKETS;
        stats.n_ports = dp->n_ports;
        stats.max_ports = DP_MAX_PORTS;
        stats.n_frags = stats.n_hit = stats.n_missed = stats.n_lost = 0;
index 4a2afb2..36f1bc1 100644 (file)
 #define ODP_SET_SFLOW_PROBABILITY _IOR('O', 19, int)
 #define ODP_GET_SFLOW_PROBABILITY _IOW('O', 20, int)
 
-
 struct odp_stats {
-    /* Flows. */
-    uint32_t n_flows;           /* Number of flows in flow table. */
-    uint32_t cur_capacity;      /* Current flow table capacity. */
-    uint32_t max_capacity;      /* Maximum expansion of flow table capacity. */
-
     /* Ports. */
     uint32_t n_ports;           /* Current number of ports. */
     uint32_t max_ports;         /* Maximum supported number of ports. */
index 37ac501..d17b82b 100644 (file)
@@ -297,9 +297,6 @@ dpif_netdev_get_stats(const struct dpif *dpif, struct odp_stats *stats)
 {
     struct dp_netdev *dp = get_dp_netdev(dpif);
     memset(stats, 0, sizeof *stats);
-    stats->n_flows = hmap_count(&dp->flow_table);
-    stats->cur_capacity = hmap_capacity(&dp->flow_table);
-    stats->max_capacity = MAX_FLOWS;
     stats->n_ports = dp->n_ports;
     stats->max_ports = MAX_PORTS;
     stats->n_frags = dp->n_frags;
index 4c1f2da..2e2197e 100644 (file)
@@ -338,9 +338,6 @@ show_dpif(struct dpif *dpif)
 
     printf("%s:\n", dpif_name(dpif));
     if (!dpif_get_dp_stats(dpif, &stats)) {
-        printf("\tflows: cur:%"PRIu32", soft-max:%"PRIu32", "
-               "hard-max:%"PRIu32"\n",
-               stats.n_flows, stats.cur_capacity, stats.max_capacity);
         printf("\tports: cur:%"PRIu32", max:%"PRIu32"\n",
                stats.n_ports, stats.max_ports);
         printf("\tlookups: frags:%llu, hit:%llu, missed:%llu, lost:%llu\n",