From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, stable@dpdk.org,
David Hunt <david.hunt@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/i40e: fix sync phy type by adding retry
Date: Mon, 24 Jul 2017 09:48:44 +0100 [thread overview]
Message-ID: <1500886124-19379-1-git-send-email-david.hunt@intel.com> (raw)
In-Reply-To: <1500648081-210705-1-git-send-email-david.hunt@intel.com>
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
next prev parent reply other threads:[~2017-07-24 9:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 14:41 [dpdk-dev] [PATCH v1] " David Hunt
2017-07-24 1:55 ` Wu, Jingjing
2017-07-24 8:48 ` David Hunt [this message]
2017-07-27 0:28 ` [dpdk-dev] [PATCH v2] " Wu, Jingjing
2017-07-31 12:41 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1500886124-19379-1-git-send-email-david.hunt@intel.com \
--to=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).