Article View: linux.kernel.netdev
Article #23874Re: [PATCH net-next v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec
From: Vadim Fedorenko
Date: Sat, 28 Nov 2026 13:27
Date: Sat, 28 Nov 2026 13:27
63 lines
11007 bytes
11007 bytes
On 25/11/2026 23:22, Brett Creeley wrote:
> From: "Nikhil P. Rao" <nikhil.rao@amd.com>
>
> ionic_get_fecparam() fills fec->active_fec from config.fec_type, the mode
> the host requested, which on an autoneg link is whatever was last
> programmed while the link negotiates something else. On an autoneg
> link, read it from status.fec_type, where firmware reports the
> operational mode.
>
> status.fec_type was carved out of the reserved area by commit
> c4e7a75a096c ("ionic: updates to ionic FW api description"), and
> firmware older than that leaves the byte zero, which reads as FEC off.
> With autoneg disabled the port runs the configured mode, so keep
> reporting config.fec_type there; only autoneg links on such old
> firmware report FEC off.
>
> Fixes: e95f922f4c2f ("ionic: implement ethtool set-fec")
> Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
> Signed-off-by: Eric Joyner <eric.joyner@amd.com>
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> ---
> drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 312cd3e5e404..3b6c436104d1 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -438,18 +438,29 @@ static u32 ionic_fec_type_to_ethtool(u8 fec_type)
> }
> }
>
> +static u8 ionic_active_fec_type(const struct ionic_port_info *port_info,
> + u8 config_fec_type)
> +{
> + if (READ_ONCE(port_info->config.an_enable))
> + return READ_ONCE(port_info->status.fec_type);
> +
> + return config_fec_type;
> +}
> +
> static int ionic_get_fecparam(struct net_device *netdev,
> struct ethtool_fecparam *fec)
> {
> struct ionic_port_info *port_info;
> struct ionic_lif *lif;
> u8 config_fec_type;
> + u8 active_fec_type;
>
> lif = netdev_priv(netdev);
> port_info = lif->ionic->idev.port_info;
> - config_fec_type = port_info->config.fec_type;
> + config_fec_type = READ_ONCE(port_info->config.fec_type);
> + active_fec_type = ionic_active_fec_type(port_info, config_fec_type);
>
> - fec->active_fec = ionic_fec_type_to_ethtool(config_fec_type);
> + fec->active_fec = ionic_fec_type_to_ethtool(active_fec_type);
> fec->fec = ionic_fec_type_to_ethtool(config_fec_type);
>
> return 0;
>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID:
<be432c81-2337-444f-94bd-bf7f9660f181@linux.dev>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-373130-linux-kernel-netdev=dewy.ruReferences:
<20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com> <20261125-ionic-get-fec-stats-v6-5-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-373130-linux-kernel-netdev=dewy.ru From: vadim.fedorenko@linux.dev (Vadim Fedorenko) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec Date: Sat, 28 Nov 2026 13:27:03 +0000 Organization: Usenet Network Message-ID: <be432c81-2337-444f-94bd-bf7f9660f181@linux.dev> References: <20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com> <20261125-ionic-get-fec-stats-v6-5-1ab49c729c00@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="954981"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:9+8AeADNKBXCqHhQfrEX1SIK5HE= sha256:vdqR0+2uC7LKx9L8hAZOZE1WSngAA1xQN5GB9ZstOLA= sha1:ZS0scBijKfpxYuWKEyq07t/VvlE= sha256:kB4cYMZaX/TWD1n5HjhQPnEUasy1lm8MilpqB1uBL6o= Content-Language: en-US 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 3F629125F7D; Sat, 28 Nov 2026 16:27:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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 (1024-bit key) header.d=linux.dev 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 a5Qt91pwH_XQ; Sat, 28 Nov 2026 16:27:18 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373130-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 0247B125F79; Sat, 28 Nov 2026 16:27:09 +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 8F4732CD4D; Sat, 28 Nov 2026 13:27:08 +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=1795872428; b=mGcwLGXjoTdV92aJdbeVcHPjdj2Anlr3t8iXzFGB9oc4E44niKHIAkQ8KB16N0Xut4V7 M8L6ujXDgTX0zJpyuyYBNUE5ujpNzFMmfTyxprMqH1F38a/hCWVX9NY51X/290qmpdhkm NR7DIjpi1oG2QIxU5oWgPKdncuSSs+mC/iq/6j80bzvETzmGKRbAxKKovXkZTQhlGLHmS J6oblGljEbwURke/78ULLmZKydvxq3DjIDPpFzbGw+PS9xGd+5IzXez0wO1LHjv+1MjFk Et+VjuR77RYFUQdhAKVsbpHjgRGFnRkmybhZRsB2l/0/kGHHDpG7FSlSrnpYWorWdxg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795872428; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=y1CGm0DOj0GrV1DZgqQfpNyHkCSRsdiW1lhCd+rjp0E=; b=nceZYXgINZ9s1BWDJ5cIkHeKEXEldEyai+vVyOLoh7FK5SVHy+WjuEpMGoEedyWPnNW7 oCwLwOQEXXiBD7CgaRP6Y62p87y6PbeJ/CtBDXQAxWOcDHLeZB51s0YGIxvKjsGB3vfDJ YA4GPXgvDxCYROs4e9rKv36rVXtg7wPTDfDY4v/q3/UUB1pKH87kR8IoMz5MejZSc3CkX pQULTgftO8S8wolQ+JYGaXnLKEUh6MdNbRzrcZ4UajIXprRR2UgBysXVZNDsNjDAWwvgh 1+vQNuJgDeyjeuyd61x2R2txJuLukPyljWQG/OolYtfFYuhM0mNvMGpodUv+XxjlN0A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=BaMYROqB; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 6714C606A326; Sat, 28 Nov 2026 13:27:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=BaMYROqB X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.215 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795872427; b=dG6lGIBJl6smjHJGXPm2yv5u9MqQ2Ygrmu/cPMzmisHPJFHRWlCMmbsuKCmlVXxU+flX kwlP91xiOCq/sQ1vCJAX5lZSQ63WC1k3q5pgsuhM15WF+KE63Zq1gW7nSOeGWhRPu16lM hVUZ1rATS6xgiuCgcQKDrnNITgWfPceIf9dN4ly6mWWY+lG19s/GLLiQOOPWU6++tFoWo vrlnNtPRqeR+IzIgMnErcG/3Xw1Uw4R+VWwcmvTVCMHS24dQFnpo2VsUbz1D1ayNBwMJw nFNcQGRY2j1grzHu4ChjQ1EHGdIzYTiO19FvfCoZK/52PtLLjbRGXp8v0ufGoqUllvA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795872427; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=y1CGm0DOj0GrV1DZgqQfpNyHkCSRsdiW1lhCd+rjp0E=; b=eJ5nOA2GPjVMlx/7u788QxG8Ci1v9snp/Zm2QMheu6HHd9wvloLXRmrpObDprmj4xeji SKKjBrADjXr+8ulEYe8t6YhxUSL3lqtU63+jy70yYmKt8gGyknVW30BdyNKoHvUzhNTbm GHs1M4Jgz4s5SL0Z5QGpAjrI3h2C/cEoJbaux0/gcD5MQx9cAbTdvxdfkLc2uF2fMAs/g uYj3KyksVsTTSTKl8zgmt5gLRK79r3p6PjboJoq99bww3iVhYSykvFDwQKJshfaDhJN5N mTLwUPZAHWP6qvRePErreOL97x1W8LG22hrADPeceU2U4CsrM4gAvjaasJY7hk0ddrg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=BaMYROqB; arc=none smtp.remote-ip=95.215.58.215 X-Received: from mta1.migadu.com (out-215.mta1.migadu.com [95.215.58.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9841F606A31F for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 13:27:06 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9841F606A31F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=afgMoV3K2lG+DKHagNQiFeDBZOjQZD1id38rykierGY=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795872424; v=1; x=1796477224; b=BaMYROqBNrDaQFHSd8gSHQvDoM+8mKoj9Jb1TJV3q7S/EgnZcZzES/gdOtY8b9X2AWfVkSuI urLHc/yRF853d8NPgMsRa+jDGK04ha0UIu3BXgzsHN+inehIZV6OIZWeKyh8Cc5+ZlY8PvkNgqc wxChMHSOou/hF5yIShd0ueKw= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id f673b9da5201df75; Sat, 28 Nov 2026 13:27:04 +0000 X-Mizu-Trace-ID: f673b9da5201df75 X-Migadu-Flow: FLOW_OUT 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 X-User-Agent: Mozilla Thunderbird X-Cc: netdev@vger.kernel.org, Simon Horman <horms@kernel.org>, "Nikhil P. Rao" <nikhil.rao@amd.com>, Eric Joyner <eric.joyner@amd.com>, Breno Leitao <leitao@debian.org>, Arun Kumar Prakash <ArunKumar.Prakash@amd.com> X-In-Reply-To: <20261125-ionic-get-fec-stats-v6-5-1ab49c729c00@amd.com>