[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<CY8PR02MB95670AA1F50BE4724098747DF9272@CY8PR02MB9567.namprd02.prod.outlook.com>
Date: Fri, 8 Mar 2024 10:24:19 +0000
From: "Sagar Dhoot (QUIC)" <quic_sdhoot@...cinc.com>
To: Michal Kubecek <mkubecek@...e.cz>
CC: Andrew Lunn <andrew@...n.ch>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
"Nagarjuna Chaganti (QUIC)"
<quic_nchagant@...cinc.com>,
"Priya Tripathi (QUIC)"
<quic_ppriyatr@...cinc.com>
Subject: RE: Ethtool query: Reset advertised speed modes if speed value is not
passed in "set_link_ksettings"
Hi Michal,
Thanks for your response.
Given that we don't have a straightforward way to do such
differentiation in the current framework, we will try to
manage this internally.
Thanks,
Sagar
-----Original Message-----
From: Michal Kubecek <mkubecek@...e.cz>
Sent: Friday, March 8, 2024 12:46 PM
To: Sagar Dhoot (QUIC) <quic_sdhoot@...cinc.com>
Cc: Andrew Lunn <andrew@...n.ch>; netdev@...r.kernel.org; Nagarjuna Chaganti (QUIC) <quic_nchagant@...cinc.com>; Priya Tripathi (QUIC) <quic_ppriyatr@...cinc.com>
Subject: Re: Ethtool query: Reset advertised speed modes if speed value is not passed in "set_link_ksettings"
On Fri, Mar 08, 2024 at 06:33:00AM +0000, Sagar Dhoot (QUIC) wrote:
> Hi Andrew,
>
> Thanks for the quick response. Maybe I have put up a confusing scenario.
>
> Let me rephrase with autoneg on.
>
> 1. "ethtool eth_interface"
> 2. "ethtool -s eth_interface speed 25000 autoneg on"
> 3. "ethtool -s eth_interface autoneg on"
>
> Once the link is up at step 2, "get_link_ksettings" will return the
> speed as 25G. And if "set_link_ksettings" is invoked at step 3, it
> will still pass the speed value as 25G retrieved with
> "get_link_ksettings", even though the speed was not explicitly
> specified in the ethtool command. So, after step2, if I must go back
> to the default state i.e., advertise all the supported speed modes, is
> there any way to do so?
IIRC this is backward compatible with how the ioctl interface behaves.
The logic is that if a parameter is omitted, it is supposed to be preserved; thus the third command simply means "enable the autonegotiation" and don't do anything else (which is a no-op in this case).
But I agree that it would be convenient to have a shortcut for "enable the autonegotiation with all supported modes". On the command line it could be e.g. something like
ethtool -s $iface autoneg on advertise all
or
ethtool -s $iface autoneg on advertise supported
On the implementation level, the problem is that IIRC we have no easy way to express such request in current netlink API. It could be emulated by querying the modes first (which returns both advertised and supported
modes) and requesting supported modes to be advertised but that's not very practical. So probably the best solution would be introducing a new flag and using the complicated way as a fallback if the kernel does not support it.
Michal
Powered by blists - more mailing lists