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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240220120643.GZ40273@kernel.org>
Date: Tue, 20 Feb 2024 12:06:43 +0000
From: Simon Horman <horms@...nel.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Ariel Elior <aelior@...vell.com>,
	Manish Chopra <manishc@...vell.com>,
	Jesse Brandeburg <jesse.brandeburg@...el.com>,
	Tony Nguyen <anthony.l.nguyen@...el.com>, linux-usb@...r.kernel.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	intel-wired-lan@...ts.osuosl.org
Subject: Re: [PATCH net-next v4 4/9] net: ethernet: ixgbe: Convert EEE to use
 linkmodes

On Sun, Feb 18, 2024 at 11:07:01AM -0600, Andrew Lunn wrote:
> Convert the tables to make use of ETHTOOL link mode bits, rather than
> the old u32 SUPPORTED speeds. Make use of the linkmode helps to set
> bits and compare linkmodes. As a result, the _u32 members of keee are
> no longer used, a step towards removing them.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 48 ++++++++++++------------
>  1 file changed, 25 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

..

> @@ -3436,28 +3437,29 @@ ixgbe_get_eee_fw(struct ixgbe_adapter *adapter, struct ethtool_keee *edata)
>  	if (rc)
>  		return rc;
>  
> -	edata->lp_advertised_u32 = 0;
>  	for (i = 0; i < ARRAY_SIZE(ixgbe_lp_map); ++i) {
>  		if (info[0] & ixgbe_lp_map[i].lp_advertised)
> -			edata->lp_advertised_u32 |= ixgbe_lp_map[i].mac_speed;
> +			linkmode_set_bit(ixgbe_lp_map[i].link_mode,
> +					 edata->lp_advertised);
>  	}
>  
> -	edata->supported_u32 = 0;
>  	for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
>  		if (hw->phy.eee_speeds_supported & ixgbe_ls_map[i].mac_speed)
> -			edata->supported_u32 |= ixgbe_ls_map[i].supported;
> +			linkmode_set_bit(ixgbe_lp_map[i].link_mode,
> +					 edata->lp_advertised);

Hi Andrew,

should this be edata->supported rather than edata->lp_advertised?

>  	}
>  
> -	edata->advertised_u32 = 0;
>  	for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
>  		if (hw->phy.eee_speeds_advertised & ixgbe_ls_map[i].mac_speed)
> -			edata->advertised_u32 |= ixgbe_ls_map[i].supported;
> +			linkmode_set_bit(ixgbe_lp_map[i].link_mode,
> +					 edata->advertised);
>  	}
>  
> -	edata->eee_enabled = !!edata->advertised_u32;
> +	edata->eee_enabled = !linkmode_empty(edata->advertised);
>  	edata->tx_lpi_enabled = edata->eee_enabled;
> -	if (edata->advertised_u32 & edata->lp_advertised_u32)
> -		edata->eee_active = true;
> +
> +	linkmode_and(common, edata->advertised, edata->lp_advertised);
> +	edata->eee_active = !linkmode_empty(common);
>  
>  	return 0;
>  }

..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ