diff options
author | Simon Horman <horms@verge.net.au> | 2011-08-04 08:04:10 +0900 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2011-08-03 21:38:03 -0700 |
commit | f180c2e2ccdfc36801685dc487748b570652da68 (patch) | |
tree | 3fa4fbabe71a75eb667c549277e5588c74b7e681 /datapath | |
parent | 6da1e8091eb2e19de7ba5e0c73ac3e7dd437743d (diff) |
ovs-dpctl: Show number of flows
Expose the number of flows present in a datapath to user-space
and to users via ovs-dpctl show.
e.g.:
ovs-dpctl show br3
system@br3:
lookups: frags:0, hit:0, missed:0, lost:0
flows: 0
...
Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: Add same logic to userspace datapath.]
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath')
-rw-r--r-- | datapath/datapath.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c index 3ec5be4e..b1912397 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -747,6 +747,9 @@ static struct genl_ops dp_packet_genl_ops[] = { static void get_dp_stats(struct datapath *dp, struct odp_stats *stats) { int i; + struct tbl *table = get_table_protected(dp); + + stats->n_flows = tbl_count(table); stats->n_frags = stats->n_hit = stats->n_missed = stats->n_lost = 0; for_each_possible_cpu(i) { |