Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2023 22:45:08 GMT
From:      Eric Joyner <erj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 25d43e3c6b36 - stable/13 - ixgbe(4): Filter out spurious link up indication
Message-ID:  <202302212245.31LMj8tJ067566@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by erj:

URL: https://cgit.FreeBSD.org/src/commit/?id=25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00

commit 25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00
Author:     Krzysztof Galazka <krzysztof.galazka@intel.com>
AuthorDate: 2023-02-15 22:35:40 +0000
Commit:     Eric Joyner <erj@FreeBSD.org>
CommitDate: 2023-02-21 22:42:25 +0000

    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)
---
 sys/dev/ixgbe/ixgbe_common.c | 19 +++++++++++++++++--
 1 file 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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302212245.31LMj8tJ067566>