All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: netdev@vger.kernel.org
Cc: Michal Kubecek <mkubecek@suse.cz>,
	Fabian Pfitzner <f.pfitzner@pengutronix.de>,
	Corinna Vinschen <vinschen@redhat.com>,
	Ivan Vecera <ivecera@redhat.com>
Subject: [PATCH ethtool] fix MDI-X showing as Unknown instead of "off (auto)"
Date: Wed, 12 Feb 2025 13:23:27 +0100	[thread overview]
Message-ID: <20250212122327.42074-1-mschmidt@redhat.com> (raw)

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 <mschmidt@redhat.com>
---
 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.48.1


                 reply	other threads:[~2025-02-12 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250212122327.42074-1-mschmidt@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=f.pfitzner@pengutronix.de \
    --cc=ivecera@redhat.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=vinschen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.