Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

Jakub Kicinski
2024-04-04T13:53:47Z

On Thu, 04 Apr 2024 15:40:33 +0200 Paolo Abeni wrote:
> > + nsim_get_stats64(dev, &rtstats);
> > +
> > + stats->packets = rtstats.tx_packets - !!rtstats.tx_packets;
> > + stats->bytes = rtstats.tx_bytes;
>
> It looks the stats will not be self-consistent with multiple queues
> enabled.
>
> What about zeroing 'stats' when idx > 0 ?

Ah, good catch. We do allow allocating multiple queues, even tho
we don't do anything with them on the driver side, yet..