[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIMxPROkFLI+EO9U@corigine.com>
Date: Fri, 9 Jun 2023 16:03:41 +0200
From: Simon Horman <simon.horman@...igine.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Marcin Wojtas <mw@...ihalf.com>,
netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH RFC net-next 4/4] net: mvpp2: add EEE implementation
On Fri, Jun 09, 2023 at 10:11:31AM +0100, Russell King (Oracle) wrote:
> Add EEE support for mvpp2, using phylink's EEE implementation, which
> means we just need to implement the two methods for LPI control, and
> with the initial configuration. Only the GMAC is supported, so only
> 100M, 1G and 2.5G speeds.
>
> Disabling LPI requires clearing a single bit. Enabling LPI needs a full
> configuration of several values, as the timer values are dependent on
> the MAC operating speed.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
...
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index adc953611913..a06c455b7180 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -5716,6 +5716,31 @@ static int mvpp2_ethtool_set_rxfh_context(struct net_device *dev,
>
> return mvpp22_port_rss_ctx_indir_set(port, *rss_context, indir);
> }
> +
> +static int mvpp2_ethtool_get_eee(struct net_device *dev,
> + struct ethtool_eee *eee)
> +{
> + struct mvpp2_port *port = netdev_priv(dev);
> +
> + if (!port->phylink)
> + return -ENOTSUPP;
Hi Russell,
perhaps EOPNOTSUPP is more appropriate here.
> +
> + return phylink_ethtool_get_eee(port->phylink, eee);
> +}
> +
> +static int mvpp2_ethtool_set_eee(struct net_device *dev,
> + struct ethtool_eee *eee)
> +{
> + struct mvpp2_port *port = netdev_priv(dev);
> +
> + if (!port->phylink)
> + return -ENOTSUPP;
And here.
> +
> + if (eee->tx_lpi_timer > 255)
> + eee->tx_lpi_timer = 255;
> +
> + return phylink_ethtool_set_eee(port->phylink, eee);
> +}
> /* Device ops */
>
> static const struct net_device_ops mvpp2_netdev_ops = {
...
Powered by blists - more mailing lists