]> git.droids-corp.org - dpdk.git/commitdiff
examples/l3fwd: remove useless calculations in NEON LPM
authorRuifeng Wang <ruifeng.wang@arm.com>
Thu, 10 Jun 2021 06:57:39 +0000 (06:57 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 5 Jul 2021 09:30:58 +0000 (11:30 +0200)
Both L2 and L3 headers will be used in forward processing. And these
two headers are in the same cache line. It has the same effect for
prefetching with L2 header address and prefetching with L3 header
address.

Changed to use L2 header address for prefetching. The change showed
no measurable performance improvement, but it definitely removed
unnecessary instructions for address calculation.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
examples/l3fwd/l3fwd_lpm_neon.h

index d6c0ba64abc1b4f055b775bfa0dcd5a4321732d8..78ee83b76ceff8445c824c41c694237fc7b98472 100644 (file)
@@ -98,14 +98,14 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
        if (k) {
                for (i = 0; i < FWDSTEP; i++) {
                        rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i],
-                                               struct rte_ether_hdr *) + 1);
+                                                       void *));
                }
 
                for (j = 0; j != k - FWDSTEP; j += FWDSTEP) {
                        for (i = 0; i < FWDSTEP; i++) {
                                rte_prefetch0(rte_pktmbuf_mtod(
                                                pkts_burst[j + i + FWDSTEP],
-                                               struct rte_ether_hdr *) + 1);
+                                               void *));
                        }
 
                        processx4_step1(&pkts_burst[j], &dip, &ipv4_flag);
@@ -125,17 +125,17 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
                switch (m) {
                case 3:
                        rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
-                                               struct rte_ether_hdr *) + 1);
+                                                       void *));
                        j++;
                        /* fallthrough */
                case 2:
                        rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
-                                               struct rte_ether_hdr *) + 1);
+                                                       void *));
                        j++;
                        /* fallthrough */
                case 1:
                        rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
-                                               struct rte_ether_hdr *) + 1);
+                                                       void *));
                        j++;
                }