@@ -6426,6 +6426,21 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
if (netif_carrier_ok(netdev))
return;
+ /* In X540 NIC, there is a time span between reporting "link on"
+ * and getting the speed and duplex. To a bonding driver in 802.3ad
+ * mode, this time span will make it not work well if the time span
+ * is big enough. To 82599_SFP NIC and other kinds of NICs, this
+ * problem does not exist. As such, it is better for X540 to report
+ * "link on" when the link speed is not IXGBE_LINK_SPEED_UNKNOWN.
+ * To other NICs, the link_up and link_speed are gotten at the same
+ * time. To X540 NIC, there is a time span between link_up and
+ * link_speed. As such, only continue if link_up and link_speed are
+ * ready to X540 NIC.
+ */
+ if (hw->mac.type == ixgbe_mac_X540)
+ if (link_speed == IXGBE_LINK_SPEED_UNKNOWN)
+ return;
+
adapter->flags2 &= ~IXGBE_FLAG2_SEARCH_FOR_SFP;
switch (hw->mac.type) {