Netdev List
 help / color / mirror / Atom feed
From: Johannes Eigner <johannes.eigner@a-eberle.de>
To: netdev@vger.kernel.org
Cc: Michal Kubecek <mkubecek@suse.cz>,
	 Danielle Ratson <danieller@nvidia.com>,
	 Stephan Wurm <stephan.wurm@a-eberle.de>,
	 Johannes Eigner <johannes.eigner@a-eberle.de>
Subject: [PATCH ethtool 0/2] fix module info JSON output
Date: Tue, 21 Oct 2025 16:00:11 +0200	[thread overview]
Message-ID: <20251021-fix-module-info-json-v1-0-01d61b1973f6@a-eberle.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

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 actual and threshold values in the
diagnostics JSON output, which is not valid JSON. Second patch avoids
this by renaming the threshold keys.
This solution is not backward compatible. I don't see a possibility to
fix this in a backward compatible way. If anyone knows a solution,
please let me know so I can improve the patch.
Another solution for the second patch would be to rename the keys for
the actual values instead of the thresholds. But this is also not
backward compatible. I decided to rename the threshold keys, as this
aligns with the naming used for the warning and alarm flags.
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@a-eberle.de>
---
Johannes Eigner (2):
      sfpid: Fix JSON output of SFP diagnostics
      sff-common: Fix naming of JSON keys for thresholds

 sff-common.c | 50 +++++++++++++++++++++++++-------------------------
 sfpid.c      |  4 ++--
 2 files changed, 27 insertions(+), 27 deletions(-)
---
base-commit: 422504811c13c245cd627be2718fbaa109bdd6ec
change-id: 20251021-fix-module-info-json-0424107771fe

Best regards,
-- 
Johannes Eigner <johannes.eigner@a-eberle.de>


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4153 bytes --]

             reply	other threads:[~2025-10-21 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 14:00 Johannes Eigner [this message]
2025-10-21 14:00 ` [PATCH ethtool 1/2] sfpid: Fix JSON output of SFP diagnostics Johannes Eigner
2025-10-22 12:55   ` Danielle Ratson
2025-10-22 14:52     ` Johannes Eigner
2025-10-21 14:00 ` [PATCH ethtool 2/2] sff-common: Fix naming of JSON keys for thresholds Johannes Eigner
2025-10-22 13:32   ` Andrew Lunn
2025-10-22 14:59     ` Johannes Eigner
2025-10-22 15:34       ` Andrew Lunn
2025-10-23 10:02         ` Johannes Eigner
2025-10-23 13:14           ` Andrew Lunn

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=20251021-fix-module-info-json-v1-0-01d61b1973f6@a-eberle.de \
    --to=johannes.eigner@a-eberle.de \
    --cc=danieller@nvidia.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=stephan.wurm@a-eberle.de \
    /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