From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796454999; b=3BKNBPvehV4k3ihIZp+pGfr9TVcl7aghX3sGpaYw8WfMg1tmLAAPp7ur7jox7cdsFRLf v+QgB7MLy4XungzOYfk96EYvyXtDwFnHxLZ8K17zaDJoYcLpZN1SEEQSyH2ePsCpCc0f7 nIqeqzigg7ZxUMl/OhA34Ox//Fl1jWA4fv82rRET3gh9+QMLWKes6+R+8jFb+3Z5L82uL eR421zvo78bp53Tg/y6tBAteWoQDySfoxqjZekLBGWGJTy+7yQT40ttJ5Vvu0C+Loywvh /grJeD1XDveVUAjdFdzLoRBuK3HOL135M2w01xEc1asRARe1B32l+SQa0Y4plO/JXbQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796454999; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=MR3CuLxAIO/z03KHkY0NpY8N66j+MQ+0F4CIreASHy8=; b=EcImvH+EXaJp/Ww5qnvLOgsLZ0GjiTHtFK3FoHcK9PpLWAekGDiPXsICnis/1Xy28FZ2 YilchZO0ryfMtwKg7ys5XSvWIEyXKK/W6RuuRWqQ9Syb1OYX0rijCIsGjCXj+HdLNIUBn x3aePKhqkHLsrgKxR24AfYzUAlArbbw3cahEo/ntYy3OZ5yVQbdCf8ouEsbGfNt2f5Nvk TJdRWBshIdHS+fjxxSkVjYUi6ZPMgAZ1eTOTxnVVcLJvb764vm6KuCUZ9xRGCJHlrPhP3 9hOnkptEJsbYULNnqRfAc9GxjinuOcP8uv9OoW6YW6GS7TIzuj5ZIo+LV6N4UCtBd0g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lNgBFIbk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA918606A322 for ; Sat, 5 Dec 2026 07:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lNgBFIbk Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED5261F00A07; Sat, 5 Dec 2026 07:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796454998; bh=MR3CuLxAIO/z03KHkY0NpY8N66j+MQ+0F4CIreASHy8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lNgBFIbk83KNfz2DqiFvqbO7tOz3J7VAQxw2dMQGp/EtGCnyRuUwQt4xtjfkqMTYn pwQVtS1psB8A5Vu1Cszds2Jlq7+DQxAq0lifKAZi3cctxEJ4GtUusRF4CSIowZQrog IVZJM/Tty4ckSm4mWCwBmiIJKmLnK7AWpyqgcIOHmZchRdhJ0oeB8/MYGD4V0nk7JH mPF4hdIa6/HnBbpb4a8zMdlybI5diRHMcUjcCloJdZm6QjM+3LlydVuJGN3v3ni55P PxfkIZt/NfRNcfzCKWnI+xouR8xb3AEVSI8Anm4CFpfvoyghv3jhuE5j8ZEb5noOh2 oriyURJRAQa/w== Subject: Re: [PATCH net-next v7 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec 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 Date: Sat, 05 Dec 2026 07:16:37 +0000 Message-ID: <179645499746.3146.12562281651090174948@kernel.org> In-Reply-To: <20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com> References: <20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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 " can show "Advertised FEC modes: RS" while "ethtool --show-fec " 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 " shows "Auto-negotiation: off" "ethtool --show-fec " 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