dpif-netdev: Load packet pointer only once in emc_processing()
authorAndy Zhou <azhou@ovn.org>
Sat, 30 Jan 2016 01:40:18 +0000 (17:40 -0800)
committerAndy Zhou <azhou@ovn.org>
Tue, 2 Feb 2016 20:01:14 +0000 (12:01 -0800)
commit5a2fed48668b8547412bdbae46f28346c9e01abf
tree6e469b69741d3d7dd4bc1bb70753f1c4adfc9df2
parent1a64eb93c9f1151811b188bc4fe63b72a945e264
dpif-netdev: Load packet pointer only once in emc_processing()

For the machines I have access to, Reloading the same pointer from
memory seems to inhibit complier optimization somewhat.

In emc_processing(), using a single packet pointer, instead reloading
it from memory with packets[i], improves performance by 0.3 Mpps (tested
with 10G NIC pushing 64 byte packets, with the base line of 12.2 Mpps).

Besides improving performance, this patch should also improves code
readability.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
lib/dpif-netdev.c