From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: davem@davemloft.net
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Andrew Lunn" <andrew@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>,
"Oleksij Rempel" <linux@rempel-privat.de>,
"Nicolò Veronese" <nicveronese@gmail.com>,
thomas.petazzoni@bootlin.com,
"Christophe Leroy" <christophe.leroy@csgroup.eu>
Subject: [RFC PATCH net-next 7/7] netlink: specs: add command to show individual phy information
Date: Thu, 7 Sep 2023 11:24:05 +0200 [thread overview]
Message-ID: <20230907092407.647139-8-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20230907092407.647139-1-maxime.chevallier@bootlin.com>
With the ETHTOOL_CMD_PHY_LIST_GET command, we can obtain a list of PHYs
on a link, addressable through their phyindex. This index can be used to
issue PHY-specific commands. The phy_get command allows querying per-PHY
information. The information reported so-far is minimal (driver name,
phy id (for C22), upstream PHY type (real PHY, SFP phy), but we can
imagine extending this in the future to report PHY offloading
capabilities, status, and much more.
Example usage :
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-list-get --json '{"header" : {"dev-name" : "eth0"}}'
{'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-count': 2,
'phy-indices': b'\x02\x00\x00\x00\x01\x00\x00\x00'}
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-get \
--json '{"header" : {"dev-name" : "eth0"}, "phy-index" : 1}'
{'drvname': 'mv88x3310',
'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-id': 0,
'phy-index': 1,
'phy-upstream-type': 0}
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-get \
--json '{"header" : {"dev-name" : "eth0"}, "phy-index" : 2}'
{'drvname': 'Marvell 88E1111',
'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-id': 21040322,
'phy-index': 2,
'phy-upstream-type': 2}
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
Documentation/netlink/specs/ethtool.yaml | 37 ++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index 1139c88ed65c..708a77423286 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -955,6 +955,25 @@ attribute-sets:
-
name: phy-indices
type: binary
+ -
+ name: phy
+ attributes:
+ -
+ name: header
+ type: nest
+ nested-attributes: header
+ -
+ name: phy-index
+ type: u32
+ -
+ name: drvname
+ type: string
+ -
+ name: phy-upstream-type
+ type: u8
+ -
+ name: phy-id
+ type: u32
operations:
enum-model: directional
@@ -1720,3 +1739,21 @@ operations:
- header
- phy-count
- phy-indices
+ -
+ name: phy-get
+ doc: Get a PHY's information
+
+ attribute-set: phy
+
+ do: &phy-get-op
+ request:
+ attributes:
+ - header
+ - phy-index
+ reply:
+ attributes:
+ - header
+ - phy-index
+ - drvname
+ - phy-upstream-type
+ - phy-id
--
2.41.0
next prev parent reply other threads:[~2023-09-07 15:31 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 9:23 [RFC PATCH net-next 0/7] net: phy: introduce phy numbering Maxime Chevallier
2023-09-07 9:23 ` [RFC PATCH net-next 1/7] net: phy: introduce phy numbering and phy namespaces Maxime Chevallier
2023-09-07 9:32 ` Russell King (Oracle)
2023-09-07 10:14 ` Russell King (Oracle)
2023-09-07 12:19 ` Maxime Chevallier
2023-09-08 15:36 ` Jakub Kicinski
2023-09-11 13:05 ` Maxime Chevallier
2023-09-12 15:41 ` Andrew Lunn
2023-09-12 16:10 ` Maxime Chevallier
2023-09-12 17:08 ` Florian Fainelli
2023-09-12 16:15 ` Andrew Lunn
2023-09-12 17:01 ` Maxime Chevallier
2023-09-07 9:24 ` [RFC PATCH net-next 2/7] net: sfp: pass the phy_device when disconnecting an sfp module's PHY Maxime Chevallier
2023-09-07 9:24 ` [RFC PATCH net-next 3/7] net: phy: add helpers to handle sfp phy connect/disconnect Maxime Chevallier
2023-09-07 9:24 ` [RFC PATCH net-next 4/7] net: ethtool: add a netlink command to list PHYs Maxime Chevallier
2023-09-07 10:00 ` Russell King (Oracle)
2023-09-07 12:16 ` Maxime Chevallier
2023-09-12 16:01 ` Andrew Lunn
2023-09-12 16:29 ` Andrew Lunn
2023-09-07 9:24 ` [RFC PATCH net-next 5/7] netlink: specs: add phy_list command Maxime Chevallier
2023-09-07 9:24 ` [RFC PATCH net-next 6/7] net: ethtool: add a netlink command to get PHY information Maxime Chevallier
2023-09-07 10:04 ` Russell King (Oracle)
2023-09-07 12:20 ` Maxime Chevallier
2023-09-08 15:42 ` Jakub Kicinski
2023-09-08 15:46 ` Jakub Kicinski
2023-09-14 9:36 ` Maxime Chevallier
2023-10-03 13:55 ` Jakub Kicinski
2023-10-03 18:26 ` Andrew Lunn
2023-09-07 9:24 ` Maxime Chevallier [this message]
2023-09-08 15:41 ` [RFC PATCH net-next 0/7] net: phy: introduce phy numbering Jakub Kicinski
2023-09-11 13:09 ` Maxime Chevallier
2023-09-12 15:36 ` Andrew Lunn
2023-09-12 15:51 ` Maxime Chevallier
2023-09-14 10:06 ` Christophe Leroy
2023-09-14 12:47 ` Andrew Lunn
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=20230907092407.647139-8-maxime.chevallier@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew@lunn.ch \
--cc=christophe.leroy@csgroup.eu \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rempel-privat.de \
--cc=netdev@vger.kernel.org \
--cc=nicveronese@gmail.com \
--cc=pabeni@redhat.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®