netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, alexanderduyck@fb.com
Subject: Re: [PATCH net-next 1/2] eth: fbnic: add basic rtnl stats
Date: Wed, 7 Aug 2024 09:38:37 -0700	[thread overview]
Message-ID: <20240807093837.6aaa6566@kernel.org> (raw)
In-Reply-To: <ZrOWM_F-BZRJEAAV@LQ3V64L9R2>

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

  reply	other threads:[~2024-08-07 16:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07  2:26 [PATCH net-next 0/2] eth: fbnic: add basic stats Jakub Kicinski
2024-08-07  2:26 ` [PATCH net-next 1/2] eth: fbnic: add basic rtnl stats Jakub Kicinski
2024-08-07 15:43   ` Joe Damato
2024-08-07 16:38     ` Jakub Kicinski [this message]
2024-08-08  8:34       ` Joe Damato
2024-08-07  2:26 ` [PATCH net-next 2/2] eth: fbnic: add support for basic qstats Jakub Kicinski
2024-08-07 15:45   ` Joe Damato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240807093837.6aaa6566@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexanderduyck@fb.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdamato@fastly.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).