From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] app/testpmd: add packet data prefetch in macswap loop Date: Tue, 3 May 2016 18:16:43 +0530 Message-ID: <20160503124642.GA9948@localhost.localdomain> References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: "dev@dpdk.org" To: "De Lara Guarch, Pablo" Return-path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0097.outbound.protection.outlook.com [157.56.110.97]) by dpdk.org (Postfix) with ESMTP id C321A590B for ; Tue, 3 May 2016 14:47:06 +0200 (CEST) Content-Disposition: inline In-Reply-To: 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 Mon, May 02, 2016 at 05:48:02PM +0000, De Lara Guarch, Pablo wrote: > Hi Jerin, > > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Monday, May 02, 2016 1:00 PM > > To: dev@dpdk.org > > Cc: De Lara Guarch, Pablo; Jerin Jacob > > Subject: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in > > macswap loop > > > > prefetch the next packet data address in advance in macswap loop > > for performance improvement. > > > > Signed-off-by: Jerin Jacob > > --- > > app/test-pmd/macswap.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c > > index 154889d..c10f4b5 100644 > > --- a/app/test-pmd/macswap.c > > +++ b/app/test-pmd/macswap.c > > @@ -113,6 +113,9 @@ pkt_burst_mac_swap(struct fwd_stream *fs) > > if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ) > > ol_flags |= PKT_TX_QINQ_PKT; > > for (i = 0; i < nb_rx; i++) { > > + if (likely(i < nb_rx - 1)) > > + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], > > + void *)); > > mb = pkts_burst[i]; > > eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); > > > > -- > > 2.1.0 > > This looks good. Could you also add it in the other forwarding modes (the ones that make changes in the packets)? OK Pablo. I will add the similar logic in the following forwarding modes in testpmd. macswap macfwd macfwd-retry csumonly icmpecho /Jerin > > Thanks, > Pablo