From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ivan.boule@6wind.com>
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 <dev@dpdk.org>; Tue,  3 May 2016 11:50:44 +0200 (CEST)
Received: by mail-wm0-f47.google.com with SMTP id a17so28810188wme.0
 for <dev@dpdk.org>; Tue, 03 May 2016 02:50:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=subject:to:references:cc:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=mWpp//J9FkCMbPKyPQJZ6yFel0jLmiFPu1U/dItaedM=;
 b=PNQe2b49b36qFJWTcnjEx8CHL3jQ0Sdhmom2v53ty3L2+Eq0krDNq4QZ4GpVukDjut
 4yYHzTX1uMrgfog3TvrzhsH6xl66jNBg5rs+V39Q4qoTG7rNuk0lZxApbK1sUBBLbYtw
 I/M2heF64BhOf2TVumGSJPVCErIfiGmqw0wuKeqey2Bb+sgOyCRhJ5i8L+3KcLejhMS2
 Q4D1Qg1LNW2yv4T4yoKuhtF5eUGzEr6ZqN8cDsSsLbWo9HHZlY/h4/ZOtg0pky93Bccs
 1TRu00p87k4gNTofVml5bpt44lWzTOP8z0hJiUf5bwNRDYc4tth4tt29Hgb4JLzKXaEL
 XNag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:subject:to:references:cc:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=mWpp//J9FkCMbPKyPQJZ6yFel0jLmiFPu1U/dItaedM=;
 b=RaR1eAVq2u0PEartZFP634WZM8C1Dv1qc2uNFivea+kf0B9MYC3vrU2oAwvWnDz28G
 6sINzVjl7v2eQMiAc2R/t6JLBcIvxuD2fbVYzCXiMpP7fGj5gPgekfi4+edd317hDh7Z
 2fiF4354fNO09IGgBJafI+tyU//A60XKvbdHueFLju/DieENH7RoLrAVh6RPmb7Provn
 wIcTkXkMhfet4ce2BgSQwoztB2Tc/eDPKoBF9wXrpyA97JJxx2wi2ZpwdYYV6K4sIvjn
 pYOO92WTHOqlW1+oInUEqWAPw9Kq+p6m/kxj884e05JczLiE5LKKrMVpXp4Gb+xqyrGT
 lROw==
X-Gm-Message-State: AOPr4FX9WwNYfj160A0gT8kOigGSdPKgjy+gZoFVrr15cmUhpTbWjqEoxon6HuUaf7cjuXtI
X-Received: by 10.28.105.200 with SMTP id z69mr2295027wmh.78.1462269044284;
 Tue, 03 May 2016 02:50:44 -0700 (PDT)
Received: from [10.16.0.189] (guy78-3-82-239-227-177.fbx.proxad.net.
 [82.239.227.177])
 by smtp.gmail.com with ESMTPSA id f135sm3452899wmf.22.2016.05.03.02.50.42
 (version=TLSv1/SSLv3 cipher=OTHER);
 Tue, 03 May 2016 02:50:43 -0700 (PDT)
To: Bruce Richardson <bruce.richardson@intel.com>,
 Jerin Jacob <jerin.jacob@caviumnetworks.com>
References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com>
 <20160503094516.GC21300@bricha3-MOBL3>
Cc: dev@dpdk.org, pablo.de.lara.guarch@intel.com
From: Ivan Boule <ivan.boule@6wind.com>
Message-ID: <57287467.7080702@6wind.com>
Date: Tue, 3 May 2016 11:50:31 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Icedove/38.7.0
MIME-Version: 1.0
In-Reply-To: <20160503094516.GC21300@bricha3-MOBL3>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 03 May 2016 09:50:44 -0000

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 *);