]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / drivers / net / ixgbe / base / ixgbe_x550.c
index a920a146e7d8aef0d74c09e60520ea06b3e7d041..3de406fd35202784889b39d9e96662df0a9cd1bf 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2001-2018
+ * Copyright(c) 2001-2020 Intel Corporation
  */
 
 #include "ixgbe_x550.h"
@@ -4440,6 +4440,8 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
 {
        s32 status;
        ixgbe_link_speed force_speed;
+       u32 i;
+       bool link_up = false;
 
        DEBUGFUNC("ixgbe_setup_mac_link_t_X550em");
 
@@ -4459,6 +4461,19 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
 
                if (status != IXGBE_SUCCESS)
                        return status;
+
+               /* Wait for the controller to acquire link */
+               for (i = 0; i < 10; i++) {
+                       msec_delay(100);
+
+                       status = ixgbe_check_link(hw, &force_speed, &link_up,
+                                                 false);
+                       if (status != IXGBE_SUCCESS)
+                               return status;
+
+                       if (link_up)
+                               break;
+               }
        }
 
        return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete);