From: Bastian Germann <redacted>
Currently there is a filter for showing the MDI-X info. It is only
presented for twisted pair ports, which suppresses the info, e.g., for MII.
I found that issue running ethtool on a br53 switch port.
Despite the enum names, I cannot find documentation on the MDIX fields only
being valid for twisted pair ports -- if they are present, they should be
valid. But maybe I am mistaken.
Additionally, fix a duplicate condition.
Bastian Germann (2):
netlink: settings: Correct duplicate condition
netlink: settings: Drop port filter for MDI-X
netlink/settings.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
2.30.2
From: Bastian Germann <redacted>
tb's fields ETHTOOL_A_LINKINFO_TP_MDIX and ETHTOOL_A_LINKINFO_TP_MDIX_CTRL
are used in this case. The condition is duplicate for the former. Fix that.
Signed-off-by: Bastian Germann <redacted>
---
netlink/settings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Bastian Germann <redacted>
The port == PORT_TP condition on printing linkinfo's MDI-X field prevents
ethtool from printing that info even if it is present and valid, e.g. with
the port being MII and still having that info.
Signed-off-by: Bastian Germann <redacted>
---
netlink/settings.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
From: Michal Kubecek <hidden> Date: 2021-10-27 19:59:29
On Wed, Oct 27, 2021 at 08:11:40PM +0200, bage@linutronix.de wrote:
quoted hunk
From: Bastian Germann <redacted>
The port == PORT_TP condition on printing linkinfo's MDI-X field prevents
ethtool from printing that info even if it is present and valid, e.g. with
the port being MII and still having that info.
Signed-off-by: Bastian Germann <redacted>
---
netlink/settings.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
It's a bit more complicated, I'm afraid. With current kernel code, both
ETHTOOL_A_LINKINFO_TP_MDIX and ETHTOOL_A_LINKINFO_TP_MDIX_CTRL will be
always present in kernel reply so that we would always show something.
Also, the same condition is also used in ioctl code path and we should
try to keep the output consistent between ioctl and netlink.
How about replacing "port == PORT_TP" with
(port == TP || mdix != ETH_TP_MDI_INVALID || mdix_ctrl != ETH_TP_MDI_INVALID)
in both code path and probably moving the check into dump_mdix()?
We could (and perhaps should) also modify kernel code to omit
ETHTOOL_A_LINKINFO_TP_MDIX or ETHTOOL_A_LINKINFO_TP_MDIX_CTRL if the
value is ETH_TP_MDI_INVALID but ethtool would still have to check for
both options (absence and ETH_TP_MDI_INVALID value) to preserve
compatibility with older kernels.
Michal
From: Michal Kubecek <hidden> Date: 2021-10-27 20:13:20
On Wed, Oct 27, 2021 at 08:11:39PM +0200, bage@linutronix.de wrote:
quoted hunk
From: Bastian Germann <redacted>
tb's fields ETHTOOL_A_LINKINFO_TP_MDIX and ETHTOOL_A_LINKINFO_TP_MDIX_CTRL
are used in this case. The condition is duplicate for the former. Fix that.
Signed-off-by: Bastian Germann <redacted>
---
netlink/settings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Michal Kubecek <hidden> Date: 2021-10-27 20:17:34
On Wed, Oct 27, 2021 at 09:59:23PM +0200, Michal Kubecek wrote:
How about replacing "port == PORT_TP" with
(port == TP || mdix != ETH_TP_MDI_INVALID || mdix_ctrl != ETH_TP_MDI_INVALID)
in both code path and probably moving the check into dump_mdix()?
Looking at the code again, we cannot move the check into dump_mdix()
easily as decision if print_banner(nlctx) should be called depends on
its result.
Michal
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-10-28 15:30:33
Hi Bastian
I found that issue running ethtool on a br53 switch port.
Is this on the user ports? With copper PHYs? Did you try fixing the
driver so it actually sets TP?
Despite the enum names, I cannot find documentation on the MDIX fields only
being valid for twisted pair ports -- if they are present, they should be
valid. But maybe I am mistaken.
I'm not sure that is true. I've never seen an SFP module that can swap
around the two fibres if they happen to be the wrong way around. And
it makes no sense for BNC based cheapernet, if that actually still
exists anywhere.
Andrew