Skip to content

Add JSON output to --module-info

Danielle Ratson netdev 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest16 patches 0 repliesNew
  2. v416 patches 2 repliesSuperseded
  3. v316 patches 9 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v214 patches2 repliesSuperseded
v114 patches24 repliesSuperseded

Changes in v5 from the cover letter

* Edit commit message patch #11.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16module_common: Add a new file to all the common code for all module typesMakefile.am cmis.c cmis.h +9 more+923 -9540 replies
2/16ethtool: Standardize Link Length field names across module typescmis.c qsfp.c sfpid.c+12 -110 replies
3/16sff_common: Move sff_show_revision_compliance() to qsfp.cqsfp.c sff-common.c sff-common.h+38 -390 replies
4/16cmis: Change loop order in cmis_show_dom_chan_lvl_flags()cmis.c+12 -130 replies
5/16qsfp: Reorder the channel-level flags list for SFF8636 module typemodule-common.c qsfp.c+95 -900 replies
6/16qsfp: Refactor sff8636_show_dom() by moving code into separate functionsqsfp.c+80 -460 replies
7/16module_common: Add helpers to support JSON printing for common value typesmodule-common.c module-common.h sff-common.c +1 more+374 -1060 replies
8/16cmis: Add JSON output handling to --module-info in CMIS modulescmis.c+189 -890 replies
9/16cmis: Enable JSON output support in CMIS modulescmis.c ethtool.c+7 -00 replies
10/16qsfp: Add JSON output handling to --module-info in SFF8636 modulesqsfp.c+331 -2050 replies
11/16qsfp: Enable JSON output support for SFF8636 modulesqsfp.c+6 -00 replies
12/16sfpid: Add JSON output handling to --module-info in SFF8079 modulessfpid.c+222 -1590 replies
13/16sfpdiag: Add JSON output handling to --module-info in SFF8472 modulessfpdiag.c+31 -160 replies
14/16ethtool: Enable JSON output support for SFF8079 and SFF8472 modulesethtool.c sfpid.c+8 -00 replies
15/16module_info: Add a new JSON file for units documentationmodule_info.json+191 -00 replies
16/16ethtool: Add '-j' support to ethtoolethtool.c+3 -20 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchJakub KicinskiAmit Cohen
1/16A-b
2/16A-b
3/16A-b
4/16A-b R-b
5/16A-b
6/16A-b
7/16A-b
8/16A-b
9/16A-b R-b
10/16A-b
11/16A-b
12/16A-b
13/16A-b
14/16A-b
15/16A-b
16/16A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH ethtool-next v5 00/16] Add JSON output to --module-info

Add JSON output for 'ethtool -m' / --module-info, following the guideline below:

1. Fields with description, will have a separate description field.
2. Units will be documented in a separate module-info.json file.
3. ASCII fields will be presented as strings.
4. On/Off is rendered as true/false.
5. Yes/no is rendered as true/false.
6. Per-channel fields will be presented as array, when each element represents a channel.
7. Fields that hold version, will be split to major and minor sub fields.

This patchset suppose to extend [1] to cover all types of modules.

Patchset overview:
Patches #1-#7: Preparations.
Patches #8-#9: Add JSON output support for CMIS compliant modules. Patches #10-#11: Add JSON output support for SFF8636 modules. Patches #12-#14: Add JSON output support for SFF8079 and SFF8472 modules. Patch #15: Add a new schema JSON file for units documentation. Patches #16: Add '-j' support to ethtool

[1] https://lore.kernel.org/all/[email protected]/

v5:
* Edit commit message patch #11.

v4:
Patch #10:
* In extended_identifier field, use an array for all descriptions instead of 3 different descriptions.
* Remove duplicated definition of YESNO() and ONOFF()
* defines.

v3:
* Remove unit fields from JSON output.
* Reword commit messages.
* Add patch #2 and #15.
* Enable properly JSON output support for SFF8079.
* Remove printings from fields that might be empty strings.
* Fix JSON output in sff8636_show_dom_mod_lvl_flags().

v2:
* In rx_power JSON field, add a type field to let the user know what type is printed in "value".
* Use uint instead of hexa fields in JSON context.
* Simplify sff8636_show_dom().
* Use "false" in module_show_lane_status() instead of "None" in JSON context.

Danielle Ratson (16):
module_common: Add a new file to all the common code for all module
types
ethtool: Standardize Link Length field names across module types
sff_common: Move sff_show_revision_compliance() to qsfp.c
cmis: Change loop order in cmis_show_dom_chan_lvl_flags()
qsfp: Reorder the channel-level flags list for SFF8636 module type
qsfp: Refactor sff8636_show_dom() by moving code into separate
functions
module_common: Add helpers to support JSON printing for common value
types
cmis: Add JSON output handling to --module-info in CMIS modules
cmis: Enable JSON output support in CMIS modules
qsfp: Add JSON output handling to --module-info in SFF8636 modules
qsfp: Enable JSON output support for SFF8636 modules
sfpid: Add JSON output handling to --module-info in SFF8079 modules
sfpdiag: Add JSON output handling to --module-info in SFF8472 modules
ethtool: Enable JSON output support for SFF8079 and SFF8472 modules
module_info: Add a new JSON file for units documentation
ethtool: Add '-j' support to ethtool

 Makefile.am             |   7 +-
 cmis.c                  | 493 +++++++++++-----------
 cmis.h                  |  65 ---
 ethtool.c               |  10 +-
 module-common.c         | 662 +++++++++++++++++++++++++++++
 module-common.h         | 287 +++++++++++++
 module_info.json        | 191 +++++++++
 netlink/module-eeprom.c |  26 +-
 qsfp.c                  | 894 +++++++++++++++++++++-------------------
 qsfp.h                  | 108 -----
 sff-common.c            | 348 ++++------------
 sff-common.h            | 119 ++----
 sfpdiag.c               |  52 ++-
 sfpid.c                 | 446 +++++++++++---------
 14 files changed, 2250 insertions(+), 1458 deletions(-)
 create mode 100644 module-common.c
 create mode 100644 module-common.h
 create mode 100644 module_info.json
Signature · 1 line
2.47.0