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 D3C93A04B4; Tue, 19 Nov 2019 07:39:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A27D02BB1; Tue, 19 Nov 2019 07:39:22 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 176422B87; Tue, 19 Nov 2019 07:39:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2019 22:39:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,322,1569308400"; d="scan'208";a="215467585" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 18 Nov 2019 22:39:19 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 18 Nov 2019 22:39:19 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 Nov 2019 22:39:19 -0800 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 18 Nov 2019 22:39:18 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.215]) with mapi id 14.03.0439.000; Tue, 19 Nov 2019 14:39:18 +0800 From: "Cui, LunyuanX" To: "Ye, Xiaolong" CC: "dev@dpdk.org" , "Lu, Wenzhuo" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4] net/ixgbe: fix link status Thread-Index: AQHVneQhTtPd+TUcI0KXNzIbcMQyGqeRgwkAgACHfCA= Date: Tue, 19 Nov 2019 06:39:17 +0000 Message-ID: References: <20191118101345.42181-1-lunyuanx.cui@intel.com> <20191118153744.78987-1-lunyuanx.cui@intel.com> <20191119062749.GA101220@intel.com> In-Reply-To: <20191119062749.GA101220@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Hi, xiaolong > -----Original Message----- > From: Ye, Xiaolong > Sent: Tuesday, November 19, 2019 2:28 PM > To: Cui, LunyuanX > Cc: dev@dpdk.org; Lu, Wenzhuo ; > stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4] net/ixgbe: fix link status >=20 > On 11/18, Lunyuan Cui wrote: > >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. >=20 > So you call ixgbe_dev_set_link_down to disable tx laser, but > ixgbe_dev_set_link_down is more than just disable tx laser, will it has s= ome > side effects? There are not side effects. I call ixgbe_dev_set_link_down when port init. When port starts, It will deal with follows: if (hw->mac.ops.get_media_type(hw) =3D=3D ixgbe_media_type_copper) { /* Turn on the copper */ ixgbe_set_phy_power(hw, true); } else { /* Turn on the laser */ ixgbe_enable_tx_laser(hw); } So I think there are not side effects. >=20 > > > >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 =3D ixgbe_bypass_init_hw(hw); > > #else > > diag =3D ixgbe_init_hw(hw); > >+ hw->mac.autotry_restart =3D 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 > >