From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.130 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== 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== 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 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 ; Wed, 2 Dec 2026 14:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96607606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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-Envelope-To: netdev@vger.kernel.org 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 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 Message-ID: <38a22bbf-3494-4d2c-be35-fa45a48e6a69@linux.dev> Date: Wed, 2 Dec 2026 14:12:13 +0000 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v7 5/6] ionic: report the operational FEC mode from ethtool --show-fec To: Eric Joyner , netdev@vger.kernel.org Cc: Brett Creeley , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , "Nikhil P. Rao" , Eric Dumazet References: <20261130-ionic-get-fec-stats-v7-0-730c1672f561@amd.com> <20261130-ionic-get-fec-stats-v7-5-730c1672f561@amd.com> Content-Language: en-US From: Vadim Fedorenko In-Reply-To: <20261130-ionic-get-fec-stats-v7-5-730c1672f561@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/12/2026 06:48, Eric Joyner wrote: > From: "Nikhil P. Rao" > > 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 > Signed-off-by: Eric Joyner > Signed-off-by: Brett Creeley > --- > .../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