mbox series

[net-next,0/5] Export SERDES stats via ethtool -S

Message ID 1514988562-20079-1-git-send-email-andrew@lunn.ch
Headers show
Series Export SERDES stats via ethtool -S | expand

Message

Andrew Lunn Jan. 3, 2018, 2:09 p.m. UTC
The mv88e6352 family has a SERDES interface which can be used for
example to connect to SFF/SFP modules. This interface has a couple of
statistics counters. Add support for including these counters in the
output of ethtool -S.

Andrew Lunn (5):
  dsa: Pass the port to get_sset_count()
  net: dsa: mv88e6xxx: Hold mutex while doing stats operations
  net: dsa: mv88e6xxx: Allow the SERDES interfaces to have statistics
  net: dsa: mv88e6xxx: Add helper to determining if port has SERDES
  net: dsa: mv88e6xxx: Get mv88e6352 SERDES statistics

 drivers/net/dsa/b53/b53_common.c       |   2 +-
 drivers/net/dsa/b53/b53_priv.h         |   2 +-
 drivers/net/dsa/dsa_loop.c             |   2 +-
 drivers/net/dsa/lan9303-core.c         |   2 +-
 drivers/net/dsa/microchip/ksz_common.c |   2 +-
 drivers/net/dsa/mt7530.c               |   2 +-
 drivers/net/dsa/mv88e6xxx/chip.c       |  94 +++++++++++++++++++++--------
 drivers/net/dsa/mv88e6xxx/chip.h       |  20 ++++++-
 drivers/net/dsa/mv88e6xxx/serdes.c     | 106 +++++++++++++++++++++++++++++++--
 drivers/net/dsa/mv88e6xxx/serdes.h     |   6 +-
 drivers/net/dsa/qca8k.c                |   2 +-
 include/net/dsa.h                      |   2 +-
 net/dsa/master.c                       |   4 +-
 net/dsa/slave.c                        |   2 +-
 14 files changed, 204 insertions(+), 44 deletions(-)

Comments

Russell King (Oracle) Jan. 3, 2018, 5:58 p.m. UTC | #1
On Wed, Jan 03, 2018 at 03:09:17PM +0100, Andrew Lunn wrote:
> The mv88e6352 family has a SERDES interface which can be used for
> example to connect to SFF/SFP modules. This interface has a couple of
> statistics counters. Add support for including these counters in the
> output of ethtool -S.

Hi Andrew,

Isn't the serdes interface just a normal PHY - the register set in
Viviens debugfs patch certainly looks like an 88e1545 in one of the
switches I've here (I think on the dev rev B).  Is there a reason why
this PHY isn't visible as a normal PHY, just like we export the other
internal PHYs?
Andrew Lunn Jan. 4, 2018, 9:07 p.m. UTC | #2
> Hi Andrew,
> 
> Isn't the serdes interface just a normal PHY - the register set in
> Viviens debugfs patch certainly looks like an 88e1545 in one of the
> switches I've here (I think on the dev rev B).  Is there a reason why
> this PHY isn't visible as a normal PHY, just like we export the other
> internal PHYs?

Humm, interesting idea. Yes, it looks like a normal PHY. It is however
not contiguous to the internal PHYs on the 6352. You probably can
however see it, if you look on the MDIO bus, at address 0xf.

Depends on what mode the ports are in, the SERDES can be connected to
either port 4 or 5. Port 5 does not have an internal PHY, but port 4
does. We could determine what port is using the SERDES, and redirect
PHY read/writes to the SERDES interface. But it gets a bit complex for
port 4, since it can use either copper or SERDES depending on which
comes up first. So suppose you need to be able to see both the copper
PHY and the SERDES, so you can initialize them both, in order for one
to actually come up.

   Andrew