netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool 0/2] Add JSON support for SFP EEPROM dump
@ 2022-07-04  5:41 Mathew McBride
  2022-07-04  5:41 ` [PATCH ethtool 1/2] ethtool: add JSON output to --module-info Mathew McBride
  2022-07-04  5:41 ` [PATCH ethtool 2/2] ethtool: remove restriction on ioctl commands having JSON output Mathew McBride
  0 siblings, 2 replies; 5+ messages in thread
From: Mathew McBride @ 2022-07-04  5:41 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: netdev, Mathew McBride

This patch adds JSON output support to ethtool's -m option,
useful for presenting transceiver module option in a web interface.

An example frontend can be found here, for OpenWrt's LuCI:
https://gitlab.com/traversetech/muvirt-feed/-/tree/master/sfp-diagnostics-luci

You can find samples of the output, plus a screenshot here:
10GBASE-LR SFP:
https://gitlab.com/-/snippets/2364354
1/10GBASE-LR dual mode SFP
https://gist.github.com/mcbridematt/7921c795c4835afa807d8f83cc132401

I have tried to make the JSON format easy to consume by including both
the original field values and full text descriptions, so any consumer
of the JSON output doesn't need to replicate ethtool's rendering logic.

I'm open to any suggestions on how the structure of the JSON output
could be improved.

Mathew McBride (2):
  ethtool: add JSON output to --module-info
  ethtool: remove restriction on ioctl commands having JSON output

 ethtool.c    |   8 +-
 sff-common.c | 213 +++++++++++++++--------
 sff-common.h |  17 +-
 sfpdiag.c    |  64 ++++++-
 sfpid.c      | 478 +++++++++++++++++++++++++++++++--------------------
 5 files changed, 522 insertions(+), 258 deletions(-)

-- 
2.30.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-06 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04  5:41 [PATCH ethtool 0/2] Add JSON support for SFP EEPROM dump Mathew McBride
2022-07-04  5:41 ` [PATCH ethtool 1/2] ethtool: add JSON output to --module-info Mathew McBride
2022-10-06 15:29   ` Michal Kubecek
2022-07-04  5:41 ` [PATCH ethtool 2/2] ethtool: remove restriction on ioctl commands having JSON output Mathew McBride
2022-10-06 15:23   ` Michal Kubecek

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).