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 475992BC3 for ; Tue, 3 May 2016 12:20:25 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 03 May 2016 03:20:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,572,1455004800"; d="scan'208";a="696026347" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.29]) by FMSMGA003.fm.intel.com with SMTP; 03 May 2016 03:20:22 -0700 Received: by (sSMTP sendmail emulation); Tue, 03 May 2016 11:20:21 +0025 Date: Tue, 3 May 2016 11:20:21 +0100 From: Bruce Richardson To: Ivan Boule Cc: Jerin Jacob , dev@dpdk.org, pablo.de.lara.guarch@intel.com Message-ID: <20160503102021.GB15716@bricha3-MOBL3> References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> <20160503094516.GC21300@bricha3-MOBL3> <57287467.7080702@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57287467.7080702@6wind.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) 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, 03 May 2016 10:20:25 -0000 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 = 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 the end of > >the array, since it's only a hint to the cpu. If this is true for other 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] address > won't trigger a CPU exception? > Yep. For example, adding "rte_prefetch0(NULL)" at the start of main in testpmd causes no ill effects when running the app. /Bruce