Skip to content

Add JSON support for SFP EEPROM dump

Mathew McBride netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ethtool: add JSON output to --module-infoethtool.c sff-common.c sff-common.h +2 more+522 -2551 reply
2/2ethtool: remove restriction on ioctl commands having JSON outputethtool.c+0 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH ethtool 0/2] Add JSON support for SFP EEPROM dump

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(-)
Signature · 1 line
2.30.1