From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A463931F999 for ; Tue, 5 May 2026 13:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777989291; cv=none; b=HazvUAYibhGL5/M5s+NFohSY1OSLzjqkTzoSpdy3NFPPrOt1EcO6bh8lfCYYXJhVIBUQQLpASmZw3KWYEjVq8iTjSYJLVwYF6DPBUMsekZL7MsH7QS9sDCATAqAaon4GrfWyR8yjE5U/Ann0ApfSU2nMO6G16ZGVqE4hEnC5SS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777989291; c=relaxed/simple; bh=MTvK9+C21xuIA06FzqrnqdYZc1ukHj+rWyuwu3V7EXA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eplwCw3CZS12d0zkxKbniWkeA/Bk8Rqqk+Hr4tQ/WFXjtjVzAg04UQ9nuVpOaEgqedqYo6wn8jZQiqqPBQVnzEH0cJPYKhldD/u9XDRcO5ZN9bkxP/bOhDBX+BwNdEwJmJu2wqjWhKOZQP+6E5iBkGHUJM9UiQp4XHppiLTd2Uw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mfvJ8Zmx; arc=none smtp.client-ip=91.218.175.174 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) header.d=linux.dev header.i=@linux.dev header.b="mfvJ8Zmx" Message-ID: <6eabe3df-08b2-4237-a989-a8e3a9bdf37f@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777989287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SI4lfLI8eYyem0NJxVJ2GIm6PJT/ZtNkHhHLajT+gFs=; b=mfvJ8Zmx8olWsWDB/KpPcbRH3P2bve65awZzrMbCe6iGMVhvJcsINe7HiHohP+u+4nHaO9 JL6jKtiuUCxlafG2S8orKQR8JvefShsXASjq7m9h3vDccVss6CksL8qzJvsUclk65/pjoa 1T/LFchapCz/gz/ey6ZdxFgeMJOdANU= Date: Tue, 5 May 2026 14:54:43 +0100 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next 5/5] ionic: Add .get_fec_stats ethtool handler To: Eric Joyner , netdev@vger.kernel.org Cc: Brett Creeley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni References: <20260501031555.43259-1-eric.joyner@amd.com> <20260501031555.43259-6-eric.joyner@amd.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20260501031555.43259-6-eric.joyner@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 01/05/2026 04:15, Eric Joyner wrote: > Several FEC error statistics being collected can be reported in a > dedicated ethtool callback for FEC errors, so implement the handler that > does so. This includes 802.3ck FEC histogram data that some newer > hardware collects. > > Assisted-by: Claude:claude-4.6-sonnet > Signed-off-by: Eric Joyner > --- > .../ethernet/pensando/ionic/ionic_ethtool.c | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > index 78a802eb159f..fe1f753b6115 100644 > --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > @@ -418,6 +418,56 @@ static int ionic_get_fecparam(struct net_device *netdev, > return 0; > } > > +static const struct ethtool_fec_hist_range ionic_fec_ranges[] = { > + { 0, 0}, > + { 1, 1}, > + { 2, 2}, > + { 3, 3}, > + { 4, 4}, > + { 5, 5}, > + { 6, 6}, > + { 7, 7}, > + { 8, 8}, > + { 9, 9}, > + { 10, 10}, > + { 11, 11}, > + { 12, 12}, > + { 13, 13}, > + { 14, 14}, > + { 15, 15}, > + { 0, 0}, > +}; > + > +static void > +ionic_fill_fec_hist(const struct ionic_port_extra_stats *extra_stats, > + struct ethtool_fec_hist *hist) > +{ > + int i; > + > + hist->ranges = ionic_fec_ranges; > + for (i = 0; i < ETHTOOL_FEC_HIST_MAX - 1; i++) > + hist->values[i].sum = extra_stats->fec_codeword_error_bin[i]; > +} ETHTOOL_FEC_HIST_MAX = 17, you defined 16 bins, but iterating over 15 of them. Looks like bin {15, 15} will be lost in stats.