Article View: linux.kernel.netdev
Article #27276Re: [PATCH net-next v7 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 07:16
Date: Sat, 05 Dec 2026 07:16
119 lines
12909 bytes
12909 bytes
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
Technical Details
Message-ID:
<179645499746.3146.12562281651090174948@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377864-linux-kernel-netdev=dewy.ruReferences:
<20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377864-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179645499746.3146.12562281651090174948@kernel.org> References: <20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2974566"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:cJIDSTCBmz2qZtckeEy26ZMfWgk= sha256:5yRZ8Yyo3nRgY9cf8KowHPCsNSPsiSN3Ddyb4D8SEkk= sha1:mIvFhH3lJyOCWM3pd99E5ji2hRg= sha256:5m2+CpKjklKfMUuY1sVe1eEv8qOOoNvTjUGJEdgda5c= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A3D25117D92; Sat, 5 Dec 2026 10:16:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.542 X-Spam-Status: No, score=-3.542 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6SRSy7BCHlaW; Sat, 5 Dec 2026 10:16:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377864-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B2ACD117D8F; Sat, 5 Dec 2026 10:16:41 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 0062523E49; Sat, 5 Dec 2026 07:16:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796454999; b=TljukByt9juFiuSfyefb8eMUmkdNY6FnMs9y+5xCs3H/fUsyzX0Q0XHyNtV9iKWYJQ4Q uIARt/xlc7k/4wqO17Y3zeqQ6uu1sylpRMf8mZs820VhBh67d8kBYzvCx6KXkm7obUJ+M RKNN1AvB0cTQ4Zlmor3+XHKhZlMEsGKN7dMI+mlpv354d9n9M6YgzKfLjtmZx6Pe24aPF Wl7OfMu/35pqeyaF3zWLu2pPpK2NQ+L7lhgKKDtAUMOb4KGxE5Y2gI5TWRyY2chzCcN+U 3IkM2wSditJh6XbzM3B1wnB/PL5JwP4qqBp1SppwKss1xVqWG5ZO+XLeXnGH3WxtYJA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796454999; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=MR3CuLxAIO/z03KHkY0NpY8N66j+MQ+0F4CIreASHy8=; b=OPoJ1EjhaPcRdgoVPfsCTbeug1icdiSMdXE/unYI9eyT82WZ/QaUmJAEiAwhlX66xgQU ryUseT911h3EgXq8qXSDcW+cV95GkE6H2jTHPBO9Nyzt4R58l4oG/pb9cKUzYHgPtZR0A uGUoQsw9XN60+i+TZXlOwZscqycxLMihGOwcNA4s2TBXKLTxJ5TOUtULF7jiOqwLkUzP2 mf5qED2JBQ+PK+k6CJb7goeXzY9oae6VjhUgUFXnH8whY4DZd804G7Ygc2TFTTHwkzQ/N B1L8JhS0xJZ0KGp7LpXNtwAaM4Lqhs7jULCs0uY4nuH6OaTcYJzIwNUmt6rdiqGOBuA== X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB300606A335; Sat, 5 Dec 2026 07:16:39 +0000 (UTC) X-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 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-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== X-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== X-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 X-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 <netdev@vger.kernel.org>; Sat, 5 Dec 2026 07:16:38 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED5261F00A07; Sat, 5 Dec 2026 07:16:37 +0000 (UTC) X-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== X-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 X-In-Reply-To: <20261130-ionic-get-fec-stats-v7-3-730c1672f561@amd.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list