From: Andrew Lunn <andrew@lunn.ch>
To: Johannes Eigner <johannes.eigner@a-eberle.de>
Cc: netdev@vger.kernel.org, Michal Kubecek <mkubecek@suse.cz>,
Danielle Ratson <danieller@nvidia.com>,
Stephan Wurm <stephan.wurm@a-eberle.de>
Subject: Re: [PATCH ethtool 2/2] sff-common: Fix naming of JSON keys for thresholds
Date: Wed, 22 Oct 2025 15:32:24 +0200 [thread overview]
Message-ID: <0b99a68f-0dd3-4f95-a367-750464ff1fee@lunn.ch> (raw)
In-Reply-To: <20251021-fix-module-info-json-v1-2-01d61b1973f6@a-eberle.de>
On Tue, Oct 21, 2025 at 04:00:13PM +0200, Johannes Eigner wrote:
> Append "_thresholds" to the threshold JSON objects to avoid using the
> same key which is not allowed in JSON.
> The JSON output for SFP transceivers uses the keys "laser_bias_current",
> "laser_output_power", "module_temperature" and "module_voltage" for
> both the actual value and the threshold values. This leads to invalid
> JSON output as keys in a JSON object must be unique.
> For QSPI and CMIS the keys "module_temperature" and "module_voltage" are
> also used for both the actual value and the threshold values.
>
> Signed-off-by: Johannes Eigner <johannes.eigner@a-eberle.de>
> ---
> sff-common.c | 50 +++++++++++++++++++++++++-------------------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/sff-common.c b/sff-common.c
> index 0824dfb..6528f5a 100644
> --- a/sff-common.c
> +++ b/sff-common.c
> @@ -104,39 +104,39 @@ void sff8024_show_encoding(const __u8 *id, int encoding_offset, int sff_type)
>
> void sff_show_thresholds_json(struct sff_diags sd)
> {
> - open_json_object("laser_bias_current");
> - PRINT_BIAS_JSON("high_alarm_threshold", sd.bias_cur[HALRM]);
> - PRINT_BIAS_JSON("low_alarm_threshold", sd.bias_cur[LALRM]);
> - PRINT_BIAS_JSON("high_warning_threshold", sd.bias_cur[HWARN]);
> - PRINT_BIAS_JSON("low_warning_threshold", sd.bias_cur[LWARN]);
> + open_json_object("laser_bias_current_thresholds");
> + PRINT_BIAS_JSON("high_alarm", sd.bias_cur[HALRM]);
> + PRINT_BIAS_JSON("low_alarm", sd.bias_cur[LALRM]);
> + PRINT_BIAS_JSON("high_warning", sd.bias_cur[HWARN]);
> + PRINT_BIAS_JSON("low_warning", sd.bias_cur[LWARN]);
> close_json_object();
I'm struggling understanding the changes here. Maybe give an example
before and after.
The commit message talks about adding _threshold, but you are also
removing _threshold, which is what is confusing me. Is this required?
It makes the ABI breakage bigger.
Andrew
next prev parent reply other threads:[~2025-10-22 13:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 14:00 [PATCH ethtool 0/2] fix module info JSON output Johannes Eigner
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 [this message]
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=0b99a68f-0dd3-4f95-a367-750464ff1fee@lunn.ch \
--to=andrew@lunn.ch \
--cc=danieller@nvidia.com \
--cc=johannes.eigner@a-eberle.de \
--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