]> git.baikalelectronics.ru Git - kernel.git/commit
openvswitch: optimize flow compare and mask functions
authorAndy Zhou <azhou@nicira.com>
Tue, 27 Aug 2013 20:02:21 +0000 (13:02 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 27 Aug 2013 20:13:09 +0000 (13:13 -0700)
commit20ebbf7efbbc2dd1566f1f4aa7c4229f56212e1d
treef32f417eecf4eab1f7a780b0191f4a1b0b0a9f1d
parente73f8176dac3486e17c37f70d3b9312a3081d8bc
openvswitch: optimize flow compare and mask functions

Make sure the sw_flow_key structure and valid mask boundaries are always
machine word aligned. Optimize the flow compare and mask operations
using machine word size operations. This patch improves throughput on
average by 15% when CPU is the bottleneck of forwarding packets.

This patch is inspired by ideas and code from a patch submitted by Peter
Klausler titled "replace memcmp() with specialized comparator".
However, The original patch only optimizes for architectures
support unaligned machine word access. This patch optimizes for all
architectures.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/flow.c
net/openvswitch/flow.h