[ovs-dev] [mega mask stats v3 1/2] datapath: collect mega flow mask stats

Jesse Gross jesse at nicira.com
Sat Oct 19 00:35:18 UTC 2013


On Fri, Oct 18, 2013 at 4:54 PM, Andy Zhou <azhou at nicira.com> wrote:
> Collect mega flow mask stats. ovs-dpctl show command can be used to
> display them.
>
> Signed-off-by: Andy Zhou <azhou at nicira.com>

I noticed a few things that I was originally planning on just
correcting but it was a little more than I usually would like to do.

> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index 9e6df12..4ac5fb8 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> -static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats)
> +static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats,
> +                        struct ovs_dp_megaflow_stats *mega_stats)
>  {
>         int i;
>
> +       memset(mega_stats, 0, sizeof(*mega_stats);

There's a compiler error here due to a missing parenthesis.

>         stats->n_flows = ovs_flow_tbl_count(&dp->table);
> +       mega_stats->n_masks = ovs_flow_tbl_num_masks(&dp->table);
>
>         stats->n_hit = stats->n_missed = stats->n_lost = 0;
> +       mega_stats->n_mask_hit = 0;

This probably isn't necessary any more since we zero out the whole struct.

> +struct ovs_dp_megaflow_stats {
> +       __u64 n_masks;           /* Number of masks for the datapath */
> +       __u32 n_mask_hit;        /* Number of masks used for flow lookups. */

Aren't the respective sizes of these two fields reversed?



More information about the dev mailing list