Skip to contentSkip to conversation

net/i40e: fix sync phy type by adding retry

PATCH Superseded David Hunt 3 participants 5 messages Jul 21, 2017 – Jul 31, 2017 Network drivers

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 net/i40e: fix sync phy type by adding retry

Some phy's take longer than others to come up. Add a retry to give more phy's a chance to come up before returning an error.

---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +9 -3
index 97a73e1..8c39eb7 100644
@@ -9248,16 +9248,22 @@ i40e_dev_sync_phy_type(struct i40e_hw *hw)
 	enum i40e_status_code status;
 	struct i40e_aq_get_phy_abilities_resp phy_ab;
 	int ret = -ENOTSUP;
+	int retries = 0;
 
 	status = i40e_aq_get_phy_capabilities(hw, false, true, &phy_ab,
 					      NULL);
 
-	if (status) {
+	while (status) {
 		PMD_INIT_LOG(WARNING, "Failed to sync phy type: status=%d",
 			status);
-		return ret;
+		retries++;
+		rte_delay_us(100000);
+		if  (retries < 5)
+			status = i40e_aq_get_phy_capabilities(hw, false,
+					true, &phy_ab, NULL);
+		else
+			return ret;
 	}
-
 	return 0;
 }
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Hunt, David
Sent: Friday, July 21, 2017 10:41 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Hunt, David <[email protected]>
Subject: [PATCH v1] net/i40e: fix sync phy type by adding retry

Quoted 4 lines

Some phy's take longer than others to come up. Add a retry to give more phy's a chance to come up before returning an error.

Patch looks fine, but you missed the Fixes line and it's better to Cc [email protected]

Thanks
Jingjing

author
#2 lore raw

PATCH v2 1/1 net/i40e: fix sync phy type by adding retry

In reply to David Hunt

Some phy's take longer than others to come up. Add a retry to give more phy's a chance to come up before returning an error.

Fixes 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus SFP")
---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +9 -3
index 97a73e1..8c39eb7 100644
@@ -9248,16 +9248,22 @@ i40e_dev_sync_phy_type(struct i40e_hw *hw)
 	enum i40e_status_code status;
 	struct i40e_aq_get_phy_abilities_resp phy_ab;
 	int ret = -ENOTSUP;
+	int retries = 0;
 
 	status = i40e_aq_get_phy_capabilities(hw, false, true, &phy_ab,
 					      NULL);
 
-	if (status) {
+	while (status) {
 		PMD_INIT_LOG(WARNING, "Failed to sync phy type: status=%d",
 			status);
-		return ret;
+		retries++;
+		rte_delay_us(100000);
+		if  (retries < 5)
+			status = i40e_aq_get_phy_capabilities(hw, false,
+					true, &phy_ab, NULL);
+		else
+			return ret;
 	}
-
 	return 0;
 }
 
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#3 lore raw
Quoted 10 lines

-----Original Message-----
From: Hunt, David
Sent: Monday, July 24, 2017 4:49 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; [email protected]; Hunt, David <[email protected]>
Subject: [PATCH v2] net/i40e: fix sync phy type by adding retry

Quoted 7 lines

Some phy's take longer than others to come up. Add a retry to give more phy's a chance to come up before returning an error.

Fixes 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus

SFP")

Applied
#4 lore raw
Quoted 10 lines · Jingjing
Quoted 10 lines

-----Original Message-----
From: Hunt, David
Sent: Monday, July 24, 2017 4:49 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; [email protected]; Hunt, David <[email protected]>
Subject: [PATCH v2] net/i40e: fix sync phy type by adding retry

Quoted 8 lines
Quoted 7 lines

Some phy's take longer than others to come up. Add a retry to give more phy's a chance to come up before returning an error.

Fixes 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus

SFP")

Applied to dpdk-next-net/master, thanks.