aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Galazka <krzysztof.galazka@intel.com>2023-02-15 22:35:40 +0000
committerEric Joyner <erj@FreeBSD.org>2023-02-21 22:42:25 +0000
commit25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00 (patch)
treedf149c575f51966da2bb4e9a764f3b6d339bf279
parentaaca677fee21f202db4bb974fc5056f4dcbbb598 (diff)
downloadsrc-25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00.tar.gz
src-25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00.zip
ixgbe(4): Filter out spurious link up indication
Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay to filter out spurious link up indication by transceiver with no fiber cable connected. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: erj@ Tested by: Gowtham Kumar Ks <gowtham.kumar.ks@intel.com> Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38395 (cherry picked from commit 04a5e6d7cadd06b10169c3c3a560649e7dc7444c)
-rw-r--r--sys/dev/ixgbe/ixgbe_common.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c
index 3f38f5e27123..86301dab80ed 100644
--- a/sys/dev/ixgbe/ixgbe_common.c
+++ b/sys/dev/ixgbe/ixgbe_common.c
@@ -4232,10 +4232,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) {