From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5D3ED9AE6 for ; Tue, 10 May 2016 14:26:49 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 10 May 2016 05:26:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,604,1455004800"; d="scan'208";a="976463491" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga002.fm.intel.com with ESMTP; 10 May 2016 05:26:47 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.130]) by IRSMSX152.ger.corp.intel.com ([169.254.6.54]) with mapi id 14.03.0248.002; Tue, 10 May 2016 13:26:46 +0100 From: "Ananyev, Konstantin" To: "Richardson, Bruce" , Ivan Boule CC: Jerin Jacob , "dev@dpdk.org" , "De Lara Guarch, Pablo" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop Thread-Index: AQHRpSCf3/oQujiYCkKKayn9alA8QJ+m53CAgAAIVoCACzNycA== Date: Tue, 10 May 2016 12:26:45 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B4F355@irsmsx105.ger.corp.intel.com> References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> <20160503094516.GC21300@bricha3-MOBL3> <57287467.7080702@6wind.com> <20160503102021.GB15716@bricha3-MOBL3> In-Reply-To: <20160503102021.GB15716@bricha3-MOBL3> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzJmZTdkYWMtYjk0NC00Yjk5LTk0ZDctN2FiODI4MGMxZGUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IklIcm5JWGJvc294V3VxUjN1MkVNb0hWN3gzZmxJeXM2RHVDVkRyWWpRRGM9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop 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: Tue, 10 May 2016 12:26:51 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Tuesday, May 03, 2016 11:20 AM > To: Ivan Boule > Cc: Jerin Jacob; dev@dpdk.org; De Lara Guarch, Pablo > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in = macswap loop >=20 > On Tue, May 03, 2016 at 11:50:31AM +0200, Ivan Boule wrote: > > On 05/03/2016 11:45 AM, Bruce Richardson wrote: > > >On Mon, May 02, 2016 at 05:29:37PM +0530, Jerin Jacob wrote: > > >>prefetch the next packet data address in advance in macswap loop > > >>for performance improvement. > > >> > > >>... > > >> for (i =3D 0; i < nb_rx; i++) { > > >>+ if (likely(i < nb_rx - 1)) > > >>+ rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], > > >>+ void *)); > > > > > >At least on IA platforms, there is no issue with prefetching beyond th= e end of > > >the array, since it's only a hint to the cpu. If this is true for othe= r platforms, > > >then I suggest we just drop the conditional and just always prefetch. > > > > This is an interesting point. > > Bruce, are you suggesting that prefetching at an invalid [virtual] addr= ess > > won't trigger a CPU exception? > > >=20 > Yep. For example, adding "rte_prefetch0(NULL)" at the start of main in te= stpmd > causes no ill effects when running the app. >=20 One correction - while on IA prefetch(inval_addr) wouldn't cause any functi= onal problems, it still might cause DTLB miss and can be a source of noticeable performanc= e degradation. So it is better to avoid such constructions for performance critical code. Konstantin