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 CA387A04B3; Mon, 18 Nov 2019 08:45:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 97C3D2BA2; Mon, 18 Nov 2019 08:45:11 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 06F8C235; Mon, 18 Nov 2019 08:45:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Nov 2019 23:45:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,319,1569308400"; d="scan'208";a="236829532" Received: from intel.sh.intel.com ([10.239.255.129]) by fmsmga002.fm.intel.com with ESMTP; 17 Nov 2019 23:45:08 -0800 From: Lunyuan Cui To: dev@dpdk.org Cc: Wenzhuo Lu , Lunyuan Cui , stable@dpdk.org Date: Mon, 18 Nov 2019 15:37:44 +0000 Message-Id: <20191118153744.78987-1-lunyuanx.cui@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191118101345.42181-1-lunyuanx.cui@intel.com> References: <20191118101345.42181-1-lunyuanx.cui@intel.com> Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix link status 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" The link status for 82599eb got from link status register was not correct. Check the enable/disable flag of tx laser, set the link status down if tx laser disabled. Then, we can get correct status. But after port reset, tx laser register will be reset enable. Link status will always be up. So set tx laser disable when port resets. When hw->mac.autotry_restart is true, whether tx laser is disable or enable, it will be set enable in ixgbe_flap_tx_laser_multispeed_fiber(). hw->mac.autotry_restart can be set true in both port init and port start. Because we don't need this treatment before port starts, set hw->mac.autotry_restart false when port init. Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update") Cc: stable@dpdk.org Signed-off-by: Lunyuan Cui --- v4: * modifier commit log Describe the problem in more detail. v3: * Correct countermeasure Don't delete ixgbe_dev_setup_link_alarm_handler(). v2: * modifier commit log Add a log why I delete ixgbe_dev_setup_link_alarm_handler(). --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 8c1caac18..260484fbf 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1188,6 +1188,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) diag = ixgbe_bypass_init_hw(hw); #else diag = ixgbe_init_hw(hw); + hw->mac.autotry_restart = false; #endif /* RTE_LIBRTE_IXGBE_BYPASS */ /* @@ -1298,6 +1299,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) /* enable support intr */ ixgbe_enable_intr(eth_dev); + ixgbe_dev_set_link_down(eth_dev); + /* initialize filter info */ memset(filter_info, 0, sizeof(struct ixgbe_filter_info)); -- 2.17.1