mlx5_link_update uses the newer ethtool command ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls back to the older (deprecated) ETHTOOL_GSET command if the new method fails for any reason. The older method only supports reporting of capabilities up to 40G.
However, mlx5_link_update_unlocked_gs can return a failure for a number of reasons (including the link being down). Using the older method in cases of transient failure of the method can result in reporting of reduced capabilities to the application. The older method (mlx5_link_update_unlocked_gset) should only be invoked if the newer method returns EOPNOTSUPP. Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order") Cc: sta...@dpdk.org Signed-off-by: Asaf Penso <as...@mellanox.com> Reported-by: Srinivas Narayan <srinivas.nara...@att.com> --- drivers/net/mlx5/mlx5_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index ac0500a..61e12cc 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size) do { ret = mlx5_link_update_unlocked_gs(dev, &dev_link); - if (ret) + if (ret == -ENOTSUP) ret = mlx5_link_update_unlocked_gset(dev, &dev_link); if (ret == 0) break; -- 1.8.3.1