From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD2A9A04C2; Thu, 14 Nov 2019 07:45:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EC1A2BC8; Thu, 14 Nov 2019 07:44:59 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1F69A2BAF; Thu, 14 Nov 2019 07:44:56 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2019 22:44:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,302,1569308400"; d="scan'208";a="207697142" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga003.jf.intel.com with ESMTP; 13 Nov 2019 22:44:53 -0800 Date: Thu, 14 Nov 2019 14:41:34 +0800 From: Ye Xiaolong To: Cui LunyuanX Cc: dev@dpdk.org, Wenzhuo Lu , Yang Qiming , stable@dpdk.org Message-ID: <20191114064134.GG66623@intel.com> References: <20191113173243.90826-1-lunyuanx.cui@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113173243.90826-1-lunyuanx.cui@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix link status update 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" Hi, On 11/13, Cui LunyuanX wrote: >Unassigned variable should not be used as judgment, and there The issue here is link structure variable has been memset first, which makes it meaningless to compare the value of link.link_status in the conditions. >is no need to update link status according to old link status. >This patch fix the issue. > >Fixes: 80ba61115e77 ("net/e1000: use link status helper functions") >Cc: stable@dpdk.org > >Signed-off-by: Lunyuan Cui >--- > drivers/net/e1000/em_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c >index 9a88b50b2..a3d39a935 100644 >--- a/drivers/net/e1000/em_ethdev.c >+++ b/drivers/net/e1000/em_ethdev.c >@@ -1157,7 +1157,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_to_complete) > memset(&link, 0, sizeof(link)); > > /* Now we check if a transition has happened */ >- if (link_check && (link.link_status == ETH_LINK_DOWN)) { >+ if (link_check) { > uint16_t duplex, speed; > hw->mac.ops.get_link_up_info(hw, &speed, &duplex); > link.link_duplex = (duplex == FULL_DUPLEX) ? Seems you also need to fix the `else if` judgment. Thanks, Xiaolong >-- >2.17.1 >