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 27F3FA04B1; Tue, 24 Nov 2020 06:56:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B4A48C924; Tue, 24 Nov 2020 06:56:28 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3D0C1C8F4; Tue, 24 Nov 2020 06:56:26 +0100 (CET) IronPort-SDR: nHF3usCYik8ru3GEW1DOB3YFWByXvm9veHtz+0PiLvKe/ZZ+fbkb3TJzcaCT+vWb2sKFQImFjm BmfOJ/hjHmiw== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="171991083" X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="171991083" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 21:56:23 -0800 IronPort-SDR: FsEyQEsCU6nUsw0bzbaKzvw+Vmn42+/sbhSVno22z0o1Xh/971e3IhTn31SUAjRFdcBAPJT5u5 efwpXMjGn5/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="361738123" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 23 Nov 2020 21:56:23 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 23 Nov 2020 21:56:21 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 24 Nov 2020 13:56:19 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Tue, 24 Nov 2020 13:56:19 +0800 From: "Guo, Jia" To: "Xing, Beilei" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: fix global register recovery Thread-Index: AQHWvlGkigrbq982wEKWYgCeZecI8qnW0ByA Date: Tue, 24 Nov 2020 05:56:19 +0000 Message-ID: <46dc7f84914d48c3b4fdb257cc9762e7@intel.com> References: <20201119061616.37482-1-beilei.xing@intel.com> <20201120084947.40064-1-beilei.xing@intel.com> In-Reply-To: <20201120084947.40064-1-beilei.xing@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix global register recovery 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" Acked-by: Jeff Guo > -----Original Message----- > From: Xing, Beilei > Sent: Friday, November 20, 2020 4:50 PM > To: dev@dpdk.org > Cc: Guo, Jia ; Xing, Beilei ; > stable@dpdk.org > Subject: [PATCH v2] net/i40e: fix global register recovery >=20 > From: Beilei Xing >=20 > PMD configures the global register I40E_GLINT_CTL during device > initialization to work around the Rx write back issue. But when a device = is > bound from DPDK to kernel, the global register is not recovered to the > original state, it will cause kernel driver performance drop issue. > This patch fixes this issue. >=20 > Fixes: be6c228d4da3 ("i40e: support Rx interrupt") > Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with multi-driver"= ) > Cc: stable@dpdk.org >=20 > Signed-off-by: Beilei Xing > --- >=20 > v2 change: > - refine commit log >=20 > drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index f54769c29d..2cb18ecc03 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct > i40e_pf *pf) > I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); } >=20 > +static inline void i40e_clear_automask(struct i40e_pf *pf) { > + struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); > + uint32_t val; > + > + val =3D I40E_READ_REG(hw, I40E_GLINT_CTL); > + val &=3D ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK | > + I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK); > + > + if (!pf->support_multi_driver) > + val &=3D ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK; > + > + I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); } > + > #define I40E_FLOW_CONTROL_ETHERTYPE 0x8808 >=20 > /* > @@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev) > /* Remove all Traffic Manager configuration */ > i40e_tm_conf_uninit(dev); >=20 > + i40e_clear_automask(pf); > + > hw->adapter_closed =3D 1; > return ret; > } > -- > 2.26.2