2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

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>
This commit is contained in:
Simon Horman
2011-08-04 08:04:10 +09:00
committed by Jesse Gross
parent 6da1e8091e
commit f180c2e2cc
4 changed files with 6 additions and 0 deletions

View File

@@ -302,6 +302,7 @@ 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->n_frags = dp->n_frags;
stats->n_hit = dp->n_hit;
stats->n_missed = dp->n_missed;