From patchwork Fri Jul 21 14:41:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 27103 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5D0EA25A1; Fri, 21 Jul 2017 16:47:13 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 16662271 for ; Fri, 21 Jul 2017 16:47:11 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2017 07:47:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,390,1496127600"; d="scan'208";a="995598105" Received: from silpixa00397898.ir.intel.com ([10.237.223.116]) by orsmga003.jf.intel.com with ESMTP; 21 Jul 2017 07:47:09 -0700 From: David Hunt To: dev@dpdk.org Cc: jingjing.wu@intel.com, David Hunt Date: Fri, 21 Jul 2017 15:41:21 +0100 Message-Id: <1500648081-210705-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH v1] net/i40e: fix sync phy type by adding retry X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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; }