From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Boule Subject: Re: [PATCH] app/testpmd: add packet data prefetch in macswap loop Date: Tue, 3 May 2016 11:50:31 +0200 Message-ID: <57287467.7080702@6wind.com> References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> <20160503094516.GC21300@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, pablo.de.lara.guarch@intel.com To: Bruce Richardson , Jerin Jacob Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 6B4C65908 for ; Tue, 3 May 2016 11:50:44 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id a17so28810188wme.0 for ; Tue, 03 May 2016 02:50:44 -0700 (PDT) In-Reply-To: <20160503094516.GC21300@bricha3-MOBL3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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? Ivan > > /Bruce > >> mb = pkts_burst[i]; >> eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);