Skip to contentSkip to conversation

fix MDI-X showing as Unknown instead of "off (auto)"

PATCH New Michal Schmidt 1 participant 1 message Feb 12, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix MDI-X showing as Unknown instead of "off (auto)"

The current version of ethtool is unable to show the correct MDI-X info:

 # ethtool --version
 ethtool version 6.11
 # ethtool enp0s31f6 | grep MDI
     MDI-X: Unknown

For comparison, an older version shows it correctly:

 # ./ethtool --version
 ethtool version 6.2
 # ./ethtool enp0s31f6 | grep MDI
     MDI-X: off (auto)

The blamed commit accidentally removed the ETH_TP_MDI switch case in dump_mdix(). As a result, ETH_TP_MDI is treated like Unknown.

Fix it by restoring the ETH_TP_MDI case and breaking out. 'mdi_x' is initialized to false, which is correct for this case.

Fixes bd1341cd2146 ("add json support for base command")
---
 common.c | 2 ++
 1 file changed, 2 insertions(+)
common.c +2 -0
index 4fda4b49d2fd..1ba27e7577b4 100644
@@ -171,6 +171,8 @@ void dump_mdix(u8 mdix, u8 mdix_ctrl)
 		mdi_x_forced = true;
 	} else {
 		switch (mdix) {
+		case ETH_TP_MDI:
+			break;
 		case ETH_TP_MDI_X:
 			mdi_x = true;
 			break;
Signature · 1 line
2.48.1