DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop
@ 2016-05-02 11:59 Jerin Jacob
  2016-05-02 17:48 ` De Lara Guarch, Pablo
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jerin Jacob @ 2016-05-02 11:59 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, Jerin Jacob

prefetch the next packet data address in advance in macswap loop
for performance improvement.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-06-08 15:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02 11:59 [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop Jerin Jacob
2016-05-02 17:48 ` De Lara Guarch, Pablo
2016-05-03 12:46   ` Jerin Jacob
2016-05-03  9:45 ` Bruce Richardson
2016-05-03  9:48   ` De Lara Guarch, Pablo
2016-05-03 10:16     ` Bruce Richardson
2016-05-03  9:50   ` Ivan Boule
2016-05-03 10:20     ` Bruce Richardson
2016-05-10 12:26       ` Ananyev, Konstantin
2016-05-03 14:07 ` [dpdk-dev] [PATCH v2] app/testpmd: add packet data pointer prefetch in the forwarding loop Jerin Jacob
2016-05-03 14:33   ` Thomas Monjalon
2016-06-07 11:19   ` De Lara Guarch, Pablo
2016-06-08 15:57     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).