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 AD514A00E6 for ; Mon, 2 Sep 2019 04:59:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75B631C24A; Mon, 2 Sep 2019 04:59:41 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0EC201C1F5; Mon, 2 Sep 2019 04:59:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2019 19:59:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,457,1559545200"; d="scan'208";a="211562406" Received: from npg-dpdk-zhangxiao.sh.intel.com ([10.67.110.190]) by fmsmga002.fm.intel.com with ESMTP; 01 Sep 2019 19:59:35 -0700 From: Zhang Xiao To: dev@dpdk.org Cc: wei.zhao1@intel.com, Zhang Xiao , stable@dpdk.org Date: Mon, 2 Sep 2019 19:52:12 +0800 Message-Id: <1567425132-59486-1-git-send-email-xiao.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-stable] net/ixgbe:fix wrong link status X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The link status for 82599eb got from link status register was not correct, check the enable/disable flag of tx laser when getting the link status, set the link status down if tx laser disabled since the tx laser flag could be set correctly when up/down the link status. Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF") Cc: stable@dpdk.org Signed-off-by: Zhang Xiao --- drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 87d2ad0..fc06a1a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2864,6 +2864,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev) } else { /* Turn on the laser */ ixgbe_enable_tx_laser(hw); + ixgbe_dev_link_update(dev, 0); } return 0; @@ -2894,6 +2895,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev) } else { /* Turn off the laser */ ixgbe_disable_tx_laser(hw); + ixgbe_dev_link_update(dev, 0); } return 0; @@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, u32 speed = 0; int wait = 1; bool autoneg = false; + u32 esdp_reg; memset(&link, 0, sizeof(link)); link.link_status = ETH_LINK_DOWN; @@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, return rte_eth_linkstatus_set(dev, &link); } + esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); + if ((esdp_reg & IXGBE_ESDP_SDP3)) + link_up = 0; + if (link_up == 0) { intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; return rte_eth_linkstatus_set(dev, &link); -- 2.7.4