net/mlx5: ethtool, Fix type analysis of advertised link-mode

Ethtool option set_link_ksettings allows setting of legacy link-modes
or extended link-modes. Refine the decision of which type of link-modes
is set.

Fixes: 6a89737241 ("net/mlx5: ethtool, Add ethtool support for 50Gbps per lane link modes")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
Aya Levin 2019-02-28 09:27:33 +02:00 committed by Saeed Mahameed
parent 80a2a9026b
commit 8d047bf56a
1 changed files with 3 additions and 2 deletions

View File

@ -997,8 +997,9 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
#define MLX5E_PTYS_EXT ((1ULL << ETHTOOL_LINK_MODE_50000baseKR_Full_BIT) - 1)
ext_requested = (link_ksettings->link_modes.advertising[0] >
MLX5E_PTYS_EXT);
ext_requested = !!(link_ksettings->link_modes.advertising[0] >
MLX5E_PTYS_EXT ||
link_ksettings->link_modes.advertising[1]);
ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
/*when ptys_extended_ethernet is set legacy link modes are deprecated */