[ovs-git] Open vSwitch: datapath: use CRC32 accelerated flow hash if available (master)

dev at openvswitch.org dev at openvswitch.org
Mon Dec 16 20:36:35 UTC 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  df9a0a8958192f6ed5f60ae61c0ca6dd7c20c6f5 (commit)
       via  3c851001cbd55b080eaaa1c89ae033d8129cac28 (commit)
      from  f6e6595a528d775ec22b5ef01e1acd8068d23ba0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit df9a0a8958192f6ed5f60ae61c0ca6dd7c20c6f5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=df9a0a8958192f6ed5f60ae61c0ca6dd7c20c6f5
Author: Francesco Fusco <ffusco at redhat.com>
		
datapath: use CRC32 accelerated flow hash if available
		
Currently OVS uses jhash2() for calculating flow hashes in its
internal flow_hash() function. The performance of the flow_hash()
function is critical, as the input data can be hundreds of bytes
long.

OVS is largely deployed in x86_64 based datacenters.  Therefore,
we argue that the performance critical fast path of OVS should
exploit underlying CPU features in order to reduce the per packet
processing costs. We replace jhash2 with the hash implementation
provided by the kernel hash lib, which exploits the crc32l
instruction to achieve high performance

Our patch greatly reduces the hash footprint from ~200 cycles of
jhash2() to around ~90 cycles in case of ovs_flow_hash_crc()
(measured with rdtsc over maximum length flow keys on an i7 Intel
CPU).

Additionally, we wrote a microbenchmark to stress the flow table
performance. The benchmark inserts random flows into the flow
hash and then performs lookups. Our hash deployed on a CRC32
capable CPU reduces the lookup for 1000 flows, 100 masks from
~10,100us to ~6,700us, for example.

Thus, simply use the newly introduced arch_fast_hash2() as a
drop-in replacement.

Signed-off-by: Francesco Fusco <ffusco at redhat.com>
Signed-off-by: Daniel Borkmann <dborkman at redhat.com>
Signed-off-by: Thomas Graf <tgraf at redhat.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>


commit 3c851001cbd55b080eaaa1c89ae033d8129cac28
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=3c851001cbd55b080eaaa1c89ae033d8129cac28
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Backport for architecture hash library.
		
The architecture-specific hash library automatically selects either
jhash or CRC32 if it is available on the current processor.

Signed-off-by: Jesse Gross <jesse at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 datapath/flow_table.c                      |    4 +-
 datapath/linux/Modules.mk                  |    4 ++
 datapath/linux/compat/hash-x86.c           |   95 ++++++++++++++++++++++++++++
 datapath/linux/compat/hash.c               |   51 +++++++++++++++
 datapath/linux/compat/include/asm/hash.h   |   18 ++++++
 datapath/linux/compat/include/linux/hash.h |   45 +++++++++++++
 6 files changed, 215 insertions(+), 2 deletions(-)
 create mode 100644 datapath/linux/compat/hash-x86.c
 create mode 100644 datapath/linux/compat/hash.c
 create mode 100644 datapath/linux/compat/include/asm/hash.h
 create mode 100644 datapath/linux/compat/include/linux/hash.h


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list