From: Jakub Kicinski <kuba@kernel.org>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
pavan.chebbi@broadcom.com, przemyslaw.kitszel@intel.com
Subject: Re: [PATCH net-next v2 7/9] eth: bnxt: maintain rx pkt/byte stats in SW
Date: Mon, 3 Mar 2025 14:32:14 -0800 [thread overview]
Message-ID: <20250303143214.7d6cd978@kernel.org> (raw)
In-Reply-To: <CACKFLikUqFVOkALJXX+_Tx=-hu=82u+ng4rnm7qgSHwiLr=gFw@mail.gmail.com>
On Sun, 2 Mar 2025 23:06:29 -0800 Michael Chan wrote:
> On Thu, Feb 27, 2025 at 5:25 PM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > Some workloads want to be able to track bandwidth utilization on
> > the scale of 10s of msecs. Updating all HW stats at this rate is
> > both hard and wasteful of PCIe bandwidth.
> >
> > Maintain basic Rx pkt/byte counters in software. ethtool -S will still
> > show the HW stats, but qstats and rtnl stats will show SW statistics.
> >
> > We need to take care of HW-GRO, XDP and VF representors. Per netdev
> > qstat definition Rx stats should reflect packets passed to XDP (if
> > active, otherwise to the stack). XDP and GRO do not interoperate
> > in bnxt, so we need to count the packets in a few places.
> > Add a helper and call it where needed.
> >
> > Do not count VF representor traffic as traffic for the main netdev.
> >
> > The stats are added towards the end of the struct since ethtool
> > code expects existing members to be first.
> >
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>
> The byte counting looks correct except for VLAN packets with the VLAN
> tag stripped. Do we want to count the 4 bytes for the VLAN tag?
Not 100% clear to me. I looked at nfp and a couple of Intel drivers
and if I read the code right they don't count VLAN tags if stripped.
I suspect that's what most drivers which count in SW will do, simply
because it's easier rather than intentional choice by their authors.
Happy to change if you have a preference, but to spell it out my
understanding is that not counting stripped tags was more comment
and that's what I intended to implement here.
next prev parent reply other threads:[~2025-03-03 22:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 1:25 [PATCH net-next v2 0/9] eth: bnxt: maintain basic pkt/byte counters in SW Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 1/9] eth: bnxt: use napi_consume_skb() Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 2/9] eth: bnxt: don't run xdp programs on fallback traffic Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 3/9] eth: bnxt: rename ring_err_stats -> ring_drv_stats Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 4/9] eth: bnxt: snapshot driver stats Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 5/9] eth: bnxt: don't use ifdef to check for CONFIG_INET in GRO Jakub Kicinski
2025-03-03 6:47 ` Michael Chan
2025-02-28 1:25 ` [PATCH net-next v2 6/9] eth: bnxt: consolidate the GRO-but-not-really paths in bnxt_gro_skb() Jakub Kicinski
2025-02-28 1:25 ` [PATCH net-next v2 7/9] eth: bnxt: maintain rx pkt/byte stats in SW Jakub Kicinski
2025-03-03 7:06 ` Michael Chan
2025-03-03 22:32 ` Jakub Kicinski [this message]
2025-03-03 22:38 ` Michael Chan
2025-03-04 22:33 ` Michael Chan
2025-02-28 1:25 ` [PATCH net-next v2 8/9] eth: bnxt: maintain tx " Jakub Kicinski
2025-03-03 7:08 ` Michael Chan
2025-02-28 1:25 ` [PATCH net-next v2 9/9] eth: bnxt: count xdp xmit packets Jakub Kicinski
2025-03-04 22:48 ` Michael Chan
2025-03-05 0:51 ` Jakub Kicinski
2025-02-28 11:51 ` [PATCH net-next v2 0/9] eth: bnxt: maintain basic pkt/byte counters in SW Przemek Kitszel
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=20250303143214.7d6cd978@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=przemyslaw.kitszel@intel.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).