netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Marcin Wojtas <mw@semihalf.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [PATCH RFC net-next 0/4] phylink EEE support
Date: Fri, 9 Jun 2023 10:11:05 +0100	[thread overview]
Message-ID: <ZILsqV0gkSMMdinU@shell.armlinux.org.uk> (raw)

Hi,

There has been some recent discussion on generalising EEE support so
that drivers implement it more consistently. This has mostly focused
around phylib, but there are other situations where EEE may be useful.

To illustrate this, in both USGMII and UXGMII communicate EEE through
the configuration word - bit 8 indicates EEE capability and bit 7
indicates the clock stop capability. The PHY may not be accessible.
Another case would be a PHY on a SFP module that may not be accessible,
signalling LPI to it may result in power savings if it has negotiated
with the link partner. My understanding is that signalling LPI when
negotiation hasn't agreed EEE support should be fine. In the classic
model, LPI informs the PHY that the MAC is idle, and gives it
permission to enter low power. It will only enter low power when the
MAC sends LPI and the remote PHY also agrees to enter low power.

mvneta has had EEE support for a while, but the implementation has its
quirks. This series implements EEE handling in phylink. To make use of
it, a MAC driver needs to fill in the default parameters for EEE, and
provide the enable and disable functions for LPI.

This series also adds EEE for mvpp2, which is only supported by the
GMAC (up to 1G) and not the XLG (5G,10G) MAC.

There is further work that needs to be considered - 802.3 has the
facility to negotiate the Tw (wake to data) parameter via packets.
Also, timing parameters are speed and media type specific, some
implementations need these parameters reprogrammed each time the speed
changes (e.g. mvneta and mvpp2.)

Patch 1 adds a structure to store the runtime EEE configuration  state,
a helper to decode the state to indicate whether LPI can be enabled (it
remains the responsibility of the user to determine whether EEE has
been negotiated.) A couple of helpers are provided to insert and
extract the EEE configuration from the ethtool EEE structure.

Patch 2 adds the phylink implementation.

Patch 3 converts mvneta to use phylink's implementation.

Patch 4 adds mvpp2 support.

This uses the current code from phylib, and is only functional when we
have a phylib PHY, but can be easily extended so that when we have a
SFP socket without a PHY, we can enable LPI signalling.

 drivers/net/ethernet/marvell/mvneta.c           | 95 ++++++++++++++++---------
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      |  5 ++
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 85 ++++++++++++++++++++++
 drivers/net/phy/phylink.c                       | 82 +++++++++++++++++++--
 include/linux/phylink.h                         | 32 +++++++++
 include/net/eee.h                               | 38 ++++++++++
 6 files changed, 298 insertions(+), 39 deletions(-)
 create mode 100644 include/net/eee.h

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

             reply	other threads:[~2023-06-09  9:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  9:11 Russell King (Oracle) [this message]
2023-06-09  9:11 ` [PATCH RFC net-next 1/4] net: add helpers for EEE configuration Russell King (Oracle)
2023-06-09 13:52   ` Simon Horman
2023-06-09  9:11 ` [PATCH RFC net-next 2/4] net: phylink: add EEE management Russell King (Oracle)
2023-06-11 21:28   ` Andrew Lunn
2023-06-11 21:37     ` Russell King (Oracle)
2023-06-11 22:25       ` Andrew Lunn
2023-06-13  9:13         ` Russell King (Oracle)
2023-06-13 12:26           ` Andrew Lunn
2023-06-13 14:10             ` Russell King (Oracle)
2023-06-09  9:11 ` [PATCH RFC net-next 3/4] net: mvneta: convert to phylink EEE implementation Russell King (Oracle)
2023-06-09 14:02   ` Simon Horman
2023-06-09 14:31     ` Russell King (Oracle)
2023-06-09 18:25       ` Simon Horman
2023-06-09  9:11 ` [PATCH RFC net-next 4/4] net: mvpp2: add " Russell King (Oracle)
2023-06-09 14:03   ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZILsqV0gkSMMdinU@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).