Article View: linux.kernel.netdev
Article #25821Re: [PATCH net-next v7 5/6] ionic: report the operational FEC mode from ethtool --show-fec
From: Vadim Fedorenko
Date: Wed, 02 Dec 2026 14:12
Date: Wed, 02 Dec 2026 14:12
79 lines
11498 bytes
11498 bytes
On 01/12/2026 06:48, Eric Joyner 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.
>
> Fill both fields in a new ionic_get_fec_modes(), which reads
> config.an_enable once so that fec and active_fec always describe the
> same autoneg state.
>
> 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>
> ---
> .../net/ethernet/pensando/ionic/ionic_ethtool.c | 31 +++++++++++++---------
> 1 file changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 9f0af298c8db..c25483134b93 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -438,22 +438,29 @@ static u32 ionic_fec_type_to_ethtool(u8 fec_type)
> }
> }
>
> +static void ionic_get_fec_modes(const struct ionic_port_info *port_info,
> + u32 *fec, u32 *active_fec)
> +{
> + u8 fec_type;
> +
> + if (READ_ONCE(port_info->config.an_enable)) {
> + *fec = ETHTOOL_FEC_AUTO;
> + fec_type = READ_ONCE(port_info->status.fec_type);
> + *active_fec = ionic_fec_type_to_ethtool(fec_type);
> + } else {
> + fec_type = READ_ONCE(port_info->config.fec_type);
> + *fec = ionic_fec_type_to_ethtool(fec_type);
> + *active_fec = *fec;
> + }
> +}
> +
> 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;
> -
> - lif = netdev_priv(netdev);
> - port_info = lif->ionic->idev.port_info;
> - config_fec_type = port_info->config.fec_type;
> + struct ionic_lif *lif = netdev_priv(netdev);
>
> - fec->active_fec = ionic_fec_type_to_ethtool(config_fec_type);
> - if (port_info->config.an_enable)
> - fec->fec = ETHTOOL_FEC_AUTO;
> - else
> - fec->fec = ionic_fec_type_to_ethtool(config_fec_type);
> + ionic_get_fec_modes(lif->ionic->idev.port_info, &fec->fec,
> + &fec->active_fec);
>
> return 0;
> }
>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID:
<38a22bbf-3494-4d2c-be35-fa45a48e6a69@linux.dev>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375838-linux-kernel-netdev=dewy.ruReferences:
<20261130-ionic-get-fec-stats-v7-0-730c1672f561@amd.com> <20261130-ionic-get-fec-stats-v7-5-730c1672f561@amd.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375838-linux-kernel-netdev=dewy.ru From: vadim.fedorenko@linux.dev (Vadim Fedorenko) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v7 5/6] ionic: report the operational FEC mode from ethtool --show-fec Date: Wed, 2 Dec 2026 14:12:13 +0000 Organization: Usenet Network Message-ID: <38a22bbf-3494-4d2c-be35-fa45a48e6a69@linux.dev> References: <20261130-ionic-get-fec-stats-v7-0-730c1672f561@amd.com> <20261130-ionic-get-fec-stats-v7-5-730c1672f561@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="1986588"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7l/dGwkCir3gdmoSH6otRSISjRg= sha256:j8vVEOCHR7cQsCLe6tiQcvceAiWsKK7U5jNXZHIWDlA= sha1:uLL1fNSRdhuON8pn/4Nd5aaFb18= sha256:VZUl+iZNRHiB5gSmRaHaFSjA/gcnxnhn/COuO57fxJs= 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 C69A311765F; Wed, 2 Dec 2026 17:12:37 +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 gCf5cH5gSnTx; Wed, 2 Dec 2026 17:12:34 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375838-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 44B97117650; Wed, 2 Dec 2026 17:12:25 +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 B40C32AFD9; Wed, 2 Dec 2026 14:12:22 +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=1796220742; b=4rCCufpPsu/zrLeJayC6eLc1xFBKQbGXNrYmlPrxwlLoX87hfru1oIgebwAgazK2Fp+8 xI6sQXVzIhaVkkEEkgd6msHE9/fNtbO/GWVyngqVeq/B9oenOvPuDbgGqQ5qHkS2GPx5i W3xOE8CyfqAjl8WytcrkxGqfZK6EfoQn7WYoyPtinN80guEEQWCWMNXStHXb0F0PflSCm fSOqBq6KjyfSdtoPRKw7Loqz6lyxGoUxv5rHCm1g/nb4KbWFA7KxqSBTzU39A/gsKlyL4 kkckULoXWH7J2ZvM2hTqS29B2e2jZlxYerzM47Wiw16Q6XEeLtyXq0hs0wnADKyRbMw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220742; 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=9HsXQItqD1DEUcZhuwV0JOqZtMOBczrrUbCkW5DPri4=; b=3vwIwwYxTvWonkbeh7mAnCy963Mwii4RgK8ak6LqBfzeLky9JxQGFjcSwNwhAKlFrpd9 XOQKc5LuOsa0aeYA+Z62xiHJhMxTSov/gmseeRjkFrvLS8pk3i37sqyDPRWdAWHC7BbMv pknxQS/ZK55gJNxG+IyQLh2toZ7yTnlEls9mvc885+XuctRjww/Bqcl6gHlqVvQsPmpTB BrK/LD5N5FnqUyFUMAMjvSiproPIehyOf3DPJ99vAsERwMspwj9HHFhXNbiOH9QbD2ni4 YLsA8O+WcARxBWdPdighnodp+ILWlcL5c8b5GQNuuf+Y/p8g9q09/dwe0ME1iULE+6A== 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="e/XltaLx"; 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 88413606A32A; Wed, 2 Dec 2026 14:12:22 +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=e/XltaLx X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.130 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220741; b=YWJEwmNNGKdf5wIEXkpo4yzvhJydg5XmXhrLoDpA+5BOWtdwSMs6fnPbAdNBw6ROcvZU NDHsxyZmO3yNTzUdV9pSbea9x6IDuZU7aINF6gmk8AFDsi62igr9t4WXoiydbIdM6ZI4o 9b+G9Eq+bYEacgZX1RVqz6gQBXxeXzdzJ2/hiWmGN2V9pVmK97RfsnFsUT5gvS9uUSABx GnU+jCEjK6CAC4QuY7V23lquhUv1uec9qrsVvnkP71Za8Zr7Kaf/oR3lp1yjZUSP8B6Eb V6N27pr4EtqAQdJgp0iAk5OlDEvcY6lu/eQeht9BijWdM9zrSSi0PilHQSoj0C9xggg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220741; 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=9HsXQItqD1DEUcZhuwV0JOqZtMOBczrrUbCkW5DPri4=; b=ALV9HjDVhoFtNqkSh3LuYkK+SEvqFwLNWp3P7CVtwVmWID3PuqEl3HXa3lZWvIwz+7dn ZOd8D30e8QV/jGMMJccGW3h1/myZZ6hdzfP6WBa6cRwECJ2VktX5taJqkcEe0QwT3oq/I 1HZ9/EmWX3iQ66o++rGA1XWAmydPmXXXE1d3cwjuWKjtAYRclO6c2oT9TO+lo8OsZJIHM ycFpwLl47j4UEptIo7oYU9kfOkNZO2urmx0t6yObEzhd2fhjaCS+LQVA1gHQuDv14f1b9 UmgdfR8MCqCvlMp1I93A+nftAknCwI+2gt1qwmlHnKnev1ZX9mNJUIk0Jnj4aTGs7Cg== 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="e/XltaLx"; arc=none smtp.remote-ip=95.215.58.130 X-Received: from mta1.migadu.com (out-130.mta1.migadu.com [95.215.58.130]) (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 96607606A31A for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 14:12:20 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96607606A31A 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=StdXRnPX0JiWwX7Qx23M9NndGTcKpqKIgYxFHm9paqY=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796220738; v=1; x=1796825538; b=e/XltaLxryDaHMJpYxwNb7sUtUeoXfW9rbLQ9txoPBE7N476QKRk4aBxb7fRGt5aKUe/DJZa mdy7QdMSDH8ibfO3BvDRYNB9a3cNthYd1Kdc+GxKeZe/91Aa7DhA2EX3CMnAs8OETWhzicfzryL sG25tTcjzV6sHWWrj4dxv2uE= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 9e16793a73b5c2ff; Wed, 02 Dec 2026 14:12:18 +0000 X-Mizu-Trace-ID: 9e16793a73b5c2ff 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: Brett Creeley <brett.creeley@amd.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, "Nikhil P. Rao" <nikhil.rao@amd.com>, Eric Dumazet <edumazet@kernel.org> X-In-Reply-To: <20261130-ionic-get-fec-stats-v7-5-730c1672f561@amd.com>