Subject: Re: [PATCH net-next v3 5/5] ionic: Add .get_fec_stats ethtool handler

From: Jakub Kicinski <[email-masked]>
Date: Mon, 18 May 2026 17:22:54 -0700

On Mon, 18 May 2026 17:06:25 -0700 Eric Joyner wrote:
> Sorry, what I wrote should've said "there's no proper/good way to do this by
> only making changes in software".
> 
> You're right that the firmware knows; to that end I'm almost done changing the
> firmware to act similarly to how this interface distinguishes valid statistics,
> and have the firmware report "-1" for these new extra stats if the hardware
> doesn't actually collect the stat.

Plumbing Linux hacks into FW is definitely not my favorite :S
The way we use -1 in the kernel is a local hack which is never
meant to escape the kernel.

If you want to do something similar with your FW - please make sure you
add your local defines, and code which _explicitly_ interprets -1
coming out of FW to the driver is "not set". IOW don't user ETHTOOL
defines or assign the FW-reported value directly to the uAPI stat.

Otherwise, if we change the hack kernel uses to distinguish "unset"
values and ionic would break.