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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 07 Dec 2014 14:55:03 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Amir Vadai <amirv@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>
CC:	netdev@...r.kernel.org, Or Gerlitz <ogerlitz@...lanox.com>,
	Yevgeny Petrilin <yevgenyp@...lanox.com>,
	Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH net-next] net/mlx4_en: ethtool force speed when asking
 for autoneg=off

Hello.

On 12/7/2014 11:07 AM, Amir Vadai wrote:

> From: Saeed Mahameed <saeedm@...lanox.com>

> Use cmd->autoneg == AUTONEG_DISABLE as a user hint to force specific speed.
> We don't want to rely on ethtool to calculate advertised link modes when
> forcing specific speed, a user can request a specific speed and specify
> "autoneg off" in ethtool command to give a hint for forcing this speed.

> Move en_warn("port reset..") inside the "port reset" block.

> Fixes: d48b3ab ("net/mlx4_en: Use PTYS register to set ethtool settings (Speed)")
> Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
> Signed-off-by: Amir Vadai <amirv@...lanox.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> index c45e06a..3045582 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> @@ -771,13 +771,13 @@ static int mlx4_en_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
>   	}
>
>   	proto_admin = cpu_to_be32(ptys_adv);
> -	if (speed >= 0 && speed != priv->port_state.link_speed)
> +	if (speed >= 0 && ((speed != priv->port_state.link_speed) ||
> +			   (cmd->autoneg == AUTONEG_DISABLE)))

    You're using () rather inconsistently. In fact, () around == and != are 
not needed.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists