This looks good. I only have stylistic suggestions, see below. On Mon, Mar 11, 2013 at 02:07:39PM -0700, Andy Zhou wrote: > This is to fix the fallout of single datapath change. > ovs-appctl dpif/show displays per bridge miss, hit > and flow counts on the screen, but the backend is > obtaining those information from the datapath. > With a single datapath, all bridges of the same > datapath would all display the same (global) > counters maintained by the datapath, obviously > not correct. > > This patch fixes the bug by maintaining per ofproto_dpif > miss and hit counts, which are used for display output. > The number of flows count is obtained by counting the > number facets per ofproto. > > ovs-dpctl show still displays the counters maintain by > the datapath, as before. > > Bug# 15369.
"Bug #15369" is the usual form. > Signed-off-by: Andy Zhou <az...@nicira.com> > --- > ofproto/ofproto-dpif.c | 44 +++++++++++++++++++++++++++++++++++++------- > tests/ofproto-dpif.at | 14 +++++++++----- > tests/tunnel.at | 26 +++++++++++++------------- > 3 files changed, 59 insertions(+), 25 deletions(-) > > diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c > index ff93dc3..8648606 100644 > --- a/ofproto/ofproto-dpif.c > +++ b/ofproto/ofproto-dpif.c > @@ -661,6 +661,16 @@ static void drop_key_clear(struct dpif_backer *); > static struct ofport_dpif * > odp_port_to_ofport(const struct dpif_backer *, uint32_t odp_port); > > +/* > + * Per ofproto stats maintain by ofproto_dpif. s/maintain/maintained/ > + */ > +struct ofproto_dpif_stats { > + uint64_t n_hit; > + uint64_t n_missed; > +}; I'm not sure that I would introduce a new structure for this, unless you expect that it will start getting passed around more than it is. > +static void dpif_stats_update_hit_count(struct ofproto_dpif *ofproto, > + uint64_t delta); > + > struct ofproto_dpif { > struct hmap_node all_ofproto_dpifs_node; /* In 'all_ofproto_dpifs'. */ > struct ofproto up; > @@ -710,6 +720,9 @@ struct ofproto_dpif { > struct sset ghost_ports; /* Ports with no datapath port. */ > struct sset port_poll_set; /* Queued names for port_poll() reply. */ > int port_poll_errno; /* Last errno for port_poll() reply. */ > + > + /* Per ofproto's dpif Stats. */ Capitalizing "Stats" here looks odd to me. > + struct ofproto_dpif_stats dpif_stats; > }; Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev