From: Asaf Penso Date: Wed, 19 Jun 2019 09:52:45 +0000 (+0000) Subject: net/mlx5: fix condition for link update fallback X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cb1d2cce9539f1131a01585888903ab3546d51d9;p=dpdk.git 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 Signed-off-by: Asaf Penso Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 0c7162d7ed..eeefe4df3c 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;