From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.215 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== 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== 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 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 ; Sat, 28 Nov 2026 13:27:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9841F606A31F 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=BaMYROqB X-Envelope-To: netdev@vger.kernel.org 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 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 Message-ID: Date: Sat, 28 Nov 2026 13:27:03 +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 v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec To: Brett Creeley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shannon Nelson Cc: netdev@vger.kernel.org, Simon Horman , "Nikhil P. Rao" , Eric Joyner , Breno Leitao , Arun Kumar Prakash References: <20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com> <20261125-ionic-get-fec-stats-v6-5-1ab49c729c00@amd.com> Content-Language: en-US From: Vadim Fedorenko In-Reply-To: <20261125-ionic-get-fec-stats-v6-5-1ab49c729c00@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25/11/2026 23:22, Brett Creeley 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. > > Fixes: e95f922f4c2f ("ionic: implement ethtool set-fec") > Signed-off-by: Nikhil P. Rao > Signed-off-by: Eric Joyner > Signed-off-by: Brett Creeley > --- > 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