[v1,15/22] net/ixgbe/base: filter out spurious link up indication
Checks
Commit Message
From: Krzysztof Galazka <krzysztof.galazka@intel.com>
Extend SFP+ cage crosstalk fix by re-checking link state
after 5ms delay to filter out spurious link up indication
by transceiver with no fibre cable connected.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed-by: Jan Sokolowski <jan.sokolowski@intel.com>
---
drivers/net/ixgbe/base/ixgbe_common.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
@@ -4194,10 +4194,25 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
}
} else {
- if (links_reg & IXGBE_LINKS_UP)
+ if (links_reg & IXGBE_LINKS_UP) {
+ if (ixgbe_need_crosstalk_fix(hw)) {
+ /* Check the link state again after a delay
+ * to filter out spurious link up
+ * notifications.
+ */
+ msec_delay(5);
+ links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
+ if (!(links_reg & IXGBE_LINKS_UP)) {
+ *link_up = false;
+ *speed = IXGBE_LINK_SPEED_UNKNOWN;
+ return IXGBE_SUCCESS;
+ }
+
+ }
*link_up = true;
- else
+ } else {
*link_up = false;
+ }
}
switch (links_reg & IXGBE_LINKS_SPEED_82599) {