Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring

From: Jakub Kicinski

Date: Tue Oct 20 2026 - 17:51:00 EST


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.

> > > If the interface goes down and frees all its queues, then the stats are
> > > gone, true. But preserving them at the price of two (down+up) forced RCU
> > > grace period, I don't know. It looks like a bit too much.
> >
> > This is a modern driver, the down / up path is not taken when interface
> > is reconfigured. It's only taken when the interface is actually taken
> > down or bought up. Which virtually never happens for a datacenter NIC.
>
> 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.