netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Ethtool query: Reset advertised speed modes if speed value is not passed in "set_link_ksettings"
@ 2024-03-07 10:09 Sagar Dhoot (QUIC)
  2024-03-08  4:14 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Sagar Dhoot (QUIC) @ 2024-03-07 10:09 UTC (permalink / raw)
  To: mkubecek@suse.cz, netdev@vger.kernel.org
  Cc: Nagarjuna Chaganti (QUIC), Priya Tripathi (QUIC)

Hi Michal and Team,

We are developing an Ethernet driver here in Qualcomm and have a query w.r.t one of the limitations that we have observed with ethtool.

Requirement:
	- We are trying to manage the advertised speed modes based on the input from "ethtool -s" command, and trying to support options like "speed", "autoneg" and "lanes".
	- By default, the "get_link_ksettings" will publish all the supported/advertised speed modes.
	- If the speed is modified using "set_link_ksettings", we will limit the advertised speed mode corresponding to the speed being passed in the ethtool command.
	- And if in the subsequent "set_link_ksettings" command, if the speed is not provided, we want to reset and go back to the default state(i.e. again publish all the supported/advertised speed modes).

Detailed issue sequence and the commands executed:
1. "ethtool eth_interface"
	a. Assuming eth_interface is the interface name.
	b. By default, the "get_link_ksettings" will publish all the supported/advertised speed modes. Let's say we support 10G and 25G. In that case both speed modes will be advertised in the ethtool output.
2. "ethtool -s eth_interface speed 25000 autoneg off"
	a. "set_link_ksettings" will be called and speed value will be passed as 25G.
	b. Advertised speed mode will be restricted to 25G.
	c. Link comes up fine with 25G.
3. "ethtool eth_interface"
	a. "get_link_ksettings" will publish the link as up with 25G in the ethtool output. Advertised speed mode will be set to 25G and 10G will not be included in that list.
4. "ethtool -s eth_interface autoneg off"
	a. "get_link_ksettings" will be called and as per our implementation, as the link as up, we will return the speed as 25G.
	b. "set_link_ksettings" will be called and speed will still be provided as 25G(from step 4a), even though the user has not provided any speed value in the ethtool command.
	c. We will still restrict the advertised speed to 25G. Whereas the expectation was that we reset back to a combination of 10G and 25G again.

So basically, we are trying to understand if there is a way in "set_link_ksettings" to differentiate if the speed value was passed by the user, or not. In short, a way to differentiate between:
	- Speed value explicitly passed by user via ethtool command as seen in step 2a.
		v/s
	- Speed value not set by user but still being passed after queried with "get_link_ksettings" in step 4b.


Can you please help investigate this query and let us know if you need any further details. Thanks in advance!


Thanks,
Sagar


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-08 15:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07 10:09 Ethtool query: Reset advertised speed modes if speed value is not passed in "set_link_ksettings" Sagar Dhoot (QUIC)
2024-03-08  4:14 ` Andrew Lunn
2024-03-08  6:33   ` Sagar Dhoot (QUIC)
2024-03-08  7:15     ` Michal Kubecek
2024-03-08 10:24       ` Sagar Dhoot (QUIC)
2024-03-08 13:56     ` Andrew Lunn
2024-03-08 14:16       ` Michal Kubecek
2024-03-08 15:13         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).