linux-stable/net/openvswitch
Francesco Fusco 500f808726 net: ovs: 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@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-17 14:27:17 -05:00
..
actions.c openvswitch: Add SCTP support 2013-08-26 14:03:13 -07:00
datapath.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-19 15:50:47 -08:00
datapath.h genetlink: pass family to functions using groups 2013-11-19 16:39:06 -05:00
dp_notify.c genetlink: make multicast groups const, prevent abuse 2013-11-19 16:39:06 -05:00
flow.c openvswitch: TCP flags matching support. 2013-11-01 18:43:45 -07:00
flow.h openvswitch: TCP flags matching support. 2013-11-01 18:43:45 -07:00
flow_netlink.c openvswitch: TCP flags matching support. 2013-11-01 18:43:45 -07:00
flow_netlink.h openvswitch: Restructure datapath.c and flow.c 2013-10-03 18:16:47 -07:00
flow_table.c net: ovs: use CRC32 accelerated flow hash if available 2013-12-17 14:27:17 -05:00
flow_table.h openvswitch: collect mega flow mask stats 2013-10-22 10:42:46 -07:00
Kconfig openvswitch: Add SCTP support 2013-08-26 14:03:13 -07:00
Makefile openvswitch: Restructure datapath.c and flow.c 2013-10-03 18:16:47 -07:00
vport-gre.c openvswitch: remove duplicated include from vport-gre.c 2013-09-23 13:36:31 -07:00
vport-internal_dev.c openvswitch: Enable all GSO features on internal port. 2013-11-01 18:17:50 -07:00
vport-internal_dev.h openvswitch: Replace Nicira Networks. 2012-05-03 18:55:23 -07:00
vport-netdev.c openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-netdev.h openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-vxlan.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch 2013-11-04 16:25:04 -05:00
vport.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
vport.h openvswitch: Add vxlan tunneling support. 2013-08-20 00:15:44 -07:00