From: Daniele Di Proietto Date: Mon, 15 Jun 2015 18:06:39 +0000 (+0100) Subject: dpif-netdev: Prefetch next packet before miniflow_extract(). X-Git-Tag: v2.4.0~91 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;ds=sidebyside;h=72a5e2b8fc8c7c316c0b9feb96b7be5b19265c7c;p=cascardo%2Fovs.git 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 --- 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);