[ovs-dev] [netlink v4 28/52] datapath: Drop flow information from odp_stats.

Ben Pfaff blp at nicira.com
Wed Jan 12 05:49:40 UTC 2011


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 at nicira.com>
---
 datapath/datapath.c                     |    4 ----
 include/openvswitch/datapath-protocol.h |    6 ------
 lib/dpif-netdev.c                       |    3 ---
 utilities/ovs-dpctl.c                   |    3 ---
 4 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index d9e6848..3195722 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1195,13 +1195,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;
diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h
index ae82531..52b8d60 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -99,13 +99,7 @@
 #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. */
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2f9a108..6dcaec2 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -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;
diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c
index 5d982d5..3092f89 100644
--- a/utilities/ovs-dpctl.c
+++ b/utilities/ovs-dpctl.c
@@ -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",
-- 
1.7.1





More information about the dev mailing list