From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2975AA034E; Wed, 9 Feb 2022 03:38:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC65F410F3; Wed, 9 Feb 2022 03:38:38 +0100 (CET) Received: from smtpbgeu2.qq.com (smtpbgeu2.qq.com [18.194.254.142]) by mails.dpdk.org (Postfix) with ESMTP id 3F3FD4067E for ; Wed, 9 Feb 2022 03:38:36 +0100 (CET) X-QQ-mid: bizesmtp17t1644374311t0pcuaoy Received: from jiawenwu (unknown [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 09 Feb 2022 10:38:30 +0800 (CST) X-QQ-SSF: 01400000000000F0L000B00A0000000 X-QQ-FEAT: M6vHyecn5Ati4QCMUWaa04XyZHjNAGFDnuoCTFA8QuMLv4aw0I/TxmE31yG2W fBKHSzIMoERMW7eS6Vzhg+nWB6n2DySmbX+Mieo8Q8zmoIzm7eZVBAiIZYj0FgYtvEhwGkM bNSA2hPps068evDsS40JERTNK7k+0/ZZdUU1sXAli0ZgzbexKFS9ePHwfGsojF+Ab/axwrY mEjMDu99U5DJWrH69amnvORlSXw8HtUdt1ypRTrXNY2B7s7kUvo7y1kseIajrc7WbaI2pyN cvMXeeZqKNr59gsyi8FiSpU0eh75HbAF3qdXiHgqS2GOWSngHXT7GawGlbaWEoA3c7l5U2h c0cS1PPQoNu/qJ4+iGDp8qTSAYsVQ== X-QQ-GoodBg: 2 From: "Jiawen Wu" To: "'Ferruh Yigit'" , Cc: "'Luca Boccassi'" , "'Kevin Traynor'" References: <20220208101129.69173-1-jiawenwu@trustnetic.com> <20220208101129.69173-6-jiawenwu@trustnetic.com> <7f30844a-db92-cb12-8264-486876c9ed27@intel.com> In-Reply-To: <7f30844a-db92-cb12-8264-486876c9ed27@intel.com> Subject: RE: [PATCH 5/9] net/ngbe: optimize the PHY initialization process Date: Wed, 9 Feb 2022 10:38:30 +0800 Message-ID: <014c01d81d5e$20b00ed0$62102c70$@trustnetic.com>+4FE605CD74ACC088 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHTyKOf1otGGvNycD4vyc9g5KAuLAHQPEv1ArNyfKGsbwW0sA== Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On February 9, 2022 1:40 AM, Ferruh Yigit wrote: > On 2/8/2022 10:11 AM, Jiawen Wu wrote: > > Reduce the probability of PHY init failure, And add its error = return. > > >=20 > Patch is missing stable tag, is it intentional? > Or do you want patch not to be backported? >=20 Because PHY init failed never occurred in our local tests with the = original code. But the problem of failure to link up recently appeared in the customer, = which is extremely unlikely, and we think it is related to PHY = initialization. At the driver level, this fix addresses some potential risks. However, = due to different hardware (customers use our chips to make their own = network cards), this fix cannot be fully proven to be effective. So this is just an optimization that we think needs to be done. > > Signed-off-by: Jiawen Wu >=20 > <...> >=20 > > @@ -234,17 +242,7 @@ s32 ngbe_reset_phy_rtl(struct ngbe_hw *hw) > > value |=3D RTL_BMCR_RESET; > > status =3D hw->phy.write_reg(hw, RTL_BMCR, RTL_DEV_ZERO, value); > > > > - for (i =3D 0; i < RTL_PHY_RST_WAIT_PERIOD; i++) { > > - status =3D hw->phy.read_reg(hw, RTL_BMCR, RTL_DEV_ZERO, > &value); > > - if (!(value & RTL_BMCR_RESET)) > > - break; > > - msleep(1); > > - } > > - > > - if (i =3D=3D RTL_PHY_RST_WAIT_PERIOD) { > > - DEBUGOUT("PHY reset polling failed to complete.\n"); > > - return NGBE_ERR_RESET_FAILED; > > - }=09 > > + msec_delay(5); > > >=20 > There are hardcoded delays added in this patch and other ones in this = set, I just > want to remind that this can lead unexpected (and very hard to debug) = errors. Yes, this polling never succeeded. So we think hardcoded delay is just = required.