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 A0E595A95 for ; Mon, 12 Jan 2015 08:33:38 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 11 Jan 2015 23:33:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,742,1413270000"; d="scan'208";a="635895628" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga001.jf.intel.com with ESMTP; 11 Jan 2015 23:33:36 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 12 Jan 2015 15:33:34 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.182]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0195.001; Mon, 12 Jan 2015 15:33:33 +0800 From: "Wu, Jingjing" To: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [PATCH v2] i40e: workaround for XL710 performance Thread-Index: AQHQIwiZ830LXAWliUq+3pGzGsbMvJy8K4BQ Date: Mon, 12 Jan 2015 07:33:34 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8B6F609@SHSMSX104.ccr.corp.intel.com> References: <1419405248-14158-1-git-send-email-helin.zhang@intel.com> <1419817288-22957-1-git-send-email-helin.zhang@intel.com> In-Reply-To: <1419817288-22957-1-git-send-email-helin.zhang@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 v2] i40e: workaround for XL710 performance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 07:33:39 -0000 > -----Original Message----- > From: Zhang, Helin > Sent: Monday, December 29, 2014 9:41 AM > To: dev@dpdk.org > Cc: nhorman@tuxdriver.com; Xu, Qian Q; Cao, Waterman; Lu, Patrick; Liu, > Jijiang; Wu, Jingjing; Zhang, Helin > Subject: [PATCH v2] i40e: workaround for XL710 performance >=20 > On XL710, performance number is far from the expectation on recent > firmware versions, if promiscuous mode is disabled, or promiscuous mode i= s > enabled and port MAC address is equal to the packet destination MAC > address. The fix for this issue may not be integrated in the following > firmware version. So the workaround in software driver is needed. For XL7= 10, > it needs to modify the initial values of 3 internal only registers, which= are the > same as X710. > Note that the values for X710 and XL710 registers could be different, and= the > workaround can be removed when it is fixed in firmware in the future. >=20 > Signed-off-by: Helin Zhang > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++--- > ---------- > 1 file changed, 30 insertions(+), 14 deletions(-) >=20 > v2 changes: > * Supported modifying the address of 0x269FBC of XL710 during > initialization, to fix the minor performance gap to expectation. > That means XL710 can meet the performance expectation with this > workaround. >=20 > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index b47a3d2..8982920 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -5327,38 +5327,54 @@ i40e_debug_read_register(struct i40e_hw *hw, > uint32_t addr, uint64_t *val) >=20 > /* > * On X710, performance number is far from the expectation on recent > firmware > - * versions. The fix for this issue may not be integrated in the followi= ng > + * versions; on XL710, performance number is also far from the > + expectation on > + * recent firmware versions, if promiscuous mode is disabled, or > + promiscuous > + * mode is enabled and port MAC address is equal to the packet > + destination MAC > + * address. The fix for this issue may not be integrated in the > + following > * firmware version. So the workaround in software driver is needed. It > needs > - * to modify the initial values of 3 internal only registers. Note that = the > + * to modify the initial values of 3 internal only registers for both > + X710 and > + * XL710. Note that the values for X710 or XL710 could be different, > + and the > * workaround can be removed when it is fixed in firmware in the future. > */ > -static void > -i40e_configure_registers(struct i40e_hw *hw) -{ > + > +/* For both X710 and XL710 */ > +#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > #define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > + > +#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > #define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > + > +/* For X710 */ > +#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303 > +/* For XL710 */ > +#define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 > #define I40E_GL_SWR_PM_UP_THR 0x269FBC > -#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 -#define > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > -#define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 >=20 > - static const struct { > +static void > +i40e_configure_registers(struct i40e_hw *hw) { > + static struct { > uint32_t addr; > uint64_t val; > } reg_table[] =3D { > {I40E_GL_SWR_PRI_JOIN_MAP_0, > I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE}, > {I40E_GL_SWR_PRI_JOIN_MAP_2, > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE}, > - {I40E_GL_SWR_PM_UP_THR, > I40E_GL_SWR_PM_UP_THR_VALUE}, > + {I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value > dynamically */ > }; > uint64_t reg; > uint32_t i; > int ret; >=20 > - /* Below fix is for X710 only */ > - if (i40e_is_40G_device(hw->device_id)) > - return; > - > for (i =3D 0; i < RTE_DIM(reg_table); i++) { > + if (reg_table[i].addr =3D=3D I40E_GL_SWR_PM_UP_THR) { > + if (i40e_is_40G_device(hw->device_id)) /* For XL710 > */ > + 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; > + } > + > ret =3D i40e_debug_read_register(hw, reg_table[i].addr, ®); > if (ret < 0) { > PMD_DRV_LOG(ERR, "Failed to read from > 0x%"PRIx32, > -- > 1.9.3 Acked-by: Jingjing Wu