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>
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;
}