From: netdev-bot+sashiko@kernel.org
To: eric.joyner@amd.com
Cc: netdev@vger.kernel.org, brett.creeley@amd.com,
andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, vadim.fedorenko@linux.dev,
nikhil.rao@amd.com, edumazet@kernel.org
Subject: Re: [PATCH net-next v7 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec
Date: Sat, 05 Dec 2026 07:16:37 +0000 [thread overview]
Message-ID: <179645499746.3146.12562281651090174948@kernel.org> (raw)
In-Reply-To: <20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In ionic_get_fecparam()
(drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:447-448), the…
- [Low] ionic_get_fecparam() now reports ETHTOOL_FEC_AUTO based only on
port_info->config.an_enable (ionic_ethtool.c:447-448).
--
ionic: report the configured FEC mode in ethtool_fecparam.fec
This commit changes ionic_get_fecparam() to report the configured FEC
mode from config.fec_type in fec->fec. Previously it reported the fixed
mask OFF | RS | BASER. When autoneg is enabled, it now reports
ETHTOOL_FEC_AUTO instead.
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index af16b0081e8cc..0627e4e171a8e 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -432,16 +432,20 @@ static int ionic_get_fecparam(struct net_device *netdev,
[ ... ]
> - fec->fec = ETHTOOL_FEC_OFF | ETHTOOL_FEC_RS | ETHTOOL_FEC_BASER;
> + if (lif->ionic->idev.port_info->config.an_enable)
> + fec->fec = ETHTOOL_FEC_AUTO;
[Severity: Medium]
Does ETHTOOL_FEC_AUTO match what the uAPI defines here? The commit message
says "With autoneg enabled, the FEC mode is selected by the link". The
uAPI definition in include/uapi/linux/ethtool.h, however, says:
* @ETHTOOL_FEC_AUTO_BIT: Select default/best FEC mode automatically, usually
* based link mode and SFP parameters read from module's
* EEPROM. This bit does _not_ mean autonegotiation.
The struct ethtool_fecparam documentation says that with autoneg on, FEC
comes from link autonegotiation and GFECPARAM reads the current mode. It
does not say the configured mode becomes AUTO.
The driver also ends up contradicting itself once an_enable is set. First,
ionic_set_fecparam() never accepts AUTO:
case ETHTOOL_FEC_AUTO:
default:
netdev_err(netdev, "FEC request 0x%04x not supported\n",
fec->fec);
return -EINVAL;
So GFECPARAM reports a configured mode that SFECPARAM always rejects.
Second, ionic_get_link_ksettings() still advertises exactly one concrete
FEC mode from config.fec_type, whatever an_enable is:
fec_type = READ_ONCE(idev->port_info->config.fec_type);
if (fec_type == IONIC_PORT_FEC_TYPE_NONE)
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);
else if (fec_type == IONIC_PORT_FEC_TYPE_FC)
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_BASER);
else if (fec_type == IONIC_PORT_FEC_TYPE_RS)
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
As a result, "ethtool <if>" can show "Advertised FEC modes: RS" while
"ethtool --show-fec <if>" shows "Configured FEC encodings: Auto".
This behaviour also carries through the rest of the series. In the final
state, ionic_get_fec_modes() still sets *fec = ETHTOOL_FEC_AUTO when
an_enable is set, ionic_set_fecparam() still rejects AUTO, and the
advertising logic is unchanged.
Because of the Fixes: tag, every autoneg-enabled ionic port on stable
kernels would change from "Off RS BaseR" to "Auto". Is that the intended
user-visible result, given how the uAPI defines the AUTO bit? If the
firmware does pick FEC from the link mode or module EEPROM, could the
commit message say so? And should ionic_set_fecparam() then accept AUTO?
[Severity: Low]
Could this disagree with what ionic_get_link_ksettings() reports for the
same port? That function reports autoneg only when a port type has been
detected:
if (ks->base.port != PORT_NONE) {
...
if (idev->port_info->config.an_enable) {
ethtool_link_ksettings_add_link_mode(ks, advertising,
Autoneg);
ks->base.autoneg = AUTONEG_ENABLE;
}
}
When no transceiver is present, ks->base.port is PORT_NONE. That happens
when status.xcvr.phy is neither copper nor fiber and copper_seen is false.
With an_enable set in that state:
"ethtool <if>" shows "Auto-negotiation: off"
"ethtool --show-fec <if>" shows "Configured FEC encodings: Auto"
"ethtool --set-fec" fails with "FEC request not allowed while autoneg
is enabled"
Before this patch, get_fecparam never reported AUTO, so this mismatch is
new. ionic_get_fec_modes() later in the series keeps it, since it still
checks only READ_ONCE(config.an_enable) and nothing about whether a port
is present.
Should the AUTO report use the same condition as get_link_ksettings?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-ionic-get-fec-stats-v7-0-730c1672f561%40amd.com
next prev parent reply other threads:[~2026-12-05 7:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 6:48 [PATCH net-next v7 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner
2026-12-01 6:48 ` [PATCH net-next v7 1/6] ionic: access the extra_stats counters one at a time Eric Joyner
2026-12-01 6:48 ` [PATCH net-next v7 2/6] ionic: report FEC off as a supported link mode Eric Joyner
2026-12-01 6:48 ` [PATCH net-next v7 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec Eric Joyner
2026-12-02 13:45 ` Vadim Fedorenko
2026-12-05 7:16 ` netdev-bot+sashiko [this message]
2026-12-01 6:48 ` [PATCH net-next v7 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam() Eric Joyner
2026-12-02 13:49 ` Vadim Fedorenko
2026-12-01 6:48 ` [PATCH net-next v7 5/6] ionic: report the operational FEC mode from ethtool --show-fec Eric Joyner
2026-12-02 14:12 ` Vadim Fedorenko
2026-12-01 6:48 ` [PATCH net-next v7 6/6] ionic: Add .get_fec_stats ethtool handler Eric Joyner
2026-12-02 14:13 ` Vadim Fedorenko
2026-12-01 6:54 ` [PATCH net-next v7 0/6] ionic: FEC reporting fixes and .get_fec_stats handler netdev-bot+sinfo
2026-12-04 0:33 ` Eric Joyner
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=179645499746.3146.12562281651090174948@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eric.joyner@amd.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.