lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b99a68f-0dd3-4f95-a367-750464ff1fee@lunn.ch>
Date: Wed, 22 Oct 2025 15:32:24 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Johannes Eigner <johannes.eigner@...berle.de>
Cc: netdev@...r.kernel.org, Michal Kubecek <mkubecek@...e.cz>,
	Danielle Ratson <danieller@...dia.com>,
	Stephan Wurm <stephan.wurm@...berle.de>
Subject: Re: [PATCH ethtool 2/2] sff-common: Fix naming of JSON keys for
 thresholds

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@...berle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ