From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B06FF2D13 for ; Tue, 29 May 2018 16:48:00 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 07:47:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,456,1520924400"; d="scan'208";a="44803105" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga007.jf.intel.com with ESMTP; 29 May 2018 07:47:58 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 May 2018 15:47:58 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.148]) by irsmsx112.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Tue, 29 May 2018 15:47:57 +0100 From: "Zhang, Roy Fan" To: "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix link status update Thread-Index: AQHT91X5ZXxw/dz8IUiNJpBvzhvrqKRGyT5g Date: Tue, 29 May 2018 14:47:57 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C604333FBB2F@IRSMSX101.ger.corp.intel.com> References: <20180529135443.85160-1-roy.fan.zhang@intel.com> In-Reply-To: <20180529135443.85160-1-roy.fan.zhang@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzVjZGQ2ODUtMmM3MS00Mjk4LWJiMWMtYTdjMTFkOWJkYWYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZDVKUUxCeXFhUkxIVVFyQWltWEg4OUJFVVA3bHAySmNFMzBPak0rMUxacHhMa2RSRWpVd2ZUejU1Q2EzUWVnNiJ9 dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] net/i40e: fix link status update 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: , X-List-Received-Date: Tue, 29 May 2018 14:48:01 -0000 Please ignore this patch as I accidently sent it... Sorry for any convenience I caused. > -----Original Message----- > From: Zhang, Roy Fan > Sent: Tuesday, May 29, 2018 2:55 PM > To: Zhang, Helin ; Zhang, Roy Fan > > Cc: stable@dpdk.org > Subject: [PATCH] net/i40e: fix link status update >=20 > This patch fixes link status update problem in interrupt mode. >=20 > Fixes: eef2daf2e199 ("net/i40e: fix link update no wait") > Cc: stable@dpdk.org >=20 > Signed-off-by: Fan Zhang > --- > drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 7d4f1c9da..13c5d3296 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -2522,7 +2522,7 @@ i40e_dev_set_link_down(struct rte_eth_dev > *dev) } >=20 > static __rte_always_inline void > -update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link) > +update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link) > { > /* Link status registers and values*/ > #define I40E_PRTMAC_LINKSTA 0x001E2420 > @@ -2576,8 +2576,8 @@ update_link_no_wait(struct i40e_hw *hw, struct > rte_eth_link *link) } >=20 > static __rte_always_inline void > -update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link, > - bool enable_lse) > +update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link, > + bool enable_lse, int wait_to_complete) > { > #define CHECK_INTERVAL 100 /* 100ms */ > #define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */ > @@ -2601,7 +2601,7 @@ update_link_wait(struct i40e_hw *hw, struct > rte_eth_link *link, > } >=20 > link->link_status =3D link_status.link_info & I40E_AQ_LINK_UP; > - if (unlikely(link->link_status !=3D 0)) > + if (!wait_to_complete || link->link_status) > break; >=20 > rte_delay_ms(CHECK_INTERVAL); > @@ -2649,10 +2649,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev, > link.link_autoneg =3D !(dev->data->dev_conf.link_speeds & > ETH_LINK_SPEED_FIXED); >=20 > - if (!wait_to_complete) > - update_link_no_wait(hw, &link); > + if (!wait_to_complete && !enable_lse) > + update_link_reg(hw, &link); > else > - update_link_wait(hw, &link, enable_lse); > + update_link_aq(hw, &link, enable_lse, wait_to_complete); >=20 > ret =3D rte_eth_linkstatus_set(dev, &link); > i40e_notify_all_vfs_link_status(dev); > -- > 2.13.6