dpif-netdev: Avoid copying netdev_flow_key in emc_processing().
authorBen Pfaff <blp@ovn.org>
Sun, 24 Jan 2016 16:32:36 +0000 (08:32 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 1 Feb 2016 17:28:02 +0000 (09:28 -0800)
commitd262ac2c60ce1da7b477737f70e8efd38b32502d
treecfddb7a9d2909102b16832470125e4e28ed9f3c8
parent9167fc1ae524e6ef33e706daf38e77af9188d8d2
dpif-netdev: Avoid copying netdev_flow_key in emc_processing().

Before this commit, emc_processing() copied a netdev_flow_key if there was
no exact-match cache (EMC) hit.  This commit eliminates the copy by
constructing the netdev_flow_key in the place it would be copied.

Found by inspection.

Shahbaz (CCed) reports that this reduces the cost of an EMC miss by 72
cycles in his test case in which the EMC is disabled.  Presumably this
is similarly valuable in cases where the EMC merely has few hits.

For the original version of this patch, which was against a slightly
earlier version of OVS, Daniele reported that:

    - With EMC disabled, this increases throughput from 4.8 Mpps to 5.4
      Mpps.

    - With EMC enabled, this decreases throughput from 12.4 to 12.0 Mpps.

CC: Muhammad Shahbaz <mshahbaz@cs.princeton.edu>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
AUTHORS
lib/dpif-netdev.c