lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240827-excuse-banister-30136f43ef50@spud>
Date: Tue, 27 Aug 2024 12:29:23 +0100
From: Conor Dooley <conor@...nel.org>
To: netdev@...r.kernel.org
Cc: conor@...nel.org,
	Steve Wilkins <steve.wilkins@...marine.com>,
	Conor Dooley <conor.dooley@...rochip.com>,
	valentina.fernandezalanis@...rochip.com,
	Nicolas Ferre <nicolas.ferre@...rochip.com>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>,
	linux-kernel@...r.kernel.org
Subject: [RFC net-next] net: macb: add support for configuring eee via ethtool

From: Steve Wilkins <steve.wilkins@...marine.com>

Add ethtool_ops for configuring Energy Efficient Ethernet in the PHY.

Signed-off-by: Steve Wilkins <steve.wilkins@...marine.com>
Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
---
Steve sent me this patch (modulo the eee -> keee change), but I know
nothing about the macb driver, so I asked Nicolas whether the patch
made sense. His response was:
> Interesting although I have the feeling that some support from our MAC
> is missing for pretending to support the feature.
> I'm not sure the phylink without the MAC support is valid.
>
> I think we need a real task to be spawn to support EEE / LPI on cadence
> driver (but I don't see it scheduled in a way or another 🙁 ).

Since he was not sure, next port of call is lkml.. Is this patch
sufficient in isolation, or are additional changes required to the driver
for it?

The other drivers that I looked at that use phylink_ethtool_set_eee()
vary between doing what's done here and just forwarding the call, but
others are more complex, so without an understanding of the subsystem
I cannot tell :)

Alternatively, Steve, shout if you can tell me why forwarding to the phy
is sufficient, and I'll update the commit message and send this as
non-RFC.

Thanks,
Conor.

CC: valentina.fernandezalanis@...rochip.com
CC: Nicolas Ferre <nicolas.ferre@...rochip.com>
CC: Claudiu Beznea <claudiu.beznea@...on.dev>
CC: "David S. Miller" <davem@...emloft.net>
CC: Eric Dumazet <edumazet@...gle.com>
CC: Jakub Kicinski <kuba@...nel.org>
CC: Paolo Abeni <pabeni@...hat.com>
CC: Russell King <linux@...linux.org.uk>
CC: netdev@...r.kernel.org
CC: linux-kernel@...r.kernel.org
---
 drivers/net/ethernet/cadence/macb_main.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 95e8742dce1d..a2a222954ebf 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3321,6 +3321,20 @@ static int macb_set_link_ksettings(struct net_device *netdev,
 	return phylink_ethtool_ksettings_set(bp->phylink, kset);
 }
 
+static int macb_get_eee(struct net_device *netdev, struct ethtool_keee *edata)
+{
+	struct macb *bp = netdev_priv(netdev);
+
+	return phylink_ethtool_get_eee(bp->phylink, edata);
+}
+
+static int macb_set_eee(struct net_device *netdev, struct ethtool_keee *edata)
+{
+	struct macb *bp = netdev_priv(netdev);
+
+	return phylink_ethtool_set_eee(bp->phylink, edata);
+}
+
 static void macb_get_ringparam(struct net_device *netdev,
 			       struct ethtool_ringparam *ring,
 			       struct kernel_ethtool_ringparam *kernel_ring,
@@ -3767,6 +3781,8 @@ static const struct ethtool_ops macb_ethtool_ops = {
 	.set_wol		= macb_set_wol,
 	.get_link_ksettings     = macb_get_link_ksettings,
 	.set_link_ksettings     = macb_set_link_ksettings,
+	.get_eee		= macb_get_eee,
+	.set_eee		= macb_set_eee,
 	.get_ringparam		= macb_get_ringparam,
 	.set_ringparam		= macb_set_ringparam,
 };
@@ -3783,6 +3799,8 @@ static const struct ethtool_ops gem_ethtool_ops = {
 	.get_sset_count		= gem_get_sset_count,
 	.get_link_ksettings     = macb_get_link_ksettings,
 	.set_link_ksettings     = macb_set_link_ksettings,
+	.get_eee		= macb_get_eee,
+	.set_eee		= macb_set_eee,
 	.get_ringparam		= macb_get_ringparam,
 	.set_ringparam		= macb_set_ringparam,
 	.get_rxnfc			= gem_get_rxnfc,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ