From: "Daniel Zahka" <daniel.zahka@gmail.com>
To: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Jakub Kicinski" <kuba@kernel.org>
Cc: "Daniel Zahka" <daniel.zahka@gmail.com>,
"Alexander Duyck" <alexanderduyck@fb.com>, <kernel-team@meta.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Paolo Abeni" <pabeni@redhat.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Eric Dumazet" <edumazet@kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring
Date: Mon, 26 Oct 2026 07:06:07 -0400 [thread overview]
Message-ID: <DMEPZAAH894H.2LX47UFLJTCQW@gmail.com> (raw)
In-Reply-To: <20261026101117.YTmp0eu2@linutronix.de>
On Mon Oct 26, 2026 at 6:11 AM EDT, Sebastian Andrzej Siewior wrote:
> On 2026-10-20 14:50:38 [-0700], Jakub Kicinski wrote:
>> On Tue, 20 Oct 2026 23:21:55 +0200 Sebastian Andrzej Siewior wrote:
>> > > > Is there any other driver doing this?
>> > > > There is ::get_sset_count() and so on for the per-queue stats.
>> > >
>> > > You may be mixing up queue stats (netlink) with the old ethtool -S
>> > > kitchen sink / garbage dump.
>> >
>> > The statistics is folded on device-down into a global counter. So on
>> > device-up the statistics is still available. At least that is my
>> > understanding. This means the per-queue stats are lost and global stats
>> > don't match the per queue stats anymore.
>>
>> Yes, that's intentional and recommended by the docs for queue stats.
>
> I guess this is Documentation/networking/statistics.rst that I need to
> study.
>
>> > So if this never happens, it might not be needed to preserve this. That
>> > force-RCU might not be needed. This does happen on down and I would
>> > assume that the device is no longer processing packets.
>>
>> The (old) ndo for stats reading runs under RCU, only.
>> AI will immediately point that out if we remove the sync.
>>
>> May I ask why you care? Is there another driver you're trying
>> to implement stats in? I'm not sure where you're coming from
>> and therefore what to explain to you.
>
> I tried to be useful and do so some reviews and this stats part is what
> I did not expect to be "expected". I would expect per-queue stats which
> are folded into device stats on query time. Anyway. Let me study what is
> recommended before making noise here again.
> One last thing: If you replace RCU with SRCU then the logic should
> remain the same. On the plus side you would have some domain separation
> and the "synchronize" part will not force/ wait for the global grace
> period but be limited to the local one.
>
> Sebastian
I do appreciate the review. Thanks for the SRCU suggestion. I hadn't
considered that. Optimizing the writer side performance will become more
important when we implement ethtool ringparam/channel reconfiguration.
Another idea we had was to heap allocate the base stats and use
call_rcu() to free instead. I decided against that for now, because I
thought it was more complicated, and the writer side is limted to just
ndo_open/ndo_stop for now.
next prev parent reply other threads:[~2026-10-26 11:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 12:04 [PATCH net-next v2 0/4] eth: mpnic: add basic netdev statistics Daniel Zahka
2026-10-12 12:04 ` [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring Daniel Zahka
2026-10-13 12:05 ` netdev-bot+sashiko
2026-10-13 12:10 ` Daniel Zahka
2026-10-16 22:09 ` Sebastian Andrzej Siewior
2026-10-19 13:04 ` Daniel Zahka
2026-10-19 21:54 ` Sebastian Andrzej Siewior
2026-10-20 2:05 ` Jakub Kicinski
2026-10-20 21:21 ` Sebastian Andrzej Siewior
2026-10-20 21:34 ` Daniel Zahka
2026-10-20 21:50 ` Jakub Kicinski
2026-10-26 10:11 ` Sebastian Andrzej Siewior
2026-10-26 11:06 ` Daniel Zahka [this message]
2026-10-21 8:26 ` Paolo Abeni
2026-10-26 10:13 ` Sebastian Andrzej Siewior
2026-10-12 12:04 ` [PATCH net-next v2 2/4] eth: mpnic: report per-queue stats Daniel Zahka
2026-10-13 12:05 ` netdev-bot+sashiko
2026-10-13 13:30 ` Daniel Zahka
2026-10-20 2:00 ` Jakub Kicinski
2026-10-12 12:04 ` [PATCH net-next v2 3/4] eth: mpnic: count Tx queue stops and wakes Daniel Zahka
2026-10-12 12:04 ` [PATCH net-next v2 4/4] eth: mpnic: count Rx allocation failures Daniel Zahka
2026-10-21 8:40 ` [PATCH net-next v2 0/4] eth: mpnic: add basic netdev statistics patchwork-bot+netdevbpf
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=DMEPZAAH894H.2LX47UFLJTCQW@gmail.com \
--to=daniel.zahka@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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