diff options
author | Flavio Leitner <fbl@sysclose.org> | 2020-02-07 09:01:13 -0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2020-02-10 09:41:15 -0800 |
commit | c72401297078a305c85f2c78a3640ce84260bfae (patch) | |
tree | 75476a0789bce5f269416842e445acb92e92683b /lib | |
parent | e14fbdbb5ba137884095caa849735a78ffef0da0 (diff) | |
download | openvswitch-c72401297078a305c85f2c78a3640ce84260bfae.tar.gz |
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: d48771848560 ("dp-packet: preserve headroom when cloning a pkt batch")
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dp-packet.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 9a9d35183..9f8991faa 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -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; |