summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorAsaf Penso <asafp@mellanox.com>2019-06-19 09:52:45 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-07-05 01:52:02 +0200
commitcb1d2cce9539f1131a01585888903ab3546d51d9 (patch)
treee173b1a0913e814144e1379099ea60b0d3ee28db /drivers/net/mlx5/mlx5_ethdev.c
parent5291c601bb93e8461ee0c51a6a3385d83825f88b (diff)
downloaddpdk-next-eventdev-cb1d2cce9539f1131a01585888903ab3546d51d9.zip
dpdk-next-eventdev-cb1d2cce9539f1131a01585888903ab3546d51d9.tar.gz
dpdk-next-eventdev-cb1d2cce9539f1131a01585888903ab3546d51d9.tar.xz
net/mlx5: fix condition for link update fallback
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: 7d2e32f76cfc ("net/mlx5: fix ethtool link setting call order") Cc: stable@dpdk.org Reported-by: Srinivas Narayan <srinivas.narayan@att.com> Signed-off-by: Asaf Penso <asafp@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 0c7162d..eeefe4d 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1051,7 +1051,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
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;