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 0CF82A00E6 for ; Mon, 2 Sep 2019 05:28:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D884C1C2AB; Mon, 2 Sep 2019 05:28:17 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id CCB501C1CD; Mon, 2 Sep 2019 05:28:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2019 20:28:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,457,1559545200"; d="scan'208";a="176212258" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga008.jf.intel.com with ESMTP; 01 Sep 2019 20:28:11 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.25]) by PGSMSX107.gar.corp.intel.com ([169.254.7.174]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 11:28:10 +0800 From: "Zhao1, Wei" To: "Zhang, Xiao" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: net/ixgbe:fix wrong link status Thread-Index: AQHVYTp1LmBwJv19BUeQySGb7Fqqk6cXujwg Date: Mon, 2 Sep 2019 03:28:09 +0000 Message-ID: References: <1567425132-59486-1-git-send-email-xiao.zhang@intel.com> In-Reply-To: <1567425132-59486-1-git-send-email-xiao.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Reviewed-by: Wei Zhao > -----Original Message----- > From: Zhang, Xiao > Sent: Monday, September 2, 2019 7:52 PM > To: dev@dpdk.org > Cc: Zhao1, Wei ; Zhang, Xiao ; > stable@dpdk.org > Subject: net/ixgbe:fix wrong link status >=20 > 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 cor= rectly > when up/down the link status. >=20 > Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF") > Cc: stable@dpdk.org >=20 > Signed-off-by: Zhang Xiao > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > 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); > } >=20 > 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); > } >=20 > return 0; > @@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev > *dev, > u32 speed =3D 0; > int wait =3D 1; > bool autoneg =3D false; > + u32 esdp_reg; >=20 > memset(&link, 0, sizeof(link)); > link.link_status =3D ETH_LINK_DOWN; > @@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev > *dev, > return rte_eth_linkstatus_set(dev, &link); > } >=20 > + esdp_reg =3D IXGBE_READ_REG(hw, IXGBE_ESDP); > + if ((esdp_reg & IXGBE_ESDP_SDP3)) > + link_up =3D 0; > + > if (link_up =3D=3D 0) { > intr->flags |=3D IXGBE_FLAG_NEED_LINK_CONFIG; > return rte_eth_linkstatus_set(dev, &link); > -- > 2.7.4