[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240308071544.dnh47hijov3aqbzu@lion.mk-sys.cz>
Date: Fri, 8 Mar 2024 08:15:44 +0100
From: Michal Kubecek <mkubecek@...e.cz>
To: "Sagar Dhoot (QUIC)" <quic_sdhoot@...cinc.com>
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"
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
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists