aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@linaro.org>2015-10-22 18:07:03 +0100
committerZoltan Kiss <zoltan.kiss@linaro.org>2016-04-05 17:56:45 +0100
commit0af1affc900873b81e134d90a6d7f9d9670cb303 (patch)
tree4185dc918903deb8c9acc62b3b6711b8488ace4b
parent6bf0faf0b20a419d6aea44e302e8f9c42c6ac983 (diff)
downloadodp-ovs-0af1affc900873b81e134d90a6d7f9d9670cb303.tar.gz
dpif-netdev: move header prefetch earlier into the receive function
It's better to have it in the cache as soon as possible. On my test setup it meant a 0.7 Mpps increase. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r--lib/dpif-netdev.c5
-rw-r--r--lib/netdev-dpdk.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 58550cb75..570532829 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3236,11 +3236,6 @@ 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);
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 4658416dc..330a5628b 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1019,7 +1019,7 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets,
struct netdev_rxq_dpdk *rx = netdev_rxq_dpdk_cast(rxq_);
struct netdev *netdev = rx->up.netdev;
struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
- int nb_rx;
+ int nb_rx, i;
/* There is only one tx queue for this core. Do not flush other
* queues.
@@ -1037,6 +1037,9 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets,
return EAGAIN;
}
+ for (i = 0; i < nb_rx; i++)
+ OVS_PREFETCH(dp_packet_data(packets[i]));
+
*c = nb_rx;
return 0;