summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2019-01-14 02:00:22 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-01-14 17:44:29 +0100
commit66fc1704a7ca3232d9e452cc486381e2bbe940b3 (patch)
tree230649891d6cc64457d656cfc5e459490094d3f4 /app
parentcc28a6907b228d55f02bfbf0a40498db0a22ea62 (diff)
downloaddpdk-next-eventdev-66fc1704a7ca3232d9e452cc486381e2bbe940b3.zip
dpdk-next-eventdev-66fc1704a7ca3232d9e452cc486381e2bbe940b3.tar.gz
dpdk-next-eventdev-66fc1704a7ca3232d9e452cc486381e2bbe940b3.tar.xz
app/testpmd: fix missing prefetch in macswap mode
Prefetching packet was missing when do_macswap() was optimized. Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86") Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/macswap_sse.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h
index 662fe79..2b6e732 100644
--- a/app/test-pmd/macswap_sse.h
+++ b/app/test-pmd/macswap_sse.h
@@ -35,6 +35,13 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
r = nb;
while (r >= 4) {
+ if (r >= 8) {
+ rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 4], void *));
+ rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 5], void *));
+ rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 6], void *));
+ rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 7], void *));
+ }
+
mb[0] = pkts[i++];
eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *);
addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]);