[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DM6PR12MB45160F2C04E1644F8384BBACD8EE2@DM6PR12MB4516.namprd12.prod.outlook.com>
Date: Wed, 29 Jan 2025 11:53:14 +0000
From: Danielle Ratson <danieller@...dia.com>
To: Petr Machata <petrm@...dia.com>, Jakub Kicinski <kuba@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "mkubecek@...e.cz"
<mkubecek@...e.cz>, "matt@...verse.com.au" <matt@...verse.com.au>,
"daniel.zahka@...il.com" <daniel.zahka@...il.com>, Amit Cohen
<amcohen@...dia.com>, NBU-mlxsw <NBU-mlxsw@...hange.nvidia.com>
Subject: RE: [PATCH ethtool-next 09/14] qsfp: Add JSON output handling to
--module-info in SFF8636 modules
> -----Original Message-----
> From: Petr Machata <petrm@...dia.com>
> Sent: Wednesday, 29 January 2025 12:44
> To: Danielle Ratson <danieller@...dia.com>
> Cc: Jakub Kicinski <kuba@...nel.org>; netdev@...r.kernel.org;
> mkubecek@...e.cz; matt@...verse.com.au; daniel.zahka@...il.com; Amit
> Cohen <amcohen@...dia.com>; NBU-mlxsw <NBU-
> mlxsw@...hange.nvidia.com>
> Subject: Re: [PATCH ethtool-next 09/14] qsfp: Add JSON output handling to --
> module-info in SFF8636 modules
>
>
> Danielle Ratson <danieller@...dia.com> writes:
>
> > From: Jakub Kicinski <kuba@...nel.org>
> >>
> >> On Sun, 26 Jan 2025 13:56:30 +0200 Danielle Ratson wrote:
> >> > + open_json_object("extended_identifier");
> >> > + print_int(PRINT_JSON, "value", "0x%02x",
> >> > + map->page_00h[SFF8636_EXT_ID_OFFSET]);
> >>
> >> Hm, why hex here?
> >> Priority for JSON output is to make it easy to handle in code, rather
> >> than easy to read. Hex strings need extra manual decoding, no?
> >
> > I kept the same convention as in the regular output.
> >
> > And as agreed in Daniel's design those hex fields remain hex fields and are
> followed by a description field.
> >
> > Do you think otherwise?
>
> Regular output is for human consumption, JSON is for machine consumption.
> IMHO it makes sense to reasonably diverge and use the "correct" JSON type
> where available, even if the human-readable output is different. So numbers
> should IMHO be numbers, true / false, yes / no, off / on etc. should probably
> be booleans, arrays should be arrays, etc.
Ok, for both of you, will use ints instead of in JSON output.
Powered by blists - more mailing lists