lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Sep 2020 15:12:26 -0700
From:   David Awogbemila <awogbemila@...gle.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     netdev@...r.kernel.org, Kuo Zhao <kuozhao@...gle.com>,
        Yangchun Fu <yangchun@...gle.com>
Subject: Re: [PATCH net-next v3 5/9] gve: Add Gvnic stats AQ command and
 ethtool show/set-priv-flags.

On Tue, Sep 8, 2020 at 12:24 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Tue,  8 Sep 2020 11:39:05 -0700 David Awogbemila wrote:
> > +     /* Only one priv flag exists: report-stats (BIT(0))*/
> > +     if (flags & BIT(0))
> > +             new_flags |= BIT(0);
> > +     else
> > +             new_flags &= ~(BIT(0));
> > +     priv->ethtool_flags = new_flags;
> > +     /* update the stats when user turns report-stats on */
> > +     if (flags & BIT(0))
> > +             gve_handle_report_stats(priv);
> > +     /* zero off gve stats when report-stats turned off */
> > +     if (!(flags & BIT(0)) && (ori_flags & BIT(0))) {
> > +             int tx_stats_num = GVE_TX_STATS_REPORT_NUM *
> > +                     priv->tx_cfg.num_queues;
> > +             int rx_stats_num = GVE_RX_STATS_REPORT_NUM *
> > +                     priv->rx_cfg.num_queues;
> > +
> > +             memset(priv->stats_report->stats, 0, (tx_stats_num + rx_stats_num) *
> > +                                sizeof(struct stats));
> > +     }
>
> I don't understand why you don't cancel/start the timer when this flag
> is changed. Why waste the CPU cycles on handling a useless timer?
Thanks, I'll adjust this to turn the timer on/off when the flag is
turned on/off.

Powered by blists - more mailing lists