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 4BE08A04FA; Tue, 17 Dec 2019 07:15:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B5A81BEDE; Tue, 17 Dec 2019 07:15:26 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4E9731BE9E; Tue, 17 Dec 2019 07:15:25 +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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2019 22:15:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,324,1571727600"; d="scan'208";a="247319479" Received: from intel.sh.intel.com ([10.239.255.129]) by fmsmga002.fm.intel.com with ESMTP; 16 Dec 2019 22:15:22 -0800 From: Lunyuan Cui To: dev@dpdk.org Cc: Wenzhuo Lu , Qiming Yang , Lunyuan Cui , stable@dpdk.org Date: Tue, 17 Dec 2019 06:12:03 +0000 Message-Id: <20191217061203.47833-1-lunyuanx.cui@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ixgbe: fix ixgbevf 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 ixgbevf is not correct when PF link up. IXGBE_ESDP register is only used when media type is fiber. Fixes: 1ca05831b9be ("net/ixgbe: fix link status") Cc: stable@dpdk.org Signed-off-by: Lunyuan Cui --- drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 2c6fd0f13..a3f550c53 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4155,9 +4155,11 @@ 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 (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { + esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); + if ((esdp_reg & IXGBE_ESDP_SDP3)) + link_up = 0; + } if (link_up == 0) { if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { -- 2.17.1