X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl3fwd%2Fl3fwd_em_sequential.h;fp=examples%2Fl3fwd%2Fl3fwd_em_sequential.h;h=cb7c2abbb6c081bbd09c02b104a897f3d3ad8807;hb=569b290cdb3630dadc6827791f960b0df4aa86c5;hp=d2a489e6f389ee5e8ffb45e97243e5bf6cfadef1;hpb=3c4b4024c2253d7016fefac39ff392016da27863;p=dpdk.git diff --git a/examples/l3fwd/l3fwd_em_sequential.h b/examples/l3fwd/l3fwd_em_sequential.h index d2a489e6f3..cb7c2abbb6 100644 --- a/examples/l3fwd/l3fwd_em_sequential.h +++ b/examples/l3fwd/l3fwd_em_sequential.h @@ -43,7 +43,11 @@ * compilation time. */ +#if defined RTE_ARCH_X86 #include "l3fwd_sse.h" +#elif defined RTE_MACHINE_CPUFLAG_NEON +#include "l3fwd_neon.h" +#endif static __rte_always_inline uint16_t em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, @@ -101,11 +105,21 @@ static inline void l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint8_t portid, struct lcore_conf *qconf) { - int32_t j; + int32_t i, j; uint16_t dst_port[MAX_PKT_BURST]; - for (j = 0; j < nb_rx; j++) + if (nb_rx > 0) { + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[0], + struct ether_hdr *) + 1); + } + + for (i = 1, j = 0; j < nb_rx; i++, j++) { + if (i < nb_rx) { + rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i], + struct ether_hdr *) + 1); + } dst_port[j] = em_get_dst_port(qconf, pkts_burst[j], portid); + } send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); }