Re: [PATCH net-next v4 8/8] virtio-net: support queue stat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Mar 2024 15:56:16 -0700, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> 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.                  ^^^^^^^^^^^^^^^^^^^^^^^^
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I see.

Thanks.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux