Commit 8d047bf5 authored by Aya Levin's avatar Aya Levin Committed by Saeed Mahameed

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: 6a897372 ("net/mlx5: ethtool, Add ethtool support for 50Gbps per lane link modes")
Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 80a2a902
...@@ -997,8 +997,9 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, ...@@ -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) #define MLX5E_PTYS_EXT ((1ULL << ETHTOOL_LINK_MODE_50000baseKR_Full_BIT) - 1)
ext_requested = (link_ksettings->link_modes.advertising[0] > ext_requested = !!(link_ksettings->link_modes.advertising[0] >
MLX5E_PTYS_EXT); MLX5E_PTYS_EXT ||
link_ksettings->link_modes.advertising[1]);
ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
/*when ptys_extended_ethernet is set legacy link modes are deprecated */ /*when ptys_extended_ethernet is set legacy link modes are deprecated */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment