net/mlx5: fix ethtool link setting call order
authorShahaf Shuler <shahafs@mellanox.com>
Tue, 1 May 2018 09:58:48 +0000 (12:58 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:48 +0000 (22:31 +0100)
According to ethtool_link_setting API recommendation ETHTOOL_GLINKSETTINGS
should be called before ETHTOOL_GSET as the later one deprecated.

Fixes: f47ba80080ab ("net/mlx5: remove kernel version check")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
drivers/net/mlx5/mlx5_ethdev.c

index 746b94f..588d4ba 100644 (file)
@@ -697,9 +697,9 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
        time_t start_time = time(NULL);
 
        do {
-               ret = mlx5_link_update_unlocked_gset(dev, &dev_link);
+               ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
                if (ret)
-                       ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
+                       ret = mlx5_link_update_unlocked_gset(dev, &dev_link);
                if (ret == 0)
                        break;
                /* Handle wait to complete situation. */