ethtool: Add 'pages on|off' option for module EEROM hex dump
Subsystems (2)
cover ethtool: Add 'pages on|off' option for module EEROM hex dump
The existing 'ethtool -m' command can dump module EEPROM data either as a parsed pretty-print or as a raw/hex dump. The pretty-printer reads multiple pages per module type, but decodes only specific fields from them.
In practice, both outputs are often needed together for offline debugging:
the pretty-print to identify the module type and decoded fields, and the hex dump for fields the pretty-printer does not decode. However, there is no single command that provides the raw hex dump of all relevant pages, organized by page boundary. This is especially problematic for CMIS transceivers where the existing hex dump does not provide Upper Pages beyond Page 02h, let alone banked pages.
This series adds 'pages on|off' sub-option to 'hex on|off' for 'ethtool -m':
$ ethtool -m hex on pages on
That produces a hex dump organized by page, matching exactly the pages read by the pretty-printer for each module type.
Each page is preceded by a header identifying the page number and, for banked modules, the bank number. For SFP, where the two memory regions are separate I2C addresses rather than pages, the header shows the I2C address instead.
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0
Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Page: 0x0
Offset Values ------ ------ 0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Danielle Ratson (5):
module-common: Add module_dump_eeprom_page_hex() helper
sfpid: Refactor sff8079_show_all_nl() to separate page retrieval from
display
module: Add per-type EEPROM page hex dump functions
netlink: module-eeprom: Add 'hex on pages on' option for
page-organized hex dump
ethtool: Add man page and bash completion for 'pages on|off'
cmis.c | 49 +++++++++++++++++++++++---- cmis.h | 2 +- ethtool.8.in | 14 ++++++++ ethtool.c | 1 + internal.h | 4 +-- module-common.c | 16 +++++++++ module-common.h | 3 ++ netlink/module-eeprom.c | 43 ++++++++++++++++++++---- qsfp.c | 48 +++++++++++++++++++++++---- sfpid.c | 62 +++++++++++++++++++++++++---------- shell-completion/bash/ethtool | 2 ++ 11 files changed, 202 insertions(+), 42 deletions(-)
Signature · 1 line
2.51.0
PATCH 2/5 sfpid: Refactor sff8079_show_all_nl() to separate page retrieval from display
Restructure sff8079_show_all_nl() to first retrieve all the necessary pages (A0h and optionally A2h) and then pretty-print them, matching the pattern already used in cmis_show_all_nl() and sff8636_show_all_nl().
This prepares for the next patch which extends the function with a hex dump mode.
Note that if reading A2h fails, the function now returns an error without producing partial output, matching the behavior of the other parsers.
--- sfpid.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
sfpid.c +16 -13
@@ -500,6 +500,7 @@ static int sff8079_get_eeprom_page(struct cmd_context *ctx, u8 i2c_address,int sff8079_show_all_nl (struct cmd_context *ctx) { +bool a2h_present;u8 *buf;int ret;
@@ -516,24 +517,26 @@ int sff8079_show_all_nl(struct cmd_context *ctx)if (ret) goto out; +/* Check if A2h page is present */ + a2h_present = buf[92 ] & (1 <<6 ); + +if (a2h_present) { +/* Read A2h page */ + ret =sff8079_get_eeprom_page (ctx,SFF8079_I2C_ADDRESS_HIGH , + buf +ETH_MODULE_SFF_8079_LEN ); +if (ret) { +fprintf (stderr,"Failed to read Page A2h\n" ); + goto out; + } + } +new_json_obj (ctx->json);open_json_object (NULL );sff8079_show_all_common (buf); -/* Finish if A2h page is not present */ -if (!(buf[92 ] & (1 <<6 ))) - goto out_json; - -/* Read A2h page */ - ret =sff8079_get_eeprom_page (ctx,SFF8079_I2C_ADDRESS_HIGH , - buf +ETH_MODULE_SFF_8079_LEN ); -if (ret) { -fprintf (stderr,"Failed to read Page A2h.\n" ); - goto out_json; - } +if (a2h_present) +sff8472_show_all (buf); -sff8472_show_all (buf); -out_json:close_json_object ();delete_json_obj (); out:
Signature · 1 line
2.51.0
PATCH 1/5 module-common: Add module_dump_eeprom_page_hex() helper
In reply to Danielle RatsonAdd module_dump_eeprom_page_hex() to module-common.c as the shared building block for per-type EEPROM page hex dump functions.
It prints a per-page header (page number and optional bank) followed by a hex dump in the established ethtool format, using dump_hex().
--- module-common.c | 16 ++++++++++++++++ module-common.h | 3 +++ 2 files changed, 19 insertions(+)
module-common.c +16 -0
@@ -7,6 +7,7 @@#include <math.h> #include <ctype.h> #include "module-common.h" +#include "internal.h" const struct module_aw_mod module_aw_mod_flags[] = { {MODULE_TYPE_CMIS ,"Module temperature high alarm" ,
@@ -656,3 +657,18 @@ void module_show_dom_mod_lvl_monitors(const struct sff_diags *sd)PRINT_VCC_ALL ("Module voltage" ,"module_voltage_measurement" , sd->sfp_voltage[MCURR ]); } + +/* Print one EEPROM page with a descriptive header followed by hex dump. +* When bank is non-zero it is included in the header. +*/ +void module_dump_eeprom_page_hex (const u8 *data,u8 bank,u8 page, +u32 offset,u32 length) +{ +if (bank) +printf ("Bank: 0x%x, Page: 0x%x\n\n" , bank, page); +else +printf ("Page: 0x%x\n\n" , page); + +dump_hex (stdout, data, length, offset); +printf ("\n" ); +}
module-common.h +3 -0
@@ -284,4 +284,7 @@ void module_show_connector(const __u8 *id, int ctor_offset);void module_show_mit_compliance (u16 value);void module_show_dom_mod_lvl_monitors (const struct sff_diags *sd); +void module_dump_eeprom_page_hex (const u8 *data,u8 bank,u8 page, +u32 offset,u32 length); +#endif /* MODULE_COMMON_H__ */
Signature · 1 line
2.51.0
PATCH 4/5 netlink: module-eeprom: Add 'hex on pages on' option for page-organized hex dump
In reply to Danielle RatsonAdd 'pages on|off' sub-option to 'hex on|off' for 'ethtool -m'. When 'hex on pages on' is specified, eeprom_parse() dispatches to the appropriate per-type function with dump_pages=true, producing a hex dump of all relevant EEPROM pages with a per-page header showing the page number and optional bank number.
eeprom_parse() is extended with a bool dump_pages parameter to select between pretty-print and hex dump output, avoiding duplication of the module-type dispatch logic.
Unlike plain 'hex on', 'hex on pages on' does not fall back to the ioctl path, as page selection is handled internally by the per-type functions.
Unknown module types fall back to dumping the lower 128 bytes.
'pages' and 'hex' are both parsed as independent flat options, since the parameter parser does not support context-dependent argument recognition. The requirement for 'hex on' when using 'pages on' is enforced by an explicit validation check.
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0
Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Page: 0x0
Offset Values ------ ------ 0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Note: 'Page: 0x0' appears twice in the output. The first block is the lower memory (bytes 0x00-0x7f), which is always accessible. The second block is upper memory page 00h (bytes 0x80-0xff). Both carry the same page label but are distinguished by their offset range in the hex dump.
--- ethtool.c | 1 + netlink/module-eeprom.c | 43 ++++++++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 7 deletions(-)
ethtool.c +1 -0
@@ -6165,6 +6165,7 @@ static const struct option args[] = { .help = "Query/Decode Module EEPROM information and optical diagnostics if available", .xhelp =" [ raw on|off ]\n" " [ hex on|off ]\n" +" [ pages on|off ]\n" " [ offset N ]\n" " [ length N ]\n" " [ page N ]\n"
netlink/module-eeprom.c +36 -7
97 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH 3/5 module: Add per-type EEPROM page hex dump functions
In reply to Danielle RatsonExtend sff8079_show_all_nl(), cmis_show_all_nl() and sff8636_show_all_nl() with a bool dump_pages parameter to support hex dump output alongside their existing pretty-print output. Each function first retrieves all the necessary pages and then either pretty-prints them or performs a hex dump according to the argument.
The hex dump and pretty-print logic is extracted into dedicated static functions for each parser type:
- cmis_hex_dump() / cmis_pretty_print()
- sff8636_hex_dump() / sff8636_pretty_print()
- sff8079_hex_dump() / sff8079_pretty_print()
Each function dumps the same pages as the corresponding pretty-printer:
- CMIS: uses cmis_memory_map_init_pages() to read the lower memory and relevant upper pages across all supported banks, using generic iteration over the memory map. Uses module_dump_eeprom_page_hex() for hex output.
- SFF-8636: uses sff8636_memory_map_init_pages() to read the lower memory and relevant upper pages, using generic iteration over the memory map. Uses module_dump_eeprom_page_hex() for hex output.
- SFF-8079: uses sff8079_get_eeprom_page() to read A0h lower and optional A2h lower and identifies each block by its I2C address. Uses dump_hex() directly with I2C address headers.
--- cmis.c | 49 +++++++++++++++++++++++++++++++++++------ cmis.h | 2 +- internal.h | 4 ++-- netlink/module-eeprom.c | 6 ++--- qsfp.c | 48 ++++++++++++++++++++++++++++++++++------ sfpid.c | 43 +++++++++++++++++++++++++++--------- 6 files changed, 122 insertions(+), 30 deletions(-)
cmis.c +42 -7
@@ -1022,6 +1022,43 @@ void cmis_show_all_ioctl(const __u8 *id)cmis_show_all_common (&map); } +static void cmis_hex_dump (const struct cmis_memory_map *map) +{ +u8 bank, page; + +module_dump_eeprom_page_hex (map->lower_memory,0 ,0x0 ,0 , +CMIS_PAGE_SIZE ); +for (bank =0 ; bank <CMIS_MAX_BANKS ; bank++) { +for (page =0 ; page <CMIS_MAX_PAGES ; page++) { +const __u8 *buf = map->upper_memory[bank][page]; + +if (!buf) +continue ; + +/* Upper memory starts at one page size into +* the buffer, since pages are accessed at +* offset between page size and twice the +* page size. +*/ +module_dump_eeprom_page_hex (buf +CMIS_PAGE_SIZE , bank, + page,CMIS_PAGE_SIZE , +CMIS_PAGE_SIZE ); + } + } +} + +static void cmis_pretty_print (struct cmd_context *ctx, +const struct cmis_memory_map *map) +{ +new_json_obj (ctx->json); +open_json_object (NULL ); + +cmis_show_all_common (map); + +close_json_object (); +delete_json_obj (); +} +static void cmis_request_init (struct ethtool_module_eeprom *request,u8 bank,u8 page,u32 offset) {
@@ -1117,21 +1154,19 @@ cmis_memory_map_init_pages(struct cmd_context *ctx,return 0 ; } -int cmis_show_all_nl (struct cmd_context *ctx) +int cmis_show_all_nl (struct cmd_context *ctx,bool dump_pages) {struct cmis_memory_map map = {};int ret; -new_json_obj (ctx->json); -open_json_object (NULL ); - ret =cmis_memory_map_init_pages (ctx, &map);if (ret <0 )return ret; -cmis_show_all_common (&map); -close_json_object (); -delete_json_obj (); +if (dump_pages) +cmis_hex_dump (&map); +else +cmis_pretty_print (ctx, &map);return 0 ; }
cmis.h +1 -1
@@ -201,6 +201,6 @@void cmis_show_all_ioctl (const __u8 *id); -int cmis_show_all_nl (struct cmd_context *ctx); +int cmis_show_all_nl (struct cmd_context *ctx,bool dump_pages);#endif /* CMIS_H__ */
internal.h +2 -2
@@ -381,14 +381,14 @@ int rxclass_rule_del(struct cmd_context *ctx, __u32 loc);/* Module EEPROM parsing code */ void sff8079_show_all_ioctl (const __u8 *id); -int sff8079_show_all_nl (struct cmd_context *ctx); +int sff8079_show_all_nl (struct cmd_context *ctx,bool dump_pages);/* Optics diagnostics */ void sff8472_show_all (const __u8 *id);/* QSFP Optics diagnostics */ void sff8636_show_all_ioctl (const __u8 *id,__u32 eeprom_len); -int sff8636_show_all_nl (struct cmd_context *ctx); +int sff8636_show_all_nl (struct cmd_context *ctx,bool dump_pages);/* FUJITSU Extended Socket network device */ int fjes_dump_regs (struct ethtool_drvinfo *info,struct ethtool_regs *regs);
netlink/module-eeprom.c +3 -3
@@ -228,18 +228,18 @@ static int eeprom_parse(struct cmd_context *ctx)case MODULE_ID_GBIC :case MODULE_ID_SOLDERED_MODULE :case MODULE_ID_SFP : -return sff8079_show_all_nl (ctx); +return sff8079_show_all_nl (ctx, false);case MODULE_ID_QSFP :case MODULE_ID_QSFP28 :case MODULE_ID_QSFP_PLUS : -return sff8636_show_all_nl (ctx); +return sff8636_show_all_nl (ctx, false);case MODULE_ID_QSFP_DD :case MODULE_ID_OSFP :case MODULE_ID_DSFP :case MODULE_ID_QSFP_PLUS_CMIS :case MODULE_ID_SFP_DD_CMIS :case MODULE_ID_SFP_PLUS_CMIS : -return cmis_show_all_nl (ctx); +return cmis_show_all_nl (ctx, false);#endif default :/* If we cannot recognize the memory map, default to dumping
qsfp.c +41 -7
71 lines not on this page · raw message
sfpid.c +33 -10
55 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH 5/5 ethtool: Add man page and bash completion for 'pages on|off'
In reply to Danielle RatsonAdd 'pages on|off' to the bash completion for ethtool -m and the ethtool man page.
The man page documents that 'pages on' requires 'hex on', describes the per-page header format, and notes that it cannot be combined with offset, length, page, bank or i2c parameters.
--- ethtool.8.in | 14 ++++++++++++++ shell-completion/bash/ethtool | 2 ++ 2 files changed, 16 insertions(+)
ethtool.8.in +14 -0
@@ -403,6 +403,7 @@ ethtool \- query or control network driver and hardware settings .I devname .B2 raw on off .B2 hex on off +.B2 pages on off .BN offset .BN length .BN page
@@ -1431,6 +1432,19 @@ allowed. In such a case and .I length parameters are treated relatively to EEPROM page boundaries. +When +.B hex on pages on +is specified, dumps all relevant EEPROM pages in hex, organized by page. +Each page is preceded by a header identifying the page number and, for +banked pages, the bank number. For SFP modules, the header shows the +I2C address instead, as different parts of the EEPROM memory map are +accessible via different I2C addresses. The set of pages dumped matches +what the pretty-printer reads for each module type. This option cannot be +combined with +.I offset, length, page, bank +or +.I i2c +parameters. .TP .B \-\-show\-priv\-flags Queries the specified network device for its private flags. The
shell-completion/bash/ethtool +2 -0
@@ -671,11 +671,13 @@ _ethtool_module_info() [hex]=1 [length]=1 [offset]=1 + [pages]=1 [raw]=1 ) case "$prev" in hex|\ + pages|\ raw) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;;
Signature · 1 line
2.51.0
Quoted 12 lines · Danielle Ratson
The existing 'ethtool -m' command can dump module EEPROM data either as a parsed pretty-print or as a raw/hex dump. The pretty-printer reads multiple pages per module type, but decodes only specific fields from them.
In practice, both outputs are often needed together for offline debugging:
the pretty-print to identify the module type and decoded fields, and the hex dump for fields the pretty-printer does not decode. However, there is no single command that provides the raw hex dump of all relevant pages, organized by page boundary. This is especially problematic for CMIS transceivers where the existing hex dump does not provide Upper Pages beyond Page 02h, let alone banked pages.
Quoted 6 lines
This series adds 'pages on|off' sub-option to 'hex on|off' for 'ethtool -m':
$ ethtool -m hex on pages onThat produces a hex dump organized by page, matching exactly the pages read by the pretty-printer for each module type.
Do we need the "pages on|off" switch? Is there a reason not to show the full dump always (whenever possible) but only when requested explicitly?
Michal
Quoted 33 lines
Each page is preceded by a header identifying the page number and, for banked modules, the bank number. For SFP, where the two memory regions are separate I2C addresses rather than pages, the header shows the I2C address instead.
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00Page:
0x0Offset Values ------ ------ 0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Quoted 18 lines
In practice, both outputs are often needed together for offline debugging:
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Quoted 1 line
Page:
0x0
Maybe also add JSON? That would make machine parsing of this easier.
Andrew
Quoted 27 lines
-----Original Message-----
From: Michal Kubecek <[email protected]>
Sent: Thursday, 7 May 2026 15:08
To: Danielle Ratson <[email protected]>
Cc: [email protected]; Ido Schimmel <[email protected]>; Petr Machata <[email protected]>
Subject: Re: [PATCH ethtool-next 0/5] ethtool: Add 'pages on|off' option for module EEROM hex dumpQuoted 3 lines · Danielle Ratson
The existing 'ethtool -m' command can dump module EEPROM data either as a parsed pretty-print or as a raw/hex dump. The pretty-printer reads multiple pages per module type, but decodes only specific fields from
them.
Quoted 13 lines
In practice, both outputs are often needed together for offline debugging:
the pretty-print to identify the module type and decoded fields, and the hex dump for fields the pretty-printer does not decode. However, there is no single command that provides the raw hex dump of all relevant pages, organized by page boundary. This is especially problematic for CMIS transceivers where the existing hex dump does not provide Upper Pages beyond Page 02h, let alone banked pages.This series adds 'pages on|off' sub-option to 'hex on|off' for 'ethtool -m':
$ ethtool -m hex on pages on
Quoted 7 lines
Quoted 2 lines
That produces a hex dump organized by page, matching exactly the pages read by the pretty-printer for each module type.
Do we need the "pages on|off" switch? Is there a reason not to show the full dump always (whenever possible) but only when requested explicitly?
Michal
Thanks for the feedback.
The reason for keeping the switch is backward compatibility: today's ethtool -m hex on produces a single flat hex dump, while the page-organized output has a different shape - per-page headers, blank lines and repeated column headers interleaved between hex rows. Scripts that parse today's output could break.
For comparison, today's hex on looks like (values zeroed):
$ ethtool -m swp61 hex on Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
vs. the page-organized output in the cover letter, where each page is preceded by a Page: header and a fresh Offset/------ block.
Since the format changes shape and not just size, we kept it opt-in via pages on so existing consumers are unaffected. Are you OK with this even so it might break some existing usage?
Thanks,
Danielle
Quoted 34 lines
Quoted 34 lines
Each page is preceded by a header identifying the page number and, for banked modules, the bank number. For SFP, where the two memory regions are separate I2C addresses rather than pages, the header shows the I2C address instead.
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00Page:
0x0Offset Values ------ ------ 0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Quoted 5 lines · Danielle Ratson
The reason for keeping the switch is backward compatibility: today's ethtool -m hex on produces a single flat hex dump, while the page-organized output has a different shape - per-page headers, blank lines and repeated column headers interleaved between hex rows. Scripts that parse today's output could break.
[...]
Quoted 2 lines
Since the format changes shape and not just size, we kept it opt-in via pages on so existing consumers are unaffected. Are you OK with this even so it might break some existing usage?
Good point, there may indeed be existing scripts that would not handle changed (default) output format. While I would personally prever the binary dump for machine processing, people often parse text outputs that were never meant to be used that way.
I suppose your approach is a safer choice then.
Michal
Quoted 27 lines
-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Thursday, 7 May 2026 15:23
To: Danielle Ratson <[email protected]>
Cc: [email protected]; [email protected]; Ido Schimmel <[email protected]>; Petr Machata <[email protected]>
Subject: Re: [PATCH ethtool-next 0/5] ethtool: Add 'pages on|off' option for module EEROM hex dumpQuoted 18 lines
In practice, both outputs are often needed together for offline debugging:
Output example (values zeroed to omit vendor-specific identifiers):
$ ethtool -m swp61 hex on pages on Page: 0x0Offset Values ------ ------ 0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Quoted 5 lines
Quoted 1 line
Page:
0x0Maybe also add JSON? That would make machine parsing of this easier.
Andrew
Hi,
Thanks for the feedback.
I can add JSON, but ill check it doesn’t expand the scope of this set too much. Otherwise, I think it might be better to have another series for that.
Thanks,
Danielle