RE: [PATCH ethtool-next 08/14] cmis: Enable JSON output support in CMIS modules
From: Danielle Ratson <hidden>
Date: 2025-02-03 09:58:30
From: Andrew Lunn <andrew@lunn.ch> Sent: Sunday, 2 February 2025 21:41 To: Danielle Ratson <redacted> Cc: Jakub Kicinski <kuba@kernel.org>; netdev@vger.kernel.org; mkubecek@suse.cz; matt@traverse.com.au; daniel.zahka@gmail.com; Amit Cohen [off-list ref]; NBU-mlxsw <NBU- mlxsw@exchange.nvidia.com> Subject: Re: [PATCH ethtool-next 08/14] cmis: Enable JSON output support in CMIS modulesquoted
"module_temperature": 37.3477, "module_voltage": 3.3406,Device tree often puts the units in the property name. module_temperature_C, module_voltage_v,quoted
"laser_bias_current": { "high_alarm_threshold": 13, "low_alarm_threshold": 3, "high_warning_threshold": 11, "low_warning_threshold": 5"high_alarm_threshold_mA": 13,quoted
}, "laser_output_power": { "high_alarm_threshold": 3.1623, "low_alarm_threshold": 0.1, "high_warning_threshold": 1.9953, "low_warning_threshold": 0.1585 },"high_alarm_threshold_W": 3.1623,quoted
"module_temperature": { "high_alarm_threshold": 75, "low_alarm_threshold": -5, "high_warning_threshold": 70, "low_warning_threshold": 0 },"high_alarm_threshold_C": 75, etc. This makes it more self contained. Andrew
I suggested to have a separate field for units in the json output. It makes sense since it can be easily tracked by a machine and also it is aligned with the regular output. Jakub offered to remove those fields from the output at all. And use a separate file for documenting those fields. In that case we are still aligned with regular output. But in your suggestion, we should use a different naming convention in the JSON output, which not only complicates the code but is also confusing. I think we should stick to the first 2 options. Thanks.