From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 471AC1B1E5; Thu, 10 May 2018 04:26:39 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 19:26:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,383,1520924400"; d="scan'208";a="53902819" Received: from unknown (HELO dpdk9.sh.intel.com) ([10.67.118.52]) by fmsmga001.fm.intel.com with ESMTP; 09 May 2018 19:26:37 -0700 From: Beilei Xing To: roy.fan.zhang@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, echaudro@redhat.com, stable@dpdk.org, Keith Wiles Date: Thu, 10 May 2018 10:26:29 +0800 Message-Id: <1525919189-10017-1-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] net/i40e: fix link status update error 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: , X-List-Received-Date: Thu, 10 May 2018 02:26:41 -0000 Link status is not updated correctly, link speed is 0 when link is up and link speed is not 0 when link is down. This patch fixes the issue. Fixes: eef2daf2e199 ("net/i40e: fix link update no wait") Cc: echaudro@redhat.com Cc: stable@dpdk.org Signed-off-by: Keith Wiles Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 894505f..a563561 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2513,7 +2513,7 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link) reg_val &= I40E_REG_LINK_UP; link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0; - if (unlikely(link->link_status != 0)) + if (unlikely(link->link_status == 0)) return; /* Parse the link status */ @@ -2572,7 +2572,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link, link->link_status = link_status.link_info & I40E_AQ_LINK_UP; if (unlikely(link->link_status != 0)) - return; + break; rte_delay_ms(CHECK_INTERVAL); } while (--rep_cnt); -- 2.5.5