From: Eric Joyner <eric.joyner@amd.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>, netdev@vger.kernel.org
Cc: Brett Creeley <brett.creeley@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 5/5] ionic: Add .get_fec_stats ethtool handler
Date: Wed, 6 May 2026 09:17:10 -0700 [thread overview]
Message-ID: <88195eaf-a767-4107-86db-24fe46962f3a@amd.com> (raw)
In-Reply-To: <45677056-ff03-442f-a7dd-19d34c7b612d@linux.dev>
On 5/6/2026 3:00 AM, Vadim Fedorenko wrote:
> [You don't often get email from vadim.fedorenko@linux.dev. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On 05/05/2026 20:43, Eric Joyner wrote:
>> On 5/5/2026 6:54 AM, Vadim Fedorenko wrote:
>>> [You don't often get email from vadim.fedorenko@linux.dev. Learn why this is
>>> important at https://aka.ms/LearnAboutSenderIdentification ]
>>>
>>> Caution: This message originated from an External Source. Use proper caution
>>> when opening attachments, clicking links, or responding.
>>>
>>>
>>> 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 <eric.joyner@amd.com>
>>>> ---
>>>> .../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.
>>>
>>>
>>
>> This looks correct to me -- (ETHTOOL_FEC_HIST_MAX - 1) = 16, so starting with
>> i=0, it'll iterate through the 16 bins and ignore the 17th end marker bin. Bin
>> 15 does get included and gets its sum set.
>
> Ahh, yeah, you're right, smth was wrong with my math yesterday. btw, how
> does it work for different FEC? RS(528, 514) will not give you 16 bins..
>
>
According to the datasheet for the device that does support reporting these
histogram bins, there's no support for "Clause 91 RS(528,514) "KR4" FEC for
100GbE". I only see support for PAM4 and not NRZ.
- Eric
prev parent reply other threads:[~2026-05-06 16:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 3:15 [PATCH net-next 0/5] Expose more port stats to ethtool Eric Joyner
2026-05-01 3:15 ` [PATCH net-next 1/5] ionic: Small improvements in devcmd retry logic Eric Joyner
2026-05-01 23:37 ` Jakub Kicinski
2026-05-05 15:54 ` Eric Joyner
2026-05-01 3:15 ` [PATCH net-next 2/5] ionic: Report "link_down_events_phy" in ethtool statistics Eric Joyner
2026-05-01 23:39 ` Jakub Kicinski
2026-05-05 19:53 ` Eric Joyner
2026-05-05 23:21 ` Jakub Kicinski
2026-05-06 3:41 ` Eric Joyner
2026-05-01 3:15 ` [PATCH net-next 3/5] ionic: Update ionic_if.h with new extra port stats structure Eric Joyner
2026-05-01 23:40 ` Jakub Kicinski
2026-05-01 3:15 ` [PATCH net-next 4/5] ionic: Report rx_bits_phy stat to ethtool Eric Joyner
2026-05-01 3:15 ` [PATCH net-next 5/5] ionic: Add .get_fec_stats ethtool handler Eric Joyner
2026-05-01 23:41 ` Jakub Kicinski
2026-05-05 19:44 ` Eric Joyner
2026-05-05 13:54 ` Vadim Fedorenko
2026-05-05 19:43 ` Eric Joyner
2026-05-06 10:00 ` Vadim Fedorenko
2026-05-06 16:17 ` Eric Joyner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88195eaf-a767-4107-86db-24fe46962f3a@amd.com \
--to=eric.joyner@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox