[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJ-K82U8mSNW_NGQtzKr70weHrWiFqnBEj-ehhWRHveFg@mail.gmail.com>
Date: Fri, 6 Sep 2024 14:47:15 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Guillaume Nault <gnault@...hat.com>
Cc: Jakub Kicinski <kuba@...nel.org>, David Miller <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Martin Varghese <martin.varghese@...ia.com>, Willem de Bruijn <willemb@...gle.com>,
David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH net] bareudp: Fix device stats updates.
On Fri, Sep 6, 2024 at 12:42 PM Guillaume Nault <gnault@...hat.com> wrote:
>
> On Wed, Sep 04, 2024 at 02:48:39PM -0700, Jakub Kicinski wrote:
> > On Wed, 4 Sep 2024 19:54:40 +0200 Guillaume Nault wrote:
> > > In this context, I feel that dstats is now just a mix of tstats and
> > > core_stats.
> >
> > I don't know the full background but:
> >
> > * @core_stats: core networking counters,
> > * do not use this in drivers
>
> Hum, I didn't realise that :/.
>
> I'd really like to understand why drivers shouldn't use core_stats.
>
> I mean, what makes driver and core networking counters so different
> that they need to be handled in two different ways (but finally merged
> together when exporting stats to user space)?
>
> Does that prevent any contention on the counters or optimise cache line
> access? I can't see how, so I'm probably missing something important
> here.
Some archeology might help.
Before we had tracing, having separate fields could help for diagnostics.
commit caf586e5f23cebb2a68cbaf288d59dbbf2d74052
Author: Eric Dumazet <eric.dumazet@...il.com>
Date: Thu Sep 30 21:06:55 2010 +0000
net: add a core netdev->rx_dropped counter
In various situations, a device provides a packet to our stack and we
drop it before it enters protocol stack :
- softnet backlog full (accounted in /proc/net/softnet_stat)
- bad vlan tag (not accounted)
- unknown/unregistered protocol (not accounted)
We can handle a per-device counter of such dropped frames at core level,
and automatically adds it to the device provided stats (rx_dropped), so
that standard tools can be used (ifconfig, ip link, cat /proc/net/dev)
This is a generalization of commit 8990f468a (net: rx_dropped
accounting), thus reverting it.
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Powered by blists - more mailing lists