[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251024-fix-module-info-json-v3-0-36862ce701ae@a-eberle.de>
Date: Fri, 24 Oct 2025 12:32:50 +0200
From: Johannes Eigner <johannes.eigner@...berle.de>
To: netdev@...r.kernel.org
Cc: Michal Kubecek <mkubecek@...e.cz>,
Danielle Ratson <danieller@...dia.com>,
Stephan Wurm <stephan.wurm@...berle.de>, Andrew Lunn <andrew@...n.ch>,
Johannes Eigner <johannes.eigner@...berle.de>
Subject: [PATCH ethtool v3 0/2] fix module info JSON output
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.
Signed-off-by: Johannes Eigner <johannes.eigner@...berle.de>
---
Changes in v3:
- Reworked second patch to minimize API change
- Update description of second patch in cover letter
- Link to v2: https://lore.kernel.org/r/20251022-fix-module-info-json-v2-0-d1f7b3d2e759@a-eberle.de
Changes in v2:
- Add fixes tags
- Do not close and delete a never created json object
- Link to v1: https://lore.kernel.org/r/20251021-fix-module-info-json-v1-0-01d61b1973f6@a-eberle.de
---
Johannes Eigner (2):
sfpid: Fix JSON output of SFP diagnostics
module info: Fix duplicated JSON keys
module-common.c | 4 ++--
module_info.json | 4 ++--
sfpdiag.c | 4 ++--
sfpid.c | 9 +++++----
4 files changed, 11 insertions(+), 10 deletions(-)
---
base-commit: 422504811c13c245cd627be2718fbaa109bdd6ec
change-id: 20251021-fix-module-info-json-0424107771fe
Best regards,
--
Johannes Eigner <johannes.eigner@...berle.de>
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (4153 bytes)
Powered by blists - more mailing lists