From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Simon Horman <horms@kernel.org>
Cc: edumazet@google.com, davem@davemloft.net, pabeni@redhat.com,
vladimir.oltean@nxp.com, daniel@makrotopia.org, kabel@kernel.org,
nicveronese@gmail.com, mwojtas@chromium.org,
romain.gantois@bootlin.com, herve.codina@bootlin.com,
netdev@vger.kernel.org, kuba@kernel.org,
dimitri.fedrau@liebherr.com, andrew@lunn.ch,
o.rempel@pengutronix.de, linux@armlinux.org.uk,
linux-kernel@vger.kernel.org, kory.maincent@bootlin.com,
hkallweit1@gmail.com, thomas.petazzoni@bootlin.com,
christophe.leroy@csgroup.eu, f.fainelli@gmail.com
Subject: Re: [net-next,v6,10/10] net: ethtool: Introduce ethtool command to list ports
Date: Fri, 6 Mar 2026 16:33:18 +0100 [thread overview]
Message-ID: <32aeef59-d8f3-4634-b365-06cc805eff3b@bootlin.com> (raw)
In-Reply-To: <20260306135854.492356-1-horms@kernel.org>
Hi
On 06/03/2026 14:58, Simon Horman wrote:
> This is an AI-generated review of your patch. The human sending this
> email has considered the AI review valid, or at least plausible.
>
> For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
> ---
> net: ethtool: Introduce ethtool command to list ports
>
> This commit introduces a new ethtool netlink command to expose phy_port
> information to userspace, allowing enumeration of available ports and
> their capabilities on a given interface.
>
>
>> +static int port_dump_one(struct sk_buff *skb, struct net_device *dev,
>> + struct netlink_callback *cb)
>> +{
>> + struct port_dump_ctx *ctx = port_dump_ctx_get(cb);
>> + void *ehdr;
>> + int ret;
>> +
>> + ehdr = ethnl_dump_put(skb, cb, ETHTOOL_A_PORT_HEADER);
>> + if (!ehdr)
>> + return -EMSGSIZE;
>
> Is ETHTOOL_A_PORT_HEADER the correct constant here?
>
> The third parameter to ethnl_dump_put() should be the genetlink command
> ID that gets stored in the message header's cmd field. Looking at other
> dump implementations in net/ethtool/:
>
> net/ethtool/tunnels.c:
> ehdr = ethnl_dump_put(skb, cb, ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY);
>
> net/ethtool/tsinfo.c:
> ehdr = ethnl_dump_put(skb, cb, ETHTOOL_MSG_TSINFO_GET_REPLY);
>
> net/ethtool/rss.c:
> ehdr = ethnl_dump_put(skb, cb, ETHTOOL_MSG_RSS_GET_REPLY);
>
> These all pass ETHTOOL_MSG_*_GET_REPLY command constants, not
> ETHTOOL_A_* attribute constants.
>
> ETHTOOL_A_PORT_HEADER is a netlink attribute with value 1 (from
> include/uapi/linux/ethtool_netlink.h). Meanwhile, this file's
> ethnl_port_request_ops structure correctly uses
> ETHTOOL_MSG_PORT_GET_REPLY for .reply_cmd, suggesting the same
> constant should be used here. Can this cause the wrong command ID
> to be sent in every dump response message?
hmmm true indeed, however ethtool did show me the replies. I'll fix that
though.
Thanks !
Maxime
prev parent reply other threads:[~2026-03-06 15:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 14:54 [PATCH net-next v6 00/10] net: phy_port: SFP modules representation and phy_port listing Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 01/10] net: phy: phy_link_topology: Add a helper for opportunistic alloc Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 02/10] net: phy: phy_link_topology: Track ports in phy_link_topology Maxime Chevallier
2026-03-06 14:09 ` [net-next,v6,02/10] " Simon Horman
2026-03-06 15:57 ` Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 03/10] net: phylink: Register a phy_port for MAC-driven SFP busses Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 04/10] net: phy: Create SFP phy_port before registering upstream Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 05/10] net: phy: Represent PHY-less SFP modules with phy_port Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 06/10] net: phylink: " Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 07/10] net: phy: phy_port: Store information about a MII port's vacant state Maxime Chevallier
2026-03-06 14:03 ` [net-next,v6,07/10] " Simon Horman
2026-03-06 15:50 ` Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 08/10] net: phy: phy_link_topology: Add a helper to retrieve ports Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 09/10] netlink: specs: Add ethernet port listing with ethtool Maxime Chevallier
2026-03-04 14:54 ` [PATCH net-next v6 10/10] net: ethtool: Introduce ethtool command to list ports Maxime Chevallier
2026-03-06 13:58 ` [net-next,v6,10/10] " Simon Horman
2026-03-06 15:33 ` Maxime Chevallier [this message]
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=32aeef59-d8f3-4634-b365-06cc805eff3b@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew@lunn.ch \
--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=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=mwojtas@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=nicveronese@gmail.com \
--cc=o.rempel@pengutronix.de \
--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