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

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

 



On Wed, 24 Apr 2024 20:44:22 -0700, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> On Tue, 23 Apr 2024 19:31:41 +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.
> > +	 */
> > +	rx->bytes = 0;
> > +	rx->packets = 0;
> > +	rx->alloc_fail = 0;
> > +	rx->hw_drops = 0;
> > +	rx->hw_drop_overruns = 0;
> > +	rx->csum_unnecessary = 0;
> > +	rx->csum_none = 0;
> > +	rx->csum_bad = 0;
> > +	rx->hw_gro_packets = 0;
> > +	rx->hw_gro_bytes = 0;
> > +	rx->hw_gro_wire_packets = 0;
> > +	rx->hw_gro_wire_bytes = 0;
> > +	rx->hw_drop_ratelimits = 0;
> > +
> > +	tx->bytes = 0;
> > +	tx->packets = 0;
> > +	tx->hw_drops = 0;
> > +	tx->hw_drop_errors = 0;
> > +	tx->csum_none = 0;
> > +	tx->needs_csum = 0;
> > +	tx->hw_gso_packets = 0;
> > +	tx->hw_gso_bytes = 0;
> > +	tx->hw_gso_wire_packets = 0;
> > +	tx->hw_gso_wire_bytes = 0;
> > +	tx->hw_drop_ratelimits = 0;
>
> Doesn't this need to be conditional based on device capabilities?
> We should only assign the stats that the device is collecting
> (both in base stats and per-queue).


Will be fixed in next version.

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