app/testpmd: prefetch data in the forwarding loop
[dpdk.git] / app / test-pmd / macfwd-retry.c
index 3a96b3d..d8cd069 100644 (file)
@@ -117,6 +117,9 @@ pkt_burst_mac_retry_forward(struct fwd_stream *fs)
 #endif
        fs->rx_packets += nb_rx;
        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 *);
                ether_addr_copy(&peer_eth_addrs[fs->peer_addr],