public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, cphealy@gmail.com,
	rmk+kernel@armlinux.org.uk,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2] net: phy: Maintain MDIO device and bus statistics
Date: Thu, 16 Jan 2020 00:19:24 +0100	[thread overview]
Message-ID: <20200115231924.GF2475@lunn.ch> (raw)
In-Reply-To: <20200115204228.26094-1-f.fainelli@gmail.com>

On Wed, Jan 15, 2020 at 12:42:20PM -0800, Florian Fainelli wrote:
> We maintain global statistics for an entire MDIO bus, as well as broken
> down, per MDIO bus address statistics. Given that it is possible for
> MDIO devices such as switches to access MDIO bus addressies for which
> there is not a mdio_device instance created (therefore not a a
> corresponding device directory in sysfs either), we also maintain
> per-address statistics under the statistics folder. The layout looks
> like this:
> 
> /sys/class/mdio_bus/../statistics/
> 	transfers
> 	errrors
> 	writes
> 	reads
> 	transfers_<addr>
> 	errors_<addr>
> 	writes_<addr>
> 	reads_<addr>
> 
> When a mdio_device instance is registered, a statistics/ folder is
> created with the tranfers, errors, writes and reads attributes which
> point to the appropriate MDIO bus statistics structure.
> 
> Statistics are 64-bit unsigned quantities and maintained through the
> u64_stats_sync.h helper functions.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v2:
> 
> - tracked per MDIO address statististics in separate attributes

Hi Florian

This is much better. Here is an MDIO bus with a Marvel MV88E6390

andrew@zii-devel-c-bidi:/sys/class/mdio_bus/0.1/statistics$ awk ' { print FILENAME " " $0  } ' transfers_? transfers_?? transfers
transfers_0 93
transfers_1 80
transfers_2 80
transfers_3 80
transfers_4 102
transfers_5 18
transfers_6 7
transfers_7 7
transfers_8 7
transfers_9 7
transfers_10 82
transfers_11 0
transfers_12 0
transfers_13 0
transfers_14 0
transfers_15 0
transfers_16 0
transfers_17 0
transfers_18 0
transfers_19 0
transfers_20 0
transfers_21 0
transfers_22 0
transfers_23 0
transfers_24 0
transfers_25 0
transfers_26 0
transfers_27 288
transfers_28 3328
transfers_29 0
transfers_30 0
transfers_31 0
transfers 4179

As you can see, there are transfers on a number of addresses.

I've not looked at the code yet, but i can give:

Tested-by: Andrew Lunn <andrew@lunn.ch>

I will review the code soon.

    Andrew

  reply	other threads:[~2020-01-15 23:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 20:42 [PATCH net-next v2] net: phy: Maintain MDIO device and bus statistics Florian Fainelli
2020-01-15 23:19 ` Andrew Lunn [this message]
2020-01-15 23:53 ` Andrew Lunn
2020-01-16  0:01   ` Florian Fainelli

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=20200115231924.GF2475@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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