Skip to contentSkip to conversation

net/ixgbe/base: wait for link after copper MAC setup

PATCH Applied Ashijeet Acharya 2 participants 2 messages May 24, 2019 – May 27, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe/base: 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.

---
Hello,

This patch makes changes in the base driver.
Similar patch was introduced in case of fiber link MAC setup earlier

        http://patchwork.dpdk.org/patch/43119/

Bugzilla: https://bugs.dpdk.org/show_bug.cgi?id=69

 drivers/net/ixgbe/base/ixgbe_x550.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +15 -0
index a920a146e..930a61a20 100644
@@ -4440,6 +4440,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");
 
@@ -4459,6 +4461,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);
Signature · 1 line
2.11.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ashijeet Acharya
Sent: Friday, May 24, 2019 2:30 AM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: [dpdk-dev] [PATCH] net/ixgbe/base: 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.

Quoted 5 lines

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.

Applied to dpdk-next-net-intel.

Thanks
Qi