[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250204133957.1140677-16-danieller@nvidia.com>
Date: Tue, 4 Feb 2025 15:39:56 +0200
From: Danielle Ratson <danieller@...dia.com>
To: <netdev@...r.kernel.org>
CC: <mkubecek@...e.cz>, <matt@...verse.com.au>, <daniel.zahka@...il.com>,
<amcohen@...dia.com>, <nbu-mlxsw@...hange.nvidia.com>, Danielle Ratson
<danieller@...dia.com>
Subject: [PATCH ethtool-next v3 15/16] module_info: Add a new JSON file for units documentation
The JSON output dump will not contain explicit unit indicators in the
output fields.
Instead, document those units in a separate schema JSON file so a JSON consumer
will be able to track this information.
Signed-off-by: Danielle Ratson <danieller@...dia.com>
---
Notes:
v3:
* New patch.
module_info.json | 191 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 191 insertions(+)
create mode 100644 module_info.json
diff --git a/module_info.json b/module_info.json
new file mode 100644
index 0000000..1ef214b
--- /dev/null
+++ b/module_info.json
@@ -0,0 +1,191 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "title": "Ethtool module-info JSON Output",
+ "description": "Units documentation for various fields in the output.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "br_nominal": {
+ "type": "integer",
+ "description": "Unit: Mbps"
+ },
+ "length_(smf)": {
+ "type": "integer",
+ "description": "Unit: km"
+ },
+ "length_(om5)": {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "length_(om4)": {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "length_(om3)": {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "length_(om2)": {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "length_(om1)": {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "length_(copper_or_active_cable)":
+ {
+ "type": "integer",
+ "description": "Unit: m"
+ },
+ "laser_wavelength": {
+ "type": "integer",
+ "description": "Unit: nm"
+ },
+ "laser_wavelength_tolerance": {
+ "type": "integer",
+ "description": "Unit: nm"
+ },
+ "module_temperature": {
+ "type": "number",
+ "description": "Unit: degrees C"
+ },
+ "module_voltage": {
+ "type": "number",
+ "description": "Unit: V"
+ },
+ "laser_tx_bias_current": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ },
+ "description": "Unit: mA"
+ },
+ "transmit_avg_optical_power": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ },
+ "description": "Unit: mW"
+ },
+ "rx_power": {
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ },
+ "description": "Unit: mW"
+ }
+ }
+ },
+ "laser_bias_current": {
+ "type": "object",
+ "properties": {
+ "high_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mA"
+ },
+ "low_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mA"
+ },
+ "high_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mA"
+ },
+ "low_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mA"
+ }
+ }
+ },
+ "laser_output_power": {
+ "type": "object",
+ "properties": {
+ "high_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "low_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "high_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "low_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ }
+ }
+ },
+ "module_temperature": {
+ "type": "object",
+ "properties": {
+ "high_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: degrees C"
+ },
+ "low_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: degrees C"
+ },
+ "high_warning_threshold": {
+ "type": "number",
+ "description": "Unit: degrees C"
+ },
+ "low_warning_threshold": {
+ "type": "number",
+ "description": "Unit: degrees C"
+ }
+ }
+ },
+ "module_voltage": {
+ "type": "object",
+ "properties": {
+ "high_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: V"
+ },
+ "low_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: V"
+ },
+ "high_warning_threshold": {
+ "type": "number",
+ "description": "Unit: V"
+ },
+ "low_warning_threshold": {
+ "type": "number",
+ "description": "Unit: V"
+ }
+ }
+ },
+ "laser_rx_power": {
+ "type": "object",
+ "properties": {
+ "high_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "low_alarm_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "high_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ },
+ "low_warning_threshold": {
+ "type": "number",
+ "description": "Unit: mW"
+ }
+ }
+ }
+ }
+ }
+}
--
2.47.0
Powered by blists - more mailing lists