DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry
@ 2017-07-21 14:41 David Hunt
  2017-07-24  1:55 ` Wu, Jingjing
  2017-07-24  8:48 ` [dpdk-dev] [PATCH v2] " David Hunt
  0 siblings, 2 replies; 5+ messages in thread
From: David Hunt @ 2017-07-21 14:41 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, 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.

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 97a73e1..8c39eb7 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry
  2017-07-21 14:41 [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry David Hunt
@ 2017-07-24  1:55 ` Wu, Jingjing
  2017-07-24  8:48 ` [dpdk-dev] [PATCH v2] " David Hunt
  1 sibling, 0 replies; 5+ messages in thread
From: Wu, Jingjing @ 2017-07-24  1:55 UTC (permalink / raw)
  To: Hunt, David, dev



> -----Original Message-----
> From: Hunt, David
> Sent: Friday, July 21, 2017 10:41 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Hunt, David <david.hunt@intel.com>
> Subject: [PATCH v1] 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.
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

Patch looks fine, but you missed the Fixes line and it's better to Cc stable@dpdk.org

Thanks
Jingjing

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/i40e: fix sync phy type by adding retry
  2017-07-21 14:41 [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry David Hunt
  2017-07-24  1:55 ` Wu, Jingjing
@ 2017-07-24  8:48 ` David Hunt
  2017-07-27  0:28   ` Wu, Jingjing
  1 sibling, 1 reply; 5+ messages in thread
From: David Hunt @ 2017-07-24  8:48 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, stable, 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")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 97a73e1..8c39eb7 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix sync phy type by adding retry
  2017-07-24  8:48 ` [dpdk-dev] [PATCH v2] " David Hunt
@ 2017-07-27  0:28   ` Wu, Jingjing
  2017-07-31 12:41     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: Wu, Jingjing @ 2017-07-27  0:28 UTC (permalink / raw)
  To: Hunt, David, dev; +Cc: stable



> -----Original Message-----
> From: Hunt, David
> Sent: Monday, July 24, 2017 4:49 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org; Hunt, David
> <david.hunt@intel.com>
> Subject: [PATCH v2] 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.
> 
> Fixes: 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus
> SFP")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/i40e: fix sync phy type by adding retry
  2017-07-27  0:28   ` Wu, Jingjing
@ 2017-07-31 12:41     ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-07-31 12:41 UTC (permalink / raw)
  To: Wu, Jingjing, Hunt, David, dev; +Cc: stable

On 7/27/2017 1:28 AM, Wu, Jingjing wrote:
> 
> 
>> -----Original Message-----
>> From: Hunt, David
>> Sent: Monday, July 24, 2017 4:49 PM
>> To: dev@dpdk.org
>> Cc: Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org; Hunt, David
>> <david.hunt@intel.com>
>> Subject: [PATCH v2] 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.
>>
>> Fixes: 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus
>> SFP")
>>
>> Signed-off-by: David Hunt <david.hunt@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-31 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 14:41 [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry David Hunt
2017-07-24  1:55 ` Wu, Jingjing
2017-07-24  8:48 ` [dpdk-dev] [PATCH v2] " David Hunt
2017-07-27  0:28   ` Wu, Jingjing
2017-07-31 12:41     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).