git: d5bbb5500cf2 - main - ixgbe: wait for link after copper MAC setup

Kevin Bowling kbowling at FreeBSD.org
Tue Sep 7 04:46:04 UTC 2021


The branch main has been updated by kbowling (ports committer):

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

commit d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d
Author:     Ashijeet Acharya <ashijeet.acharya at 6wind.com>
AuthorDate: 2019-05-24 09:30:15 +0000
Commit:     Kevin Bowling <kbowling at FreeBSD.org>
CommitDate: 2021-09-07 02:22:13 +0000

    ixgbe: wait for link after copper MAC setup
    
    After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
    link does not get set up properly and as a result all the subsequent
    calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.
    
    Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
    beginning to set up the external PHY link speed to ensure that the
    controller can acquire the link.
    
    Signed-off-by: Ashijeet Acharya <ashijeet.acharya at 6wind.com>
    Acked-by: Qi Zhang <qi.z.zhang at intel.com>
    
    Approved by:    imp
    Obtained from:  DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0)
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D31621
---
 sys/dev/ixgbe/ixgbe_x550.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c
index 7b120f841d85..a7759117f5b5 100644
--- a/sys/dev/ixgbe/ixgbe_x550.c
+++ b/sys/dev/ixgbe/ixgbe_x550.c
@@ -4464,6 +4464,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");
 
@@ -4483,6 +4485,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);


More information about the dev-commits-src-all mailing list