5

I want to use ethtool to test a network cable with ethtool --cable-test and ethtool --cable-test-tdr.
I tried to do this (as root) on my machine (internal network adapter), two USB-to-Ethernet adapters and the internal adapter of the raspberry pi4.
In all cases I got Unsupported Operation. It seems that only specific devices and drivers support this feature.
Is there any list showing which ones? I could not find one myself.
On my machine I have arch linux, so I have the newest Linux kernel (6.6.6-arch1-1).

Would be really great if one of you can point me in the right direction, how to get this done.

TNT2k
  • 151

1 Answers1

4

I did the following:

Checked the source for ethtool to see what netlink messages it was using when querying cable test results (e.g. nl_cable_test and nl_cable_test_tdr). I then followed those through into the kernel driver source tree, and it looks like the following ethernet PHY drivers support basic cable test of some sort:

drivers/net/phy/at803x.c
drivers/net/phy/bcm-phy-lib.h
drivers/net/phy/nxp-c45-tja11xx.c
drivers/net/phy/nxp-tja11xx.c
drivers/net/phy/adin.c
drivers/net/phy/micrel.c
drivers/net/phy/bcm-phy-lib.c
drivers/net/phy/phy_device.c
drivers/net/phy/marvell.c
drivers/net/phy/microchip_t1.c
drivers/net/phy/bcm54140.c

... for a full list of supported NIC chips, you'd have to look at those source files and elsewhere in the code to see which NIC hardware that applies to.

The only one that supports TDR testing (as of Linux 6.7.0) was the Marvell phy driver. Other comments elsewhere in the source (e.g. NIC IC header files) suggest that various other chips also have some sort of hardware TDR functionality (including some ancient hardware), but it looks like they remain unimplemented.

The Marvell TDR test support seems to have been added by Andrew Lunn, and there are a couple of videos on YT in which he presents the work.

Update: TDR testing works on a Huawei AP5030DN with a work-in-progress patch https://github.com/openwrt/openwrt/issues/17077 - I'll update this answer with a list of known-working devices when this work is complete.

TimSmall
  • 111