From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31D7262FF8 for ; Wed, 28 Jan 2026 07:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769584501; cv=none; b=NkeOirKHVFsh56J9V4N+If7HwcqonVM2smf0Jik5WWIjbHKpbMFxJWbGw/cterj/m8crElsW/dsqYwytc2korEE+d/lDeU4XnnYq0eyY49yKov0KiLL71BQuVoXxNUSVWoPNHfAkeCJ8j/+EaYd/iEiT7y7JNiRPqDkdn4YgFD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769584501; c=relaxed/simple; bh=V02HxfQ9RsspwOQYXSjiv9STuyAvNPhJsf92qGNWRO8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XVPPE9AFhDR/IzsQDcsZDwLMjAOjr9XJCF6lJ/8R6a+86R56j9DF127fyGMYidjhpwMZ74TvNGCbK01XN0p4+6lraFINElBReCWdM9Dd8H9ws2KQ5y9gQgV+ZVVkf+VUpllhaG2tpCJhrlJX4b2kupJWVPManB0+xLeHwGz2ERM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UT6cLG9s; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UT6cLG9s" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-47d59da3d81so3649855e9.0 for ; Tue, 27 Jan 2026 23:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769584498; x=1770189298; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=d4mHnmREA3ivtce+rHh5XeeKRw0SRT5qe2A7xs9am0M=; b=UT6cLG9sayoG2B72rocJ2Vho62g0ZnQwAzV/ivmMSRR11QxtGXwU8VI9FxY/gEFxLv hFTD/I19i/ccCn1hpbkzrFbMhPD/268Iut+AtLHEMeEM29IZc3iC9NDyOJTnmqUt+mcq jdMBaRgk1fLTMAJ0mFaIdm8irDQWV4eYIEJ/fklnjOpVdYgivWh+CTV7Cp0/kf1JVbjx fQSZsLOZrgV5YsdHw7po6t3Nl96erC04yDFTi3ksCzvvxqbxwL+HGaDxmJiALTV7/Px2 5fCPPtawYGu7svSEVqn2rzDBOmSgBGPAlH5A4YsjNwa4HKi9/eFDObG6jvv2XOJV9ial QFdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769584498; x=1770189298; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d4mHnmREA3ivtce+rHh5XeeKRw0SRT5qe2A7xs9am0M=; b=PV8L+MThvIn7KDEMBInXvda60dtusDBAjW+OsX4nBhpTZJcO890bEZ4UxixdiIBl92 ntUKzYMiDLQOKP+BXKj/ID+a5NWCAWzbQ4DEHEIV7x5cM98/NaQla2f9PPBpmjkb3ki1 Nfd18yVcEdjGpujAcVgKVlaZYOOq34JHfR1Fkk9MiOJNZh6499lq1ShWiQENUJjKBtXA NN3l/iWLT7O3Sr2/xKRpeIU2XnM7laTvx3lHvkuxBX0pMSl8ruMryWkwEF213IT7W1fp PAVk7Kyl0VYSBSsilP0r2QY9JgzvghGljHkOVakixGmp2zVikDlcX23GQ3+qJmV57T5n TUCA== X-Forwarded-Encrypted: i=1; AJvYcCUw2FGkDkLbG1Gew+FNgFXijZzaJNwmMmQwBKmvooTSbcSK4VGq4JVbeREqB5PGX36NXI5HzzloRsuLsns=@vger.kernel.org X-Gm-Message-State: AOJu0YwL0WLbJX6AiZhGvIEW0RASq4dX8653nIeIUWqnyAfRx7iNiPpd jHGmGoRq6d/lzMks+jbh94qzZWZoUC6OZ+ivPuMxzQ4TvDbM0kHlZDO2 X-Gm-Gg: AZuq6aIj7R5f74BY4lGQBk0ZpyDkiOqCtNb84920kgJADbvxhUuyMHK1CMiUu8I+yBR Pg4QrctX5dvUcRay5y9/xP99+Sp823stfPBwL5Nvzr7S78FbMrm95FBG1nvnKiAT3k+Q+qwj+O2 IjZp89BiCI8Aau1NSqxurUMEnLawZobxHaUkRQww5t1gSQmnsJHASulDF5k/JwtbziLtZJ2uKMF Fyt2p38zl/HyXs8OqfCDOx1WK+hVYVAaDIKiSaetUsV71PqNnLnQtLz3Xmn0Ozjjxp63kJcnMRS ZLXMLfwqSLLDftLAwPWE2XL1gCVUKz/EVV9hNBGx0VQJE7Famai86nKYBptUXXWXbsgpPRfOYnX BI6CvSztSnxGO+4LzVgZ8djgQ7P2fXoZcuksk+MLIQtot6X95Fd+cqVKDpD3ncIMNYiyPbIOJWp ekbJXsqb0vkWju8cM3eQUAsSL0/R0+ X-Received: by 2002:a05:600c:620b:b0:47e:e981:78b4 with SMTP id 5b1f17b1804b1-48069e79968mr50923575e9.12.1769584497835; Tue, 27 Jan 2026 23:14:57 -0800 (PST) Received: from [10.80.1.200] ([72.25.96.16]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4806d255d2fsm19375925e9.1.2026.01.27.23.14.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Jan 2026 23:14:57 -0800 (PST) Message-ID: Date: Wed, 28 Jan 2026 09:14:56 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC mlx5-next 0/1] net/mlx5e: Expose physical received bits counters to ethtool To: Kenta Akagi , saeedm@nvidia.com, tariqt@nvidia.com, mbloch@nvidia.com, leon@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <0106019bb70737d5-06bcc3e0-d534-4e42-b8a3-71dc3b53f318-000000@ap-northeast-1.amazonses.com> Content-Language: en-US From: Tariq Toukan In-Reply-To: <0106019bb70737d5-06bcc3e0-d534-4e42-b8a3-71dc3b53f318-000000@ap-northeast-1.amazonses.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13/01/2026 13:04, Kenta Akagi wrote: > On 2026/01/13 15:43, Tariq Toukan wrote: >> >> >> On 13/01/2026 8:31, Tariq Toukan wrote: >>> >>> >>> On 12/01/2026 9:03, Kenta Akagi wrote: >>>> Hi, >>>> >>>> I would like to measure the cable BER on ConnectX. >>>> >>>> According to the documentation[1][2], there are counters that can be used >>>> for this purpose: rx_corrected_bits_phy, rx_pcs_symbol_err_phy and >>>> rx_bits_phy. However, rx_bits_phy does not show up in ethtool >>>> statistics. >>>> >>>> This patch exposes the PPCNT phy_received_bits as rx_bits_phy. >>>> >>>> >>>> On a ConnectX-5 with 25Gbase connection, it works as expected. >>>> >>>> On the other hand, although I have not verified it, in an 800Gbps >>>> environment rx_bits_phy would likely overflow after about 124 days. >>>> Since I cannot judge whether this is acceptable, I am posting this as an >>>> RFC first. >>>> >>> >>> Hi, >>> >>> This is a 64-bits counter so no overflow is expected. >>> >> >> Sorry, ignore my comment, your numbers make sense. >> Maybe it's ~248 days, but same idea. >> > > Hi, thank you for checking. > > Ah, it seems I didn't realize it was unsigned, and I also forgot to > include the expression. Sorry about that. > Yes - at 800 Gbps, 0xFFFFFFFFFFFFFFFF / (800 * (2^30) * 86400) = 248.55 days, > so it will overflow. > > In practice, is it possible to expose this as a statistic via ethtool? > Or is there some other value that could be exposed for BER calculation - e.g., > a register that indicates the elapsed seconds since link-up? > > Thanks. > Hi Kenta, You will find "FEC histogram" feature useful. It splits the errors into ranges (bins), and plots a counter for each bin. There's also a bin for 0-errors, which is what you're looking for. Example output: # ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml --do fec-get --json '{"header":{"dev-index": 5, "flags": 4}}' {'active': 50, 'auto': 1, 'header': {'dev-index': 5, 'dev-name': 'eth3'}, 'modes': {'bits': {}, 'nomask': True, 'size': 125}, 'stats': {'corr-bits': [2810], 'corrected': [2123], 'hist': [{'bin-high': 0, 'bin-low': 0, 'bin-val': 235826196705}, {'bin-high': 1, 'bin-low': 1, 'bin-val': 1436}, {'bin-high': 2, 'bin-low': 2, 'bin-val': 687}, {'bin-high': 3, 'bin-low': 3, 'bin-val': 0}, {'bin-high': 4, 'bin-low': 4, 'bin-val': 0}, {'bin-high': 5, 'bin-low': 5, 'bin-val': 0}, {'bin-high': 6, 'bin-low': 6, 'bin-val': 0}, {'bin-high': 7, 'bin-low': 7, 'bin-val': 0}, {'bin-high': 8, 'bin-low': 8, 'bin-val': 0}, {'bin-high': 9, 'bin-low': 9, 'bin-val': 0}, {'bin-high': 10, 'bin-low': 10, 'bin-val': 0}, {'bin-high': 11, 'bin-low': 11, 'bin-val': 0}, {'bin-high': 12, 'bin-low': 12, 'bin-val': 0}, {'bin-high': 13, 'bin-low': 13, 'bin-val': 0}, {'bin-high': 14, 'bin-low': 14, 'bin-val': 0}, {'bin-high': 15, 'bin-low': 15, 'bin-val': 0}], 'uncorr': [0]}}