[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa21ef50-7f36-3d01-5ecf-4a2832bcec89@gmail.com>
Date: Tue, 30 May 2023 11:31:04 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>, netdev <netdev@...r.kernel.org>,
Russell King <rmk+kernel@...linux.org.uk>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Oleksij Rempel <linux@...pel-privat.de>
Subject: Re: [RFC/RFTv3 00/24] net: ethernet: Rework EEE
Hi Andrew, Russell,
On 3/30/23 17:54, Andrew Lunn wrote:
> Most MAC drivers get EEE wrong. The API to the PHY is not very
> obvious, which is probably why. Rework the API, pushing most of the
> EEE handling into phylib core, leaving the MAC drivers to just
> enable/disable support for EEE in there change_link call back, or
> phylink mac_link_up callback.
>
> MAC drivers are now expect to indicate to phylib/phylink if they
> support EEE. If not, no EEE link modes are advertised. If the MAC does
> support EEE, on phy_start()/phylink_start() EEE advertisement is
> configured.
Thanks for doing this work, because it really is a happy mess out there.
A few questions as I have been using mvneta as the reference for fixing
GENET and its shortcomings.
In your new patches the decision to enable EEE is purely based upon the
eee_active boolean and not eee_enabled && tx_lpi_enabled unlike what
mvneta useed to do.
Russell, is there an use case for having eee_enabled while not having
tx_lpi_enabled?
With the candidate patch attached, I have the following behavior on boot
with no specific ethtool operation:
# ethtool --show-eee eth0
EEE Settings for eth0:
EEE status: enabled - active
Tx LPI: disabled
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: 100baseT/Full
1000baseT/Full
Link partner advertised EEE link modes: 100baseT/Full
1000baseT/Full
#
however EEE is not *really* enabled at the hardware level unless I do
another:
# ethtool --set-eee eth0 tx-lpi on
# ethtool --show-eee eth0
EEE Settings for eth0:
EEE status: enabled - active
Tx LPI: 34 (us)
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: 100baseT/Full
1000baseT/Full
Link partner advertised EEE link modes: 100baseT/Full
1000baseT/Full
We have a global EEE enable bit which is described as "If set, the TX
LPI policy control engine is enabled and the MAC inserts LPI_idle codes
if the link is idle", so it would seem to me that we should require
users to set both "eee on" and "tx-lpi on" in their ethtool command, but
then unless we intentionally override tx_lpi_enabled in the driver upon
probe, there will be any automagical configuration happening, and no
power savings being realized.
Do you have any recommendations on what drivers should do? As you could
see from the need of this patch series, we already all created our own
little schisms of the cargo cult.
Thanks!
--
Florian
View attachment "0001-net-bcmgenet-Fix-EEE-implementation.patch" of type "text/x-patch" (4226 bytes)
Powered by blists - more mailing lists