There is a cache miss when accessing mbuf->data_off while cloning
a batch and using prefetch improved the throughput by ~2.3%.

Before: 13709416.30 pps
 After: 14031475.80 pps

Fixes: d48771848560 ("dp-packet: preserve headroom when cloning a pkt batch")
Signed-off-by: Flavio Leitner <f...@sysclose.org>
---
 lib/dp-packet.h | 4 ++++
 1 file changed, 4 insertions(+)

* This patch applies for branch-2.13 as well.

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 69ae5dfac..387f51261 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -1046,6 +1046,10 @@ dp_packet_batch_clone(struct dp_packet_batch *dst,
 
     dp_packet_batch_init(dst);
     DP_PACKET_BATCH_FOR_EACH (i, packet, src) {
+        if ((i + 1) < dp_packet_batch_size(src)) {
+            OVS_PREFETCH(src->packets[i+1]);
+        }
+
         uint32_t headroom = dp_packet_headroom(packet);
         struct dp_packet *pkt_clone;
 
-- 
2.24.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to