[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3201b332-ce52-41c5-8743-a2122ae2a8f7@lunn.ch>
Date: Wed, 16 Oct 2024 14:07:19 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Daniel Zahka <daniel.zahka@...il.com>
Cc: mkubecek@...e.cz, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, idosch@...dia.com,
danieller@...dia.com
Subject: Re: [RFC ethtool] ethtool: mock JSON output for --module-info
On Tue, Oct 15, 2024 at 08:42:29PM -0400, Daniel Zahka wrote:
>
> On 10/15/24 7:16 PM, Andrew Lunn wrote:
> > > Vendor PN : QDD-400G-XDR4
> > > "vendor_name" : [65, 114, 105, 115, 116, 97, 32, 78, 101, 116, 119, 111,
> > > 114, 107, 115, 32],
> > > "vendor_pn" : [81, 68, 68, 45, 52, 48, 48, 71, 45, 88, 68, 82, 52],
> > > "vendor_sn" : [88, 75, 84, 50, 52, 50, 50, 49, 49, 52, 56, 49],
> > Why use byte arrays? String, maybe UTF-8, would be more natural.
> >
> > Andrew
>
> Ah, I mistakenly thought that the "-" characters in the vendor pn were put
> there by ethtool in place of non-printable characters, but I see now that
> those are just regular ASCII hyphens. The CMIS spec says that the four
> vendor_* fields all contain ASCII characters, but can possibly be all null
> characters.
It would be best to assume vendors ignore the CMIS spec and put in
characters outside of the ASCII range. I imaging GPON and cheap fibre
modules mess this up. So it seems safer to assume it is UTF-8. The
JSON format should handle that.
Andrew
Powered by blists - more mailing lists