From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5CABD3989 for ; Tue, 29 May 2018 10:34:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 01:34:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,455,1520924400"; d="scan'208";a="53077438" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 29 May 2018 01:34:55 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 May 2018 01:34:55 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 May 2018 01:34:54 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.82]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Tue, 29 May 2018 16:34:52 +0800 From: "Yang, Qiming" To: "Wang, Haiyue" , "Xu, Rosen" CC: "stable@dpdk.org" Thread-Topic: [PATCH Preview] net/i40e: workaround for Fortville performance Thread-Index: AQHT9yZ8EsthrwrRnkmBgH7kdl3GeaRGYVoA Date: Tue, 29 May 2018 08:34:51 +0000 Message-ID: References: <1527582265-5864-1-git-send-email-haiyue.wang@intel.com> In-Reply-To: <1527582265-5864-1-git-send-email-haiyue.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTlmZmNkZjgtYjNhMy00MjA3LWFlMmEtNmJlOGVlMjNhZmNmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkFEOTBkYk9BV0gzRVUxcVdrVUFxQUdaNnkzdDJTVXZhQVVZV2I4RXZjeDQ9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action 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-stable] [PATCH Preview] net/i40e: workaround for Fortville performance 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 08:34:58 -0000 Hi, Haiyue Do you forget to send to dev@dpdk.org? Qiming > -----Original Message----- > From: Wang, Haiyue > Sent: Tuesday, May 29, 2018 4:24 PM > To: Wang, Haiyue ; Xu, Rosen ; > Yang, Qiming > Cc: stable@dpdk.org > Subject: [PATCH Preview] net/i40e: workaround for Fortville performance >=20 > The GL_SWR_PM_UP_THR value is not impacted from the link speed, its value= is > set according to the total number of ports for a better pipe-monitor > configuration. >=20 > All bellowing relevant device IDs are considered (NICs, LOMs, Mezz and > Backplane): >=20 > Device-ID Value Comments > 0x1572 0x03030303 10G SFI > 0x1581 0x03030303 10G Backplane > 0x1586 0x03030303 10G BaseT > 0x1589 0x03030303 10G BaseT (FortPond) > 0x1580 0x06060606 40G Backplane > 0x1583 0x06060606 2x40G QSFP > 0x1584 0x06060606 1x40G QSFP > 0x1587 0x06060606 20G Backplane (HP) > 0x1588 0x06060606 20G KR2 (HP) > 0x158A 0x06060606 25G Backplane > 0x158B 0x06060606 25G SFP28 >=20 > Fixes: c9223a2bf53c ("i40e: workaround for XL710 performance") > Fixes: 75d133dd3296 ("net/i40e: enable 25G device") > Cc: stable@dpdk.org >=20 > Signed-off-by: Haiyue Wang > --- > drivers/net/i40e/i40e_ethdev.c | 71 > +++++++++++++++++++++++++++++++++++++----- > 1 file changed, 64 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 7d4f1c9..04a2056 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -10003,6 +10003,60 @@ enum i40e_filter_pctype > #define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 > #define I40E_GL_SWR_PM_UP_THR 0x269FBC >=20 > +/* > + * GL_SWR_PM_UP_THR: > + * The value is not impacted from the link speed, its value is set > +according > + * to the total number of ports for a better pipe-monitor configuration. > + */ > +static int > +i40e_get_swr_pm_cfg(struct i40e_hw *hw, uint64_t *value) { #define > +I40E_GL_SWR_PM_EF_DEVICE(dev) \ > + .device_id =3D (dev), \ > + .val =3D I40E_GL_SWR_PM_UP_THR_EF_VALUE > + > +#define I40E_GL_SWR_PM_SF_DEVICE(dev) \ > + .device_id =3D (dev), \ > + .val =3D I40E_GL_SWR_PM_UP_THR_SF_VALUE > + > + static const struct { > + uint16_t device_id; > + uint64_t val; > + } swr_pm_table[] =3D { > + { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_XL710) }, > + { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_KX_C) }, > + { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T) }, > + { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T4) }, > + > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_KX_B) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_A) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_B) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2_A) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_B) }, > + { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_SFP28) }, > + }; > + uint32_t i; > + > + if (value =3D=3D NULL) { > + PMD_DRV_LOG(ERR, "value is NULL"); > + return 0; > + } > + > + for (i =3D 0; i < RTE_DIM(swr_pm_table); i++) { > + if (hw->device_id =3D=3D swr_pm_table[i].device_id) { > + *value =3D swr_pm_table[i].val; > + > + PMD_DRV_LOG(DEBUG, "Device 0x%" PRIx16 " with " > + "GL_SWR_PM_UP_THR setting to 0x%" > PRIx64, > + hw->device_id, *value); > + return 1; > + } > + } > + > + return 0; > +} > + > static int > i40e_dev_sync_phy_type(struct i40e_hw *hw) { @@ -10067,13 +10121,16 @@ > enum i40e_filter_pctype > } >=20 > if (reg_table[i].addr =3D=3D I40E_GL_SWR_PM_UP_THR) { > - if (I40E_PHY_TYPE_SUPPORT_40G(hw->phy.phy_types) > || /* For XL710 */ > - I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) > /* For XXV710 */ > - reg_table[i].val =3D > - I40E_GL_SWR_PM_UP_THR_SF_VALUE; > - else /* For X710 */ > - reg_table[i].val =3D > - > I40E_GL_SWR_PM_UP_THR_EF_VALUE; > + uint64_t cfg_val; > + > + if (!i40e_get_swr_pm_cfg(hw, &cfg_val)) { > + PMD_DRV_LOG(DEBUG, "Device 0x%" PRIx16 > "skips " > + "GL_SWR_PM_UP_THR setting", > + hw->device_id); > + continue; > + } > + > + reg_table[i].val =3D cfg_val; > } >=20 > ret =3D i40e_aq_debug_read_register(hw, reg_table[i].addr, > -- > 1.8.3.1