From: netdev-bot+sashiko@kernel.org
To: maxime.chevallier@bootlin.com
Cc: davem@davemloft.net, andrew@lunn.ch, kuba@kernel.org,
edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk,
hkallweit1@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
christophe.leroy@csgroup.eu, herve.codina@bootlin.com,
f.fainelli@gmail.com, vladimir.oltean@nxp.com,
kory.maincent@bootlin.com, kabel@kernel.org,
o.rempel@pengutronix.de, nicveronese@gmail.com, horms@kernel.org,
mwojtas@chromium.org, romain.gantois@bootlin.com,
daniel@makrotopia.org, dimitri.fedrau@liebherr.com,
frank.wunderlich@linux.dev, p.ameruoso@live.it, f@lex.la,
chleroy@kernel.org
Subject: Re: [PATCH net-next v19 08/10] netlink: specs: Add ethernet port listing with ethtool
Date: Mon, 19 Oct 2026 13:33:11 +0000 [thread overview]
Message-ID: <179241679196.3135.12518377051542306291@kernel.org> (raw)
In-Reply-To: <20261016133107.54054-9-maxime.chevallier@bootlin.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Series-ordering note only, not a bug in the final series.
- [Low] The new uAPI enum port-type
(Documentation/netlink/specs/ethtool.yaml line 216, generated as enum…
--
netlink: specs: Add ethernet port listing with ethtool
This adds the YAML spec, the documentation and the generated uAPI header
definitions for a new ETHTOOL_MSG_PORT_GET command. The command reports
the front-facing ports tracked by the phy_port infrastructure. It defines
a new port-type enum (mdi, sfp) and a port attribute set with id,
supported modes, supported interfaces, type and upstream port.
> diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
> index a66594ad9e739..a9cb025387830 100644
> --- a/Documentation/netlink/specs/ethtool.yaml
> +++ b/Documentation/netlink/specs/ethtool.yaml
> @@ -212,6 +212,11 @@ definitions:
> -
> name: discard
> value: 31
> + -
> + name: port-type
> + doc: type of physical connector
> + type: enum
> + entries: [mdi, sfp]
[Severity: Low]
Could the meaning of this enum be spelled out more clearly? The doc
string "type of physical connector" is close to what
ETHTOOL_A_LINKINFO_PORT already carries with the legacy PORT_* values
(PORT_TP, PORT_FIBRE, PORT_OTHER, ...).
The existing phy_port_get_type() helper also uses the "port type" name,
but it returns PORT_* values:
drivers/net/phy/phy_port.c:phy_port_get_type() {
if (port->mediums & BIT(ETHTOOL_LINK_MEDIUM_BASET))
return PORT_TP;
...
}
So ETHTOOL_PORT_TYPE_MDI and PORT_TP are both 0, but they mean different
things. The PORT_GET section in ethtool-netlink.rst describes
ETHTOOL_A_PORT_TYPE only as "the port type". It does not name enum
ethtool_port_type or list the values.
The mdi and sfp entries also have no per-entry doc. Here is
port_fill_reply() in net/ethtool/port.c from the next patch in the
series:
port_type = ETHTOOL_PORT_TYPE_MDI;
if (reply->mii || reply->sfp)
port_type = ETHTOOL_PORT_TYPE_SFP;
With this code an SFP cage reports sfp. The port of an SFP module plugged
into that cage (upstream_port set, is_sfp not set) reports mdi.
These values become fixed uAPI once released. Would it make sense to
document what mdi and sfp mean in each of these cases, and to reference
the enum from the rst?
[ ... ]
> diff --git a/include/uapi/linux/ethtool_netlink_generated.h b/include/uapi/linux/ethtool_netlink_generated.h
> index 8134baf7860f3..660e0c08a766a 100644
> --- a/include/uapi/linux/ethtool_netlink_generated.h
> +++ b/include/uapi/linux/ethtool_netlink_generated.h
[ ... ]
> @@ -893,6 +913,7 @@ enum {
> ETHTOOL_MSG_RSS_CREATE_ACT,
> ETHTOOL_MSG_RSS_DELETE_ACT,
> ETHTOOL_MSG_MSE_GET,
> + ETHTOOL_MSG_PORT_GET,
>
> __ETHTOOL_MSG_USER_CNT,
> ETHTOOL_MSG_USER_MAX = (__ETHTOOL_MSG_USER_CNT - 1)
[Severity: Low]
This isn't a bug in the final series. At this commit, though, nothing
under net/ethtool/ handles ETHTOOL_MSG_PORT_GET: there is no policy, no
ethnl_default_requests entry and no genl op. A request therefore fails
with -EOPNOTSUPP. Meanwhile, the new PORT_GET section in
ethtool-netlink.rst already describes working DO and DUMP behaviour.
The next patch, "net: ethtool: Introduce ethtool command to list ports",
adds net/ethtool/port.c with ethnl_port_request_ops, ethnl_port_dumpit()
and ethnl_port_get_policy. It also registers ETHTOOL_MSG_PORT_GET in
net/ethtool/netlink.c, so the gap is closed by the end of the series.
Is this intermediate state intended? Splitting the spec from the
implementation is common netdev practice, so this is only a note.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016133107.54054-1-maxime.chevallier%40bootlin.com
next prev parent reply other threads:[~2026-10-19 13:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 13:30 [PATCH net-next v19 00/10] net: phy_port: SFP modules representation and phy_port listing Maxime Chevallier
2026-10-16 13:30 ` [PATCH net-next v19 01/10] net: phy: phy_link_topology: Add a helper for opportunistic alloc Maxime Chevallier
2026-10-16 13:30 ` [PATCH net-next v19 02/10] net: phy: phy_link_topology: Track ports in phy_link_topology Maxime Chevallier
2026-10-19 13:32 ` netdev-bot+sashiko
2026-10-16 13:30 ` [PATCH net-next v19 03/10] net: phylink: Register a phy_port for MAC-driven SFP cages Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:30 ` [PATCH net-next v19 04/10] net: phy: Create SFP phy_port before registering upstream Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:31 ` [PATCH net-next v19 05/10] net: phy: Represent PHY-less SFP modules with phy_port Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:31 ` [PATCH net-next v19 06/10] net: phy: phy_port: Store information about a port's upstream Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:31 ` [PATCH net-next v19 07/10] net: phy: phy_link_topology: Add a helper to retrieve ports Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:31 ` [PATCH net-next v19 08/10] netlink: specs: Add ethernet port listing with ethtool Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko [this message]
2026-10-16 13:31 ` [PATCH net-next v19 09/10] net: ethtool: Introduce ethtool command to list ports Maxime Chevallier
2026-10-19 13:33 ` netdev-bot+sashiko
2026-10-16 13:31 ` [PATCH net-next v19 10/10] Documentation: networking: Update the phy_port infrastructure description Maxime Chevallier
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=179241679196.3135.12518377051542306291@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=chleroy@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dimitri.fedrau@liebherr.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=f@lex.la \
--cc=frank.wunderlich@linux.dev \
--cc=herve.codina@bootlin.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kabel@kernel.org \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=mwojtas@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=nicveronese@gmail.com \
--cc=o.rempel@pengutronix.de \
--cc=p.ameruoso@live.it \
--cc=pabeni@redhat.com \
--cc=romain.gantois@bootlin.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®