Merge branch 'review/module-json-fixes' into master
Johannes Eigner:
In one of our products we need to show the SFP diagnostics in a web
interface. Therefore we want to use the JSON output of the ethtool
module information. During integration I found two problems.
When using `ethtool -j -m sfpX` only the basic module information was
JSON formatted, the diagnostics part was not. First patch ensures whole
module information output is JSON formatted for SFP modules.
The same keys were used for both the measured and threshold values in
the diagnostics JSON output, which is not valid JSON. Second patch
avoids this by renaming the keys for the measured values.
This solution is not backward compatible. But keeping the broken JSON
output is not an option either. The API change is kept as small as
possible. Further details are in the commit message of the second patch.
Second bug is definitely affecting SFP modules and maybe also affecting
QSFP and CMIS modules. Possible bug for QSFP and CMIS modules are based
on my understanding of the code only. I have only access to hardware
supporting SFP modules.