mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: davem@davemloft.net, Michal Kubecek <mkubecek@suse.cz>
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, "Andrew Lunn" <andrew@lunn.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Köry Maincent" <kory.maincent@bootlin.com>,
	"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Marek Behún" <kabel@kernel.org>,
	"Piergiorgio Beruto" <piergiorgio.beruto@gmail.com>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Nicolò Veronese" <nicveronese@gmail.com>,
	"Simon Horman" <horms@kernel.org>
Subject: [PATCH ethtool-next 0/3] ethtool: Introduce PHY listing and targetting
Date: Wed,  3 Jan 2024 15:29:45 +0100	[thread overview]
Message-ID: <20240103142950.235888-1-maxime.chevallier@bootlin.com> (raw)

Hello everyone,

This series implements the ethtool part of the multi-PHY support that was
recently merged into net-next :

https://lore.kernel.org/netdev/20231221180047.1924733-1-maxime.chevallier@bootlin.com/

The series starts with a UAPI header copy (I don't really know if it's up
to me to do this, let me know if I should drop it).

The second patch adds the possibility of passing a PHY index for the
PSE-PD, PLCA and Cable-testing commands, in such a manner :

ethtool --phy 2 --cable-test eth0

The new '--phy' parameter is optional for PHY-targetting commands, if it's
not there, we use the old behaviour of relying on the PHY directly attached
to the netdevice to perform the command.

The parameter comes before the actual command to make it generic, after all
the PHY index is passed in the request header.

The Third patch adds a new ethtool option to display the PHYs present on
an interface, along with enough information to reconstruct the link topology.
As it relies on the netlink DUMP messages, some internal helpers were added
in ethtool to send DUMP requests that includes a devname in the header, to
perform a filtered dump. Here are a few examples of what you can expect on
an interface that has 2 PHYs (the 88x3310 PHY exposes an SFP bus, on which
a module that also contains a PHY is plugged)

# ethtool --show-phys eth0

PHY for eth0:
PHY index: 1
Driver name: mv88x3310
PHY device name: f212a600.mdio-mii:00
Downstream SFP bus name: sfp-eth0
PHY id: 0
Upstream type: MAC

PHY for eth0:
PHY index: 2
Driver name: Marvell 88E1111
PHY device name: i2c:sfp-eth0:16
PHY id: 21040322
Upstream type: PHY
Upstream PHY index: 1
Upstream SFP name: sfp-eth0

Here's another example using the wildcard devname, that lists all PHYs on
all interfaces :

# ethtool --show-phys *

PHY for eth0:
PHY index: 1
Driver name: mv88x3310
PHY device name: f212a600.mdio-mii:00
Downstream SFP bus name: sfp-eth0
PHY id: 0
Upstream type: MAC

PHY for eth0:
PHY index: 2
Driver name: Marvell 88E1111
PHY device name: i2c:sfp-eth0:16
PHY id: 21040322
Upstream type: PHY
Upstream PHY index: 1
Upstream SFP name: sfp-eth0

PHY for eth2:
PHY index: 1
Driver name: Marvell 88E1510
PHY device name: f212a200.mdio-mii:00
PHY id: 21040593
Upstream type: MAC

Thanks,

Maxime

Maxime Chevallier (3):
  update UAPI header copies
  ethtool: Allow passing a PHY index for phy-targetting commands
  ethtool: Introduce a command to list PHYs

 Makefile.am                  |   1 +
 ethtool.c                    |  30 +-
 internal.h                   |   1 +
 netlink/cable_test.c         |   4 +-
 netlink/extapi.h             |   1 +
 netlink/msgbuff.c            |  52 +++-
 netlink/msgbuff.h            |   3 +
 netlink/nlsock.c             |  25 ++
 netlink/nlsock.h             |   2 +
 netlink/phy.c                | 139 +++++++++
 netlink/plca.c               |   4 +-
 netlink/pse-pd.c             |   4 +-
 uapi/linux/ethtool.h         |  56 +++-
 uapi/linux/ethtool_netlink.h |  31 ++
 uapi/linux/if_link.h         | 529 +++++++++++++++++++++++++++++++++++
 uapi/linux/stddef.h          |   2 +-
 16 files changed, 851 insertions(+), 33 deletions(-)
 create mode 100644 netlink/phy.c

-- 
2.43.0


             reply	other threads:[~2024-01-03 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 14:29 Maxime Chevallier [this message]
2024-01-03 14:29 ` [PATCH ethtool-next 1/3] update UAPI header copies Maxime Chevallier
2024-01-03 14:29 ` [PATCH ethtool-next 2/3] ethtool: Allow passing a PHY index for phy-targetting commands Maxime Chevallier
2024-01-03 14:29 ` [PATCH ethtool-next 3/3] ethtool: Introduce a command to list PHYs Maxime Chevallier
2024-04-17 20:44 ` [PATCH ethtool-next 0/3] ethtool: Introduce PHY listing and targetting Michal Kubecek

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=20240103142950.235888-1-maxime.chevallier@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=christophe.leroy@csgroup.eu \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kabel@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=nicveronese@gmail.com \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=piergiorgio.beruto@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.oltean@nxp.com \
    /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

all inboxes | Powered by JetHome®