Access DOM of fiber interface

Hi everybody,

my router has an SFP cage which I populated with a 1Gbase-BX module, that per manufacturer's specs is DOM capable. How do I access the DOM information?

The generic way to do that seems to involve the ethtool command line tool. However, it appears, OpenWRT only has a crippled version of it (as so often, see nc for another sad case :disappointed_face:) that has essential functionality removed. Instead of a fully decoded DOM info, like this from a server running Ubuntu (shortened)

# ethtool -m enp1s0f0
	Identifier                                : 0x03 (SFP)
	Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
	Connector                                 : 0x07 (LC)
	Transceiver codes                         : 0x10 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00
	Transceiver type                          : 10G Ethernet: 10G Base-SR
	Transceiver type                          : Ethernet: 1000BASE-SX
	Encoding                                  : 0x06 (64B/66B)
	BR, Nominal                               : 10300MBd
	Rate identifier                           : 0x02 (8/4/2G Rx Rate_Select only)
	Length (SMF,km)                           : 0km
	Length (SMF)                              : 0m
	Length (50um)                             : 80m
	Length (62.5um)                           : 30m
	Length (Copper)                           : 0m
	Length (OM3)                              : 300m
	Laser wavelength                          : 850nm
	Vendor name                               : Intel Corp
...
	Optical diagnostics support               : Yes
	Laser bias current                        : 6.020 mA
	Laser output power                        : 0.4739 mW / -3.24 dBm
	Receiver signal average optical power     : 0.6010 mW / -2.21 dBm
	Module temperature                        : 28.13 degrees C / 82.64 degrees F
	Module voltage                            : 3.3061 V
	Alarm/warning flags implemented           : Yes
	Laser bias current high alarm             : Off
	Laser bias current low alarm              : Off
...

all I get is a raw data dump:

# ethtool -m eth0
Offset		Values
------		------
0x0000:		03 04 07 00 00 00 40 00 00 00 00 01 0d 00 14 c8 
0x0010:		00 00 00 00 46 53 20 20 20 20 20 20 20 20 20 20 
0x0020:		20 20 20 20 00 64 9d 99 53 46 50 2d 47 45 2d 42 
0x0030:		58 20 20 20 20 20 20 20 20 20 20 20 05 1e 20 37 
0x0040:		20 0a 00 00 47 32 32 33 30 30 38 38 34 31 36 20 
0x0050:		20 20 20 20 32 32 30 38 30 39 20 20 68 90 01 81 
...
0x01f0:		00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

The reason appears to be

# ethtool --version
ethtool version 6.11 (pretty dumps disabled)

Somebody seems to have thought pretty dumps are bloat that can be removed. Well, it isn't.

Is there a build variant of ethtool with pretty dumps enabled that I can install? How to do that (there seems to be no other package with 'ethtool' in the name in the opkg packet database)? Or is there another way of accessing the DOM data, or another way to decode the raw data dumped by ethtool?

Cheers Peter

Have you tried installing ethtool-full in place of the ethtool base package? From command line:

#apk update && apk add ethtool-full

That package name was the key! Thank you very much!

Have you tried installing ethtool-full in place of the ethtool base package?

I have not. I was not aware of a package of that name. The online package search facility at repology.org lists 'ethtool' but not 'ethtool-full'. When searching specifically for that name, repology tells me there is no such package.

#apk update && apk add ethtool-full

There is no apk in OpenWRT, this is not Alpine.
What I did is

# opkg update
# opkg remove ethtool
# opkg install ethtool-full

This indeed gives me a non-pretty-dump-disabled version, and sure enough, it nicely decodes my DOM data.
Problem solved. Thanks.

Lesson learned: Do not trust the online package seach facility.

FYI, apk is the new and improved default package manager from next stable version onward. It is, indeed, the very same one used in Alpine.
opkg is still valid for older releases but be warned that it won't be there anymore once (if) you upgrade to next (?) stable or newer.

Edit: removed wrong version to avoid spreading misinformation

OpenWrt has also a package listing but best is to query the package tool directly.
Because you are surprised by ethtool full, let me introduce you my best friend ip-full :wink:

1 Like

Good information, thanks.

???
When I installed this version 24.10 less than a month ago it was listet as current stable. So what is current stable?

Apk's been the default manager in snapshots since before the release of 24.10 so I thought it would have made it into stable branch by now. Looks like the switch has not happened just yet but it will definitely come "soon-ish" as it's already decided. Here's the main thread about it if you wanna learn more: https://forum.openwrt.org/t/the-future-is-now-opkg-vs-apk

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.