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: <564e559c-3b31-445d-b3c7-1584ad78d1b8@intel.com>
Date: Wed, 22 Nov 2023 11:53:05 +0100
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Raju Rangoju <Raju.Rangoju@....com>, <netdev@...r.kernel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <Thomas.Lendacky@....com>, <Shyam-sundar.S-k@....com>
Subject: Re: [PATCH net 3/3] amd-xgbe: propagate the correct speed and duplex
 status



On 21.11.2023 20:14, Raju Rangoju wrote:
> xgbe_get_link_ksettings() does not propagate correct speed and duplex
> information to ethtool during cable unplug. Due to which ethtool reports
> incorrect values for speed and duplex.
> 
> Address this by propagating correct information.
> 
> Fixes: 7c12aa08779c ("amd-xgbe: Move the PHY support into amd-xgbe")
> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@....com>
> Signed-off-by: Raju Rangoju <Raju.Rangoju@....com>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>

>  drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
> index 6e83ff59172a..32fab5e77246 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
> @@ -314,10 +314,15 @@ static int xgbe_get_link_ksettings(struct net_device *netdev,
>  
>  	cmd->base.phy_address = pdata->phy.address;
>  
> -	cmd->base.autoneg = pdata->phy.autoneg;
> -	cmd->base.speed = pdata->phy.speed;
> -	cmd->base.duplex = pdata->phy.duplex;
> +	if (netif_carrier_ok(netdev)) {
> +		cmd->base.speed = pdata->phy.speed;
> +		cmd->base.duplex = pdata->phy.duplex;
> +	} else {
> +		cmd->base.speed = SPEED_UNKNOWN;
> +		cmd->base.duplex = DUPLEX_UNKNOWN;
> +	}
>  
> +	cmd->base.autoneg = pdata->phy.autoneg;
>  	cmd->base.port = PORT_NONE;
>  
>  	XGBE_LM_COPY(cmd, supported, lks, supported);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ