Re: [PATCH] usbnet: Set duplex status to unknown in the absence of MII
From: Oliver Neukum <oneukum@suse.com>
Date: 2025-07-23 10:03:09
Also in:
linux-usb
On 23.07.25 10:44, yicongsrfy@163.com wrote:
On Wed, 23 Jul 2025 09:17:02 +0200 Oliver [off-list ref] wrote:quoted
On 23.07.25 03:29, yicongsrfy@163.com wrote:quoted
From these two tests, we can conclude that both full-duplex and half-duplex modes are supported — the problem is simply that the duplex status cannot be retrieved in the absence of MII support.Sort of. You are asking a generic driver to apply a concept from ethernet. It cannot. Ethernet even if it is half-duplex is very much symmetrical in speed. Cable modems do not, just to give an example. I think we need to centralize the reaction to stuff that is not ethernet.Thanks! I think I understand what you mean now. You're suggesting to create a unified interface or framework to retrieve the duplex status of all CDC protocol-supported devices?
Well no. We have to understand that the difference in duplex status apply only to a subset of devices. In a way the network layer is deficient in only having an unknown status rather than an unknown and an inapplicable status. If we are to retain a single status for simplicity, then I'd say that the default being half duplex rather than unknown is wrong.
This seems like a rather big undertaking, and one of the key reasons is that the CDC protocol itself does not define anything related to duplex status — unlike the 802.3 standard, which clearly defines how to obtain this information via MDIO.
CDC is not a network protocol. CDC is a protocol for talking to network devices. CDC can define a way to transmit duplex information. If the protocol under CDC does not have the notion, this will be of no use.
Coming back to the issue described in this patch, usbnet_get_link_ksettings_internal is currently only used in cdc_ether.c and cdc_ncm.c as a callback for ethtool. Can we assume that this part only concerns Ethernet devices (and that, at least for now, none of the existing devices can retrieve the duplex status through this interface)?
Yes. It is not really that important. But strictly speaking the network layer is using the wrong default. Regards Oliver