[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <xnvoptvzs4ikkrvsyu77tgbtstoupoin4mttuyz5qaljgd4vg4@xqmpvzrvirpt>
Date: Mon, 31 Mar 2025 01:59:19 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: kernel@...gutronix.de, netdev@...r.kernel.org
Subject: Re: [PATCH ethtool v1 1/1] ethtool: fix incorrect MDI-X "Unknown"
output for MDI mode
On Mon, Mar 24, 2025 at 02:53:10PM +0100, Oleksij Rempel wrote:
> Add a missing case to handle the MDI mode correctly when showing the
> current MDI/MDI-X status. Without this, the code may show "Unknown" even
> when the status is valid. This regression was introduced in commit
> bd1341cd2146 ("add json support for base command").
>
> The logic assumed that `mdi_x = false` was already set at function start
> and omitted the `case ETH_TP_MDI:` branch in the switch statement. However,
> without an explicit `break`, the code continued into the default case,
> resulting in "Unknown" being printed even when the mode was valid.
>
> This patch adds a missing `case ETH_TP_MDI:` with an explicit `break` to
> avoid falling into the default case. As a result, users will now correctly
> see `MDI-X: off` instead of `Unknown` when the resolved state is MDI.
>
> Fixes: bd1341cd2146 ("add json support for base command")
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
> 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.39.5
>
Hello,
I applied the same fix submitted earlier by Michal Schmidt as commit
c4874fb88660 ("fix MDI-X showing as Unknown instead of "off (auto)"").
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists