Article View: linux.kernel.netdev
Article #20710Re: [PATCH net-next v5 5/6] ionic: report the operational FEC mode from ethtool --show-fec
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 04:25
Date: Mon, 23 Nov 2026 04:25
89 lines
11275 bytes
11275 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] ionic_active_fec_type()
(drivers/net/ethernet/pensando/ionic/ionic_ethtool.c) returns…
--
ionic: report the operational FEC mode from ethtool --show-fec
This patch changes ionic_get_fecparam() so that, on an autoneg link,
active_fec is taken from status.fec_type (the mode firmware reports as
operational) and not from config.fec_type. With autoneg disabled it
still reports config.fec_type. The commit message expects firmware older
than c4e7a75a096c to leave status.fec_type zero, so that it reads as
FEC off.
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index c55148f3ae8fa..d406d090d0eb7 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -440,6 +440,18 @@ static u32 ionic_fec_type_to_ethtool(u8 fec_type)
> }
> }
>
> +/* Firmware that predates status.fec_type leaves it zero, which reads as
> + * FEC off. With autoneg disabled the port runs the configured mode, so
> + * only trust status.fec_type on an autoneg link.
> + */
> +static u8 ionic_active_fec_type(const struct ionic_port_info *port_info)
> +{
> + if (READ_ONCE(port_info->config.an_enable))
> + return READ_ONCE(port_info->status.fec_type);
[Severity: Low]
Is status.fec_type always zero on firmware that predates it? That seems
to hold only right after port_info is first allocated, because
dma_alloc_coherent() returns zeroed memory.
ionic_port_init() allocates port_info only when it is NULL. After that
the same buffer is reused:
drivers/net/ethernet/pensando/ionic/ionic_main.c:ionic_port_init() {
...
if (!idev->port_info) {
idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
idev->port_info = dma_alloc_coherent(ionic->dev,
...
stat = (__le64 *)&idev->port_info->extra_stats;
for (i = 0; i < sizeof(idev->port_info->extra_stats) / sizeof(*stat); i++)
WRITE_ONCE(stat[i], IONIC_STAT_INVALID);
...
}
The firmware reset recovery path runs port init again on that buffer:
ionic_lif_handle_fw_up()
ionic_port_identify()
ionic_port_init()
The extra_stats reset above guards against firmware that does not know
about newer fields. It does not clear status.fec_type, though.
Suppose firmware that fills status.fec_type (with RS, for example) is
running. A firmware reset then brings the device back on firmware older
than c4e7a75a096c, which treats that byte as reserved. Wouldn't
ethtool --show-fec on an autoneg link then report the stale RS value as
the active mode, even though the running firmware never reported it?
The later patch "ionic: Add .get_fec_stats ethtool handler" also uses
ionic_active_fec_type(). There it decides whether to report RS-FEC
stats, but it also requires IONIC_DEV_CAP_EXTRA_STATS. Nothing later in
the series clears status.fec_type.
Could ionic_port_init() zero status.fec_type before issuing PORT_INIT,
the same way extra_stats is reset?
> +
> + return READ_ONCE(port_info->config.fec_type);
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-ionic-get-fec-stats-v5-0-c9c0ee63df4c%40amd.com
Technical Details
Message-ID:
<179540795477.3135.12412117957020578861@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369026-linux-kernel-netdev=dewy.ruReferences:
<20261118-ionic-get-fec-stats-v5-5-c9c0ee63df4c@amd.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369026-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 5/6] ionic: report the operational FEC mode from ethtool --show-fec Date: Mon, 23 Nov 2026 04:25:54 +0000 Organization: Usenet Network Message-ID: <179540795477.3135.12412117957020578861@kernel.org> References: <20261118-ionic-get-fec-stats-v5-5-c9c0ee63df4c@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3789130"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:iAIXHtJBqzNr17GDX0m2DBLIWdo= sha256:SPGhRqX6k0S63IMsg3kgkv4e+fLwjh2USeGcfXG9NG4= sha1:bAnFF07OD47AT+JBwyWmzoSdwk0= sha256:2+yU+NuOK4EWePAOgB/Ev6XaKA6obyH3NdKmY70H2L8= 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 E49A9125D89; Mon, 23 Nov 2026 07:26:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 JJgdvwNYl9dO; Mon, 23 Nov 2026 07:26:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-369026-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 0525D125D8E; Mon, 23 Nov 2026 07:26:06 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id E1011237A6; Mon, 23 Nov 2026 04:26:00 +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=1795407957; b=OfgR1eKCsaDv+54IwNlvc+X99jpiCR5j2mzcQ2ApGSQgiQboPhhfInfO2rRKtYpNMXr1 trv+YrccpHZfX3tqgbp2U2Oa0ne/EFy1TUV0s1O6tjV5I5a9HAicNLCKYBYvVZlCtLZwF bArYBfRS4Nx6WVNrV+svkpNXQs01bM25NvYpdMn8WlC4uaiK8oUgHQq7JoAsxxSC8XDut uEEJLhmY8TeB8p15JtxLh4Ri1yTrZtFr/+7vpfKOfuJxZtffANjU+QL6sMLLRQC3V6fSC lPcpZQ0Vgwy0CGznIbeerJ4rELeeILT1rYFkPwTSYNlFdp9xTVQsiQsDw0IP41GuGtg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795407957; 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=yPMwhzLszo1U7FV0WMRTgvfzhUIK9NLJAj0AVKz+yEw=; b=qViDW+ew4JIS9ljUBv/ZeBmQsBZSe80gvLeBJzk8cTqMKIrRqimNLshwXedhSr7F2cmF 5zEZ85lcRPlrIUZ8n5HSYzx90uFz4UnC19+GuKiu4+dZICabgYBHcQBGUsM2gmoRfQ+Ji Bv9/pS94Ij181ypmO4+EL0bfsDJYG9WBP25lgf+86ZyotC0C/OJD1Am3ZfTk+ozVg5vvm axrrPDTjMz5b4WpAChfKv401wNCZfbYLhHua5mJ3tYXB1j9wXwG4dkQTZZJXHVLdPciEh cIeZfDHO0N05oThdB6k8rLfHN947odyMLWI8u1jk8FAXEQjDE/C+EImkTuTg19y+3lw== 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=k8ryaE6N; 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 420DE606A684; Mon, 23 Nov 2026 04:25:57 +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=k8ryaE6N 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=1795407956; b=PjXdrSy7h0lvv35ssLoNnK+DGIs0PcVm5Uh0qd0JSivWrYaXEEIkGUWW6ik9AtUWZOnb OYhHK+mStSnV22PWQo9aLkZq7PZtIkoDjCBIAK3+S/9A6/Tj4LIjZh1usR9rLJHPeGncP ibf37J/TDeflBZAO/JLKhzpt1zyawOgilnPHdQGbOe92hZWYwn+q5LfIcL6QzeeYjoYkt pZxDDpmVkGJP581s3Jiai1GiZ0zLWOL8CTaU+hreRx1dT4XkRm7sSD2S3IsjHzlqCQ6S9 xyXHJhv2hWaiQioj+msw8mVMYnu+sbxH67FHq7k6eL9zBhZkJ3pF2qBru/lYTDRUbBg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795407956; 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=yPMwhzLszo1U7FV0WMRTgvfzhUIK9NLJAj0AVKz+yEw=; b=bD5ofOji97wVDg0W8kJJbzRTBw/C832zTylRS7XinIxbaa3EpsqVKWZGxBPLgwoyx9au Xbfa0W5YBf1bY/3NpNIiJOoHyBKyhQrQlLDoftOV72u7tlSmirW6kib+kitZS7FVe+qwH Wsvp1x70j888rOxdApQaW8JfF+p9ZSrO8sjWBCBCKbM8vaJhAeSsCyJ/O+WunF7+H6u9g aLvcuPUnhPvuuRKgLVksF9QRkbJKF6tC4THiD4HYYnB14TVF2+NbonEJcSnefpb7efu1X ZqIbbEQr16Sp0aFWukIVIh1rALsoKVcrrofhYSvR63HijAUr270+RLVenoLW7nNmeYA== 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=k8ryaE6N; 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 63196606A33F for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 04:25:56 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D4041F000CF; Mon, 23 Nov 2026 04:25:55 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795407955; bh=yPMwhzLszo1U7FV0WMRTgvfzhUIK9NLJAj0AVKz+yEw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=k8ryaE6NJz8PMcIf4X8j4o9Ozrj8Bhb8Bfcm/zOAFFNsautAvNh+RoH7iFXa7rIKX 8gm9jfE+9q1XaajpVlR+fiYPumNUdBkeAsqh22g8IlE7PDjaX8qzDdGrDe5WVl9L28 kKNz2iWep6b1XCdGsfM09hQdftlZ7qtyjXS101rPoJvKB2MkOJ+2QmM08als7JKxIp BK67oCJrHCaEalBPYsgKEwyAdJbcaJJdgbNKvQtiAuUaurcKUu5sDDDCGa4B7+lAWh GwSSp7m8JXjmvkrHk6bMtxOVHNCPhkCKPeWm5HwcEcZqs2v1KA4ijr4Fcoiq+mAxzM ri7eYUuZHrZVw== 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: <20261118-ionic-get-fec-stats-v5-5-c9c0ee63df4c@amd.com> X-sashiko-severity: Low 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