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?