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/2026…%40amd.com