From ea7bd5973fb426f3a6ea66b0953c6000980e77ec Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 4 Jan 2011 16:43:50 -0800 Subject: [PATCH] datapath: Drop flow information from odp_stats. 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 Acked-by: Jesse Gross --- datapath/datapath.c | 4 ---- include/openvswitch/datapath-protocol.h | 6 ------ lib/dpif-netdev.c | 3 --- utilities/ovs-dpctl.c | 3 --- 4 files changed, 16 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index ffa22e240..3d32cd47a 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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; diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 4a2afb2af..36f1bc160 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 37ac501e1..d17b82b69 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 4c1f2dac5..2e2197ed5 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", -- 2.43.0