Re: [PATCH net-next 1/2] eth: fbnic: add basic rtnl stats

Jakub Kicinski
2024-08-07T16:38:39Z

On Wed, 7 Aug 2024 16:43:47 +0100 Joe Damato wrote:
> > +static void fbnic_aggregate_ring_rx_counters(struct fbnic_net *fbn,
> > + struct fbnic_ring *rxr)
> > +{
> > + struct fbnic_queue_stats *stats = &rxr->stats;
> > +
> > + if (!(rxr->flags & FBNIC_RING_F_STATS))
> > + return;
> > +
>
> Nit: I noticed this check is in both aggregate functions and just
> before where the functions are called below. I'm sure you have
> better folks internally to review this than me, but: maybe the extra
> flags check isn't necessary?
>
> Could be good if you are trying to be defensive, though.

Perils of upstreaming code that live out of tree for too long :(
These functions will also be called from the path which does runtime
ring changes (prepare/swap) and there the caller has no such check.

I'll drop it, and make a note to bring it back later.
--
pw-bot: cr