dp-packet: prefetch the next packet when cloning a batch.
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: ("dp-packet: preserve headroom when cloning a pkt batch")
@@ -1048,6 +1048,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;
