From 05f370d7d80ccf0728c9434b89ced409a8cbb208 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Mon, 28 Apr 2025 18:24:28 +0200 Subject: [PATCH] Fix MDI-X showing as Unknown Resolves: RHEL-75979 --- ...owing-as-Unknown-instead-of-off-auto.patch | 45 +++++++++++++++++++ ethtool.spec | 7 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0001-fix-MDI-X-showing-as-Unknown-instead-of-off-auto.patch diff --git a/0001-fix-MDI-X-showing-as-Unknown-instead-of-off-auto.patch b/0001-fix-MDI-X-showing-as-Unknown-instead-of-off-auto.patch new file mode 100644 index 0000000..98960d4 --- /dev/null +++ b/0001-fix-MDI-X-showing-as-Unknown-instead-of-off-auto.patch @@ -0,0 +1,45 @@ +From c4874fb8866046ea62731399bc58740caeb154b7 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Wed, 12 Feb 2025 13:23:27 +0100 +Subject: [PATCH] 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") +Signed-off-by: Michal Schmidt +--- + common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/common.c b/common.c +index 4fda4b49d2fd..1ba27e7577b4 100644 +--- a/common.c ++++ b/common.c +@@ -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; +-- +2.49.0 + diff --git a/ethtool.spec b/ethtool.spec index 5a06504..e702a0d 100644 --- a/ethtool.spec +++ b/ethtool.spec @@ -2,13 +2,15 @@ Summary: Settings tool for Ethernet NICs Name: ethtool Epoch: 2 Version: 6.11 -Release: 4%{?dist} +Release: 5%{?dist} # {json_print,qsfp,sff-common}.{c,h} are GPL-2.0-or-later, rest is GPL-2.0-only License: GPL-2.0-only AND GPL-2.0-or-later URL: https://www.kernel.org/pub/software/network/%{name}/ Source0: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.xz Source1: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.sign Source2: https://keys.openpgp.org/vks/v1/by-fingerprint/D2CB120AB45957B721CD9596F4554567B91DE934 +# RHEL-75979 +Patch1: 0001-fix-MDI-X-showing-as-Unknown-instead-of-off-auto.patch BuildRequires: gnupg2, xz BuildRequires: gcc BuildRequires: libmnl-devel @@ -44,6 +46,9 @@ make check %{_mandir}/man8/%{name}.8* %changelog +* Mon Apr 28 2025 Michal Schmidt - 2:6.11-5 +- Fix MDI-X showing as Unknown (RHEL-75979) + * Mon Dec 9 2024 Ivan Vecera - 2:6.11-4 - Fixed gating