From 72a5e2b8fc8c7c316c0b9feb96b7be5b19265c7c Mon Sep 17 00:00:00 2001 From: Daniele Di Proietto Date: Mon, 15 Jun 2015 19:06:39 +0100 Subject: [PATCH] dpif-netdev: Prefetch next packet before miniflow_extract(). It appears that miniflow_extract() in emc_processing() spends a lot of cycles waiting for the packet's data to be read. Prefetching the next packet's data while parsing removes this delay. For a single flow pipeline the throughput improves by ~10%. With a more realistic pipeline the change has a much smaller effect (~0.5% improvement) Signed-off-by: Daniele Di Proietto Signed-off-by: Ethan Jackson Acked-by: Ethan Jackson --- lib/dpif-netdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 5b82c8b63..f13169c14 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3150,6 +3150,11 @@ emc_processing(struct dp_netdev_pmd_thread *pmd, struct dp_packet **packets, continue; } + if (i != cnt - 1) { + /* Prefetch next packet data */ + OVS_PREFETCH(dp_packet_data(packets[i+1])); + } + miniflow_extract(packets[i], &key.mf); key.len = 0; /* Not computed yet. */ key.hash = dpif_netdev_packet_get_rss_hash(packets[i], &key.mf); -- 2.20.1