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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y/Z1+C+ZS/FajLsZ@lunn.ch>
Date:   Wed, 22 Feb 2023 21:07:20 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Aryan Srivastava <Aryan.Srivastava@...iedtelesis.co.nz>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: EEE support for 2.5G/5G

On Wed, Feb 22, 2023 at 02:53:17AM +0000, Aryan Srivastava wrote:
> Hi,
> 
> I am currently in the process of implementing EEE (energy-efficient ethernet) ethtool get/set on my PHY driver.

I hope you are following the discussions on the mailing list about
EEE. Most drivers get EEE wrong, so be careful which driver you copy.

> There are generic functions to achieve this, but they do not
> currently have the capability to set or check for 2.5G and 5G EEE
> LPI.
> 
> I had begun to add these additional modes when I realised this was
> not possible as the EEE ethtool command struct, only has 32-bit
> fields, and the ethtool bit mask for the 2.5G and 5G modes is 47 and
> 48 respectively.

So you need to differentiate between the IOCTL API and netlink.
Netlink should allow user space to use any link modes without any
backwards compatibility issues. The IOCTL API is stuck to just 1G and
less.

> To my knowledge, there is no framework currently in place to set
> 2.5G/5G EE through generic phy functions, and it cannot be
> implemented currently due to the size of the bit fields in the
> ethtool command.

Partially wrong. See above. But you are going to have do some kernel
internal plumbing. Within the kernel you need to replace struct
ethtool_eee with a different structure that replaces the u32
supported, advertised, and lp_advertised with a
__ETHTOOL_DECLARE_LINK_MODE_MASK. net/ethtool needs to map the IOCTL
call, using the UAPI ethtool_eee to this new structure, and the
netlink version should be swapped to ethnl_put_bitset() rather than
ethnl_put_bitset32(). You then need to modify every MAC driver which
has .eee_set() and .eee_get(). Those that use phylib probably don't
need any changes, but those doing EEE in firmware you are going to
have to add convert_link_ksettings_to_legacy_settings() to turn the
values back into u32. And then modify phylib to remove the recently
added convert_link_ksettings_to_legacy_settings().

Make sure you are on top of net-next. phylib has had a lot of EEE
changes recently, and more will be merged next cycle.

	Andrew



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ