On Thu, 14 Mar 2024 16:54:59 +0800 Xuan Zhuo wrote:
> +static void virtnet_get_base_stats(struct net_device *dev,
> +                                struct netdev_queue_stats_rx *rx,
> +                                struct netdev_queue_stats_tx *tx)
> +{
> +     /* The queue stats of the virtio-net will not be reset. So here we
> +      * return 0.
> +      */
> +     memset(rx, 0, sizeof(*rx));
> +     memset(tx, 0, sizeof(*tx));
> +}

/**
 * struct netdev_stat_ops - netdev ops for fine grained stats
 * @get_queue_stats_rx: get stats for a given Rx queue
 * @get_queue_stats_tx: get stats for a given Tx queue
 * @get_base_stats:     get base stats (not belonging to any live instance)
 *
 * Query stats for a given object. The values of the statistics are undefined
 * on entry (specifically they are *not* zero-initialized). Drivers should
 * assign values only to the statistics they collect. Statistics which are not
 * collected must be left undefined.                  ^^^^^^^^^^^^^^^^^^^^^^^^
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Reply via email to