From: David Hunt Date: Mon, 24 Jul 2017 08:48:44 +0000 (+0100) Subject: net/i40e: fix sync phy type by adding retry X-Git-Tag: spdx-start~2303 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=935bceb9ba0de8a7a276d5b3dd41e0168a273f26;p=dpdk.git 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 Acked-by: Jingjing Wu --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f3339b5a7c..5f26e24a3e 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -9260,16 +9260,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; }