netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Amir Vadai <amirv@mellanox.com>, "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
	Yevgeny Petrilin <yevgenyp@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH net-next] net/mlx4_en: ethtool force speed when asking for autoneg=off
Date: Sun, 07 Dec 2014 14:55:03 +0300	[thread overview]
Message-ID: <54844017.2080708@cogentembedded.com> (raw)
In-Reply-To: <1417939634-26085-1-git-send-email-amirv@mellanox.com>

Hello.

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

> From: Saeed Mahameed <saeedm@mellanox.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@mellanox.com>
> Signed-off-by: Amir Vadai <amirv@mellanox.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

      reply	other threads:[~2014-12-07 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07  8:07 [PATCH net-next] net/mlx4_en: ethtool force speed when asking for autoneg=off Amir Vadai
2014-12-07 11:55 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54844017.2080708@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=yevgenyp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).