netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Danielle Ratson <danieller@nvidia.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"mkubecek@suse.cz" <mkubecek@suse.cz>,
	"matt@traverse.com.au" <matt@traverse.com.au>,
	"daniel.zahka@gmail.com" <daniel.zahka@gmail.com>,
	Amit Cohen <amcohen@nvidia.com>,
	NBU-mlxsw <NBU-mlxsw@exchange.nvidia.com>
Subject: Re: [PATCH ethtool-next 08/14] cmis: Enable JSON output support in CMIS modules
Date: Tue, 28 Jan 2025 14:09:23 -0800	[thread overview]
Message-ID: <20250128140923.144412cf@kernel.org> (raw)
In-Reply-To: <DM6PR12MB45169E557CE078AB5C7CB116D8EF2@DM6PR12MB4516.namprd12.prod.outlook.com>

On Tue, 28 Jan 2025 13:18:54 +0000 Danielle Ratson wrote:
> > >         "module_state": 3,
> > >         "module_state_description": "ModuleReady",
> > >         "low_pwr_allow_request_hw": false,
> > >         "low_pwr_request_sw": false,
> > >         "module_temperature": 36.8203,
> > >         "module_temperature_units": "degrees C",
> > >         "module_voltage": 3.3385,
> > >         "module_voltage_units": "V",
> > >         "laser_tx_bias_current": [
> > > 0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000 ],
> > >         "laser_tx_bias_current_units": "mA",  
> > 
> > How do you think about the units?
> > If they may differ module to module - should we aim to normalize those?  
> 
> Not sure if I understand what you mean. What do you wish to normalize and how?

I don't understand the "_units" keys, basically:

        "max_power": 10.0000,
        "max_power_units": "W",     <<
	[...]
            "low_warning_threshold": 0.1585,
            "units": "mW"           <<

or:

        "length_(smf)": 0.0000,
        "length_(smf)_units": "km",  <<
        "length_(om5)": 0,
        "length_(om5)_units": "m",   <<

What are these for?

Is the consumer of the JSON output supposed to be parsing the units 
and making sure to scale the values every time it reads (e.g. divide 
by 1000 if it wants W but unit is mW)?

Or the unit is fully implied by the key, and can't change? IOW the unit
is only listed so that the human writing the consumer can figure out
the unit and then hardcode it?

  reply	other threads:[~2025-01-28 22:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26 11:56 [PATCH ethtool-next 00/14] Add JSON output to --module-info Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 01/14] module_common: Add a new file to all the common code for all module types Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 02/14] sff_common: Move sff_show_revision_compliance() to qsfp.c Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 03/14] cmis: Change loop order in cmis_show_dom_chan_lvl_flags() Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 04/14] qsfp: Reorder the channel-level flags list for SFF8636 module type Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 05/14] qsfp: Refactor sff8636_show_dom() by moving code into separate functions Danielle Ratson
2025-01-27 19:44   ` Vadim Fedorenko
2025-01-28 13:17     ` Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 06/14] module_common: Add helpers to support JSON printing for common value types Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 07/14] cmis: Add JSON output handling to --module-info in CMIS modules Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 08/14] cmis: Enable JSON output support " Danielle Ratson
2025-01-27 20:12   ` Jakub Kicinski
2025-01-28 13:18     ` Danielle Ratson
2025-01-28 22:09       ` Jakub Kicinski [this message]
2025-01-29  7:06         ` Danielle Ratson
2025-01-30  1:17           ` Jakub Kicinski
2025-01-30 12:38             ` Danielle Ratson
2025-01-30 16:24               ` Jakub Kicinski
2025-01-30 17:20                 ` Andrew Lunn
2025-02-02 18:22                 ` Danielle Ratson
2025-02-02 19:40                   ` Andrew Lunn
2025-02-03  9:58                     ` Danielle Ratson
2025-02-03 20:59                   ` Jakub Kicinski
2025-01-29  9:40     ` Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 09/14] qsfp: Add JSON output handling to --module-info in SFF8636 modules Danielle Ratson
2025-01-27 20:16   ` Jakub Kicinski
2025-01-28 13:23     ` Danielle Ratson
2025-01-28 22:13       ` Jakub Kicinski
2025-01-29 11:37         ` Gal Pressman
2025-01-29 11:53           ` Danielle Ratson
2025-01-29 16:21           ` Petr Machata
2025-01-29 12:50         ` Danielle Ratson
2025-01-29 10:44       ` Petr Machata
2025-01-29 11:53         ` Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 10/14] qsfp: Enable JSON output support for " Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 11/14] sfpid: Add JSON output handling to --module-info in SFF8079 modules Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 12/14] sfpdiag: Add JSON output handling to --module-info in SFF8472 modules Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 13/14] ethtool: Enable JSON output support for SFF8079 and " Danielle Ratson
2025-01-26 11:56 ` [PATCH ethtool-next 14/14] ethtool: Add '-j' support to ethtool Danielle Ratson

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=20250128140923.144412cf@kernel.org \
    --to=kuba@kernel.org \
    --cc=NBU-mlxsw@exchange.nvidia.com \
    --cc=amcohen@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=danieller@nvidia.com \
    --cc=matt@traverse.com.au \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).