[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220415144202.64b6c3b4@fixe.home>
Date: Fri, 15 Apr 2022 14:42:02 +0200
From: Clément Léger <clement.leger@...tlin.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Herve Codina <herve.codina@...tlin.com>,
Miquèl Raynal <miquel.raynal@...tlin.com>,
Milan Stevanovic <milan.stevanovic@...com>,
Jimmy Lalande <jimmy.lalande@...com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 07/12] net: dsa: rzn1-a5psw: add statistics
support
Le Thu, 14 Apr 2022 20:34:44 +0300,
Vladimir Oltean <olteanv@...il.com> a écrit :
> On Thu, Apr 14, 2022 at 02:22:45PM +0200, Clément Léger wrote:
> > Add per-port statistics. This support requries to add a stat lock since
> > statistics are stored in two 32 bits registers, the hi part one being
> > global and latched when accessing the lo part.
> >
> > Signed-off-by: Clément Léger <clement.leger@...tlin.com>
> > ---
>
> I think for new drivers Jakub will also want to see the more specific
> and less free-form get_stats64, get_eth_mac_stats, get_eth_phy_stats,
> get_eth_ctrl_stats ops implemented. Your counters should map nicely over
> these.
Ok, I'll implement these callbacks !
>
> > drivers/net/dsa/rzn1_a5psw.c | 101 +++++++++++++++++++++++++++++++++++
> > drivers/net/dsa/rzn1_a5psw.h | 2 +
> > 2 files changed, 103 insertions(+)
> >
> > diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> > index 5bee999f7050..7ab7d9054427 100644
> > --- a/drivers/net/dsa/rzn1_a5psw.c
> > +++ b/drivers/net/dsa/rzn1_a5psw.c
> > @@ -16,6 +16,59 @@
> >
> > #include "rzn1_a5psw.h"
> >
> > +struct a5psw_stats {
> > + u16 offset;
> > + const char *name;
> > +};
> > +
> > +#define STAT_DESC(_offset, _name) {.offset = _offset, .name = _name}
> > +
> > +static const struct a5psw_stats a5psw_stats[] = {
> > + STAT_DESC(0x868, "aFrameTransmitted"),
> > + STAT_DESC(0x86C, "aFrameReceived"),
> > + STAT_DESC(0x870, "aFrameCheckSequenceErrors"),
> > + STAT_DESC(0x874, "aAlignmentErrors"),
> > + STAT_DESC(0x878, "aOctetsTransmitted"),
> > + STAT_DESC(0x87C, "aOctetsReceived"),
> > + STAT_DESC(0x880, "aTxPAUSEMACCtrlFrames"),
> > + STAT_DESC(0x884, "aRxPAUSEMACCtrlFrames"),
>
> What does the "a" stand for?
That's a mystery :/ I tried to be a normal person and copy/pasted these
from the datasheet ;)
--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com
Powered by blists - more mailing lists