All of lore.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, kuba@kernel.org,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: Maintain MDIO device and bus statistics
Date: Mon, 13 Jan 2020 19:29:05 +0100	[thread overview]
Message-ID: <20200113182905.GB26448@lunn.ch> (raw)
In-Reply-To: <ebeb2bb2-c816-6cb8-acaa-cfd86878678d@gmail.com>

> For MDIO switches you would usually have the mdio_device claim the
> pseudo PHY address and all other MDIO addresses should correspond to
> built-in PHYs, for which we also have mdio_device instances, is there a
> case that I am missing?

Marvell switches don't work like this. It varies from family to
family. The 6390 family for example has address 0x0-0xa representing
registers for ports 0 to 10, 32 registers per port. address 0x1b and
0x1c contain registers for global configuration. 0x1e is used to
communication with the internal MCU, and 0x1f is the TCAM. The
internal PHYs are not in this MDIO address space at all, there is
another MDIO bus, implemented by a couple of the global registers.

The 6352 has a different layout. 0x0-0x4 represent the internal
PHYs. 0xf is the SERDES for SGMII, 0x10-x016 are the port registers,
0x1b 0x1c are global.

There is one family, i don't remember which, which uses 16
addresses. And you can put two of them on one MDIO bus.

In each of these cases, we have one mdiodev, per switch, claiming a
single address, generally 0.

Other vendors switches are similar, using multiple addresses on one
bus.

> If the answer to my question above is that we still have reads to
> addresses for which we do not have mdio_device (which we might very well
> have), then we could either:
> 
> - create <mdio_bus>:<address>/statistics/ folders even for non-existent
> devices, but just to track the per-address statistics
> - create <mdio_bus>/<address>/statistics and when a mdio_device instance
> exists we symbolic link <mdio_bus>:<address>/statistics ->
> ../<mdio_bus>/<addr>/statistics
> 
> Would that work?

Keeping the statistics for all 32 addresses in the struct mii_bus
would be good. Then directories 0-31. And symlinks. Yes, that is good.

      Andrew

  reply	other threads:[~2020-01-13 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  4:53 [PATCH net-next] net: phy: Maintain MDIO device and bus statistics Florian Fainelli
2020-01-13  4:55 ` Florian Fainelli
2020-01-13 13:21 ` Andrew Lunn
2020-01-13 18:00   ` Florian Fainelli
2020-01-13 18:29     ` Andrew Lunn [this message]
2020-01-14  4:44 ` kbuild test robot
2020-01-14  4:44   ` kbuild test robot

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=20200113182905.GB26448@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.