๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23267

Re: [PATCH net-next v6 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec

#23267
From: netdev-bot+sashiko
Date: Thu, 26 Nov 2026 23:24
93 lines
11507 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

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] When port autoneg is on, ionic_get_fecparam() reports a stale
  manual setting as the port's configured FEC.

--

ionic: report the configured FEC mode in ethtool_fecparam.fec

ionic_get_fecparam() used to set fec->fec to the constant
ETHTOOL_FEC_OFF | ETHTOOL_FEC_RS | ETHTOOL_FEC_BASER. With this patch it
sets fec->fec from port_info->config.fec_type, so only the configured FEC
mode is reported. fec->active_fec is still derived from config.fec_type.

> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 16c6e4c9852e9..e7262a842eda4 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -432,17 +432,18 @@ static int ionic_get_fecparam(struct net_device *netdev,
>  	switch (lif->ionic->idev.port_info->config.fec_type) {
>  	case IONIC_PORT_FEC_TYPE_NONE:
>  		fec->active_fec = ETHTOOL_FEC_OFF;
> +		fec->fec = ETHTOOL_FEC_OFF;
>  		break;
>  	case IONIC_PORT_FEC_TYPE_RS:
>  		fec->active_fec = ETHTOOL_FEC_RS;
> +		fec->fec = ETHTOOL_FEC_RS;
>  		break;
>  	case IONIC_PORT_FEC_TYPE_FC:
>  		fec->active_fec = ETHTOOL_FEC_BASER;
> +		fec->fec = ETHTOOL_FEC_BASER;
>  		break;
>  	}

[Severity: Medium]
Can this report an old manual setting as the configured FEC when
autoneg is enabled on the port?

fec->fec now comes only from config.fec_type, and config.an_enable is
never checked. With autoneg on, ETHTOOL_GFECPARAM and
ETHTOOL_MSG_FEC_GET would show one fixed mode (for example "Configured
FEC encodings: RS"). That mode is whatever was last set by hand.
ETHTOOL_FEC_AUTO is never reported.

The uAPI kernel-doc for struct ethtool_fecparam says:

 * FEC settings are configured by link autonegotiation whenever it's enabled.

ionic_set_fecparam() also rejects FEC changes while autoneg is on:

	if (lif->ionic->idev.port_info->config.an_enable) {
		netdev_err(netdev, "FEC request not allowed while autoneg is enabled\n");
		return -EINVAL;
	}

Both suggest config.fec_type is not the policy in effect under autoneg.
The later patch in this series, "ionic: report the operational FEC mode
from ethtool --show-fec", describes config.fec_type on an autoneg link
as whatever was last programmed while the link negotiates something
else.

The problem still exists at the end of the series. There, active_fec
uses status.fec_type under autoneg through ionic_active_fec_type(), but
fec still has no autoneg check:

	fec->active_fec = ionic_fec_type_to_ethtool(active_fec_type);
	fec->fec = ionic_fec_type_to_ethtool(config_fec_type);

ionic_get_link_ksettings() does put config.fec_type into the advertised
FEC link modes. If firmware uses config.fec_type as the FEC request
during autoneg, reporting it here may be intended.

If it does not, should fec->fec report ETHTOOL_FEC_AUTO when
config.an_enable is set?

>  
> -	fec->fec = ETHTOOL_FEC_OFF | ETHTOOL_FEC_RS | ETHTOOL_FEC_BASER;
> -
>  	return 0;
>  }

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125-ionic-get-fec-stats-v6-0-1ab49c729c00%40amd.com
Technical Details
Message-ID: <179573548438.3135.12554044368884679854@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372384-linux-kernel-netdev=dewy.ru
References: <20261125-ionic-get-fec-stats-v6-3-1ab49c729c00@amd.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372384-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 3/6] ionic: report the configured FEC mode in
 ethtool_fecparam.fec
Date: Thu, 26 Nov 2026 23:24:44 +0000
Organization: Usenet Network
Message-ID: <179573548438.3135.12554044368884679854@kernel.org>
References: <20261125-ionic-get-fec-stats-v6-3-1ab49c729c00@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="592612"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:PtXHxwPwoha6uQxrYOVsA8mrM28= sha256:PFSKME3o334F5uqZ4Wi9UFLSgjg+62EzrWhtCeWLaQg=
	sha1:uvbU+Yzhu6P/ec+fdy6evSyvNIs= sha256:OkKN/DB0E/F/pEfDIWTNfFgT4ru3mefdPY+yP9f11fk=
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 F2A1C125F04; Fri, 27 Nov 2026 02:25:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 D6ilG1GyZcCj;
	Fri, 27 Nov 2026 02:24:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372384-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 03CA4125F0A; Fri, 27 Nov 2026 02:24:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id EE490273ED; Thu, 26 Nov 2026 23:24:46 +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=1795735486;
	b=TXwAoJDM4yHhySkvWSsnNMFBQQQm70FFv4KeOVP/H3YlDhRX+Dg2zVArDk5ZG1d+dUzT
	 13J67NE0L1NzIe+sg2BP0WSY1t+p8+hT/kxdnsr9barmCOd35TXqDqSs56QkTJCxeXNGG
	 TvEsrBxlV+hMpKWPaZBIhTBn4eNxvHwJ1inH1G6n6VKt1XOd0wOhEk2PGiJS8qFYYgH72
	 jvpdwtvN8Chq1shpJh4LXsHqoGVlJoBCp3tHFL62t/t6vmSg5WueCHcXM8hsW1VvLYx3c
	 fZY28bBxd5CK2pxO9ayCXY3o2BTWRPSLckWw1TLEbrxrUYhjIkcPICKb1Zbn6mc7bKg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795735486;
	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=eEGYTkLuhc4+m4ZcewXGcvSzNDfoHOOPlqXnrOyTzeY=;
	b=Apo4vAs0gOOCH6Kvg/qB4Ky3UUVFWa8H7mYE5x13BT7JO/E0dVTSpTqSbtfEJB8zDvqN
	 444gpguSTO2H9Ps1RkF4ZdBL/xm+ice1cLDYwiQ/3QiHR/5dMU3ZlR+Iog+mZzmjqdRAZ
	 /fpGiJfgMj4bWs+SkXzHGJukScPJaKQ+qmL6COEXcww/bZcbGWKr0ot3G82zqA2PL7/Kh
	 T2XCd+zpebpsi6cMtzQGHj+38WFGIW/xE8mykAEnqj7VlJa6qXtgkIPsAU8HAOplAg4jN
	 wNH8EFKn+x6I8xOc7CwXfPCmUhxS9550tfqIUfeffWEDWEF3oVq+f1UT8HrxO8SqqVg==
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=g3PHlLMh;
	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 B13B4606A327;
	Thu, 26 Nov 2026 23:24:46 +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=g3PHlLMh
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=1795735485;
	b=UUXX1C9s6CGOQE4VHkbBeK6r4/Kl+0e4Wmmt/PVFHTZcH2trOeyHdYm4Tbtm8JPnfd9T
	 bzetjuJ8Y/Uid8e7/7RmijIG05UszIo1SgstD8Btde6WIaXMgsDqw+6x+zoZ+drnAX90A
	 DdAuE8Qk8fWUla+uoYNdo9NQESerEGUtgGQ272ZUr7VTbsMOO2mXE4zMfomGHTOl/sG6a
	 437Lg71XmxuwqIlcwFiEFGeo0k7nfny/fnv5xkpJoVJ5jmfY+2kC6/xFmRk8jT9vNesa5
	 ioFkIJvphfORLwL1j3RJfL6q5egJ15EysugEnCGKQNC5MottImt7IjntxJJ8zCt4djg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795735485;
	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=eEGYTkLuhc4+m4ZcewXGcvSzNDfoHOOPlqXnrOyTzeY=;
	b=a6eJS73FtuMQMk1kGNAZUlPuyVC0w74GiaYoxb88NMZqTfAgeFnNjwWdhXNGO1fJ7te1
	 oONSMhwNxynFbfwJ/URxX2/QzOruXK4km+gavXCSD9I0lzjSsVSK6pwWpN1FDoS/bpOTD
	 LFjo9yWRIpKmKci1dU0yG+TxUgOtrQqyuwwy45kkvQB0PnQRMJgJtyaxNU5/BuqIZTTO0
	 LokqSE54eWJqPwO5Dsn+uyS5Ek6EScKDluKsq7IokLlwMB5S0VwyGpWalaSkeARltaJyG
	 kqafy5tRUsZE7NiYuEGnWAYllDIQB56S5oi00E4QVEF7Cgbcnhyu933iNkglXYCRRLg==
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=g3PHlLMh;
	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 D158E606A330
	for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 23:24:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2A1B1F00896;
	Thu, 26 Nov 2026 23:24:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795735485;
	bh=eEGYTkLuhc4+m4ZcewXGcvSzNDfoHOOPlqXnrOyTzeY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=g3PHlLMhMDbu7aJ6CSTjK3cozrhmehZGH7kXVhEukUMBvex5rab0U/cZBwtBN4AFw
	 7HlVyN0MMs3OrzSlWCsqm4MV8zQnIV9bljKAkL8Ji3XtgsepNTSVyVqsBn8cEUC/Ex
	 30tAM/n9+mWvtLvsHMeUZE50/B1TcfOSmk2Z8PqDPOe63gq1wvmL6fHFFL+7Ef9Ize
	 W2YLK3SxAZ9lJF9RveORsOR6N9JnOIopHetfOqQiwEyueoP3NEDwUCFCHl2UcyGLUj
	 JlTz8ugz+Yk/DmcnKj6TWDK7DHSXNtmxhlw9yrnSDWc3oP10Hi8BzQ0QlulrSXZ1Mc
	 XVwP/l9WYQeaw==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, sln@onemain.com, netdev@vger.kernel.org,
 horms@kernel.org, vadim.fedorenko@linux.dev, nikhil.rao@amd.com,
 eric.joyner@amd.com, leitao@debian.org, ArunKumar.Prakash@amd.com
X-In-Reply-To: <20261125-ionic-get-fec-stats-v6-3-1ab49c729c00@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