net/mlx5: ethtool, Fix type analysis of advertised link-mode
authorAya Levin <ayal@mellanox.com>
Thu, 28 Feb 2019 07:27:33 +0000 (09:27 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 29 Mar 2019 19:24:42 +0000 (12:24 -0700)
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: 6a897372417e ("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>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

index a0987cc5fe4a12af0bf0155ad8f290153898518c..561e36af8e77df34530e0c796fe829c43366d290 100644 (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 */