From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 2C0775902 for ; Mon, 2 May 2016 19:48:06 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 02 May 2016 10:48:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,568,1455004800"; d="scan'208";a="797075043" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga003.jf.intel.com with ESMTP; 02 May 2016 10:48:04 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.238]) by IRSMSX151.ger.corp.intel.com ([169.254.4.7]) with mapi id 14.03.0248.002; Mon, 2 May 2016 18:48:03 +0100 From: "De Lara Guarch, Pablo" To: Jerin Jacob , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop Thread-Index: AQHRpGo45P/QjXDI7ES0+F+BQvxmz5+l7Clg Date: Mon, 2 May 2016 17:48:02 +0000 Message-ID: References: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> In-Reply-To: <1462190377-26865-1-git-send-email-jerin.jacob@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWFiZjIwMzYtNGE1ZC00ZjAzLTgyNjUtY2FhN2ZlYmE2MjBkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ilp0MFk3dkMweVhYV3BzcDVONmg5MVR4SmU5QTJOcDJkRmozaDlVWTFVRmc9In0= 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: Mon, 02 May 2016 17:48:06 -0000 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 >=20 > prefetch the next packet data address in advance in macswap loop > for performance improvement. >=20 > Signed-off-by: Jerin Jacob > --- > app/test-pmd/macswap.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > 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 |=3D PKT_TX_QINQ_PKT; > for (i =3D 0; i < nb_rx; i++) { > + if (likely(i < nb_rx - 1)) > + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], > + void *)); > mb =3D pkts_burst[i]; > eth_hdr =3D rte_pktmbuf_mtod(mb, struct ether_hdr *); >=20 > -- > 2.1.0 This looks good. Could you also add it in the other forwarding modes (the o= nes that make changes in the packets)? Thanks, Pablo