lib/classifier: Optimize megaflows for single rule case.
authorJarno Rajahalme <jrajahalme@nicira.com>
Fri, 13 Jun 2014 17:38:05 +0000 (10:38 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Thu, 26 Jun 2014 15:35:35 +0000 (08:35 -0700)
commita64759f02d8324caf6c37af0ac4e3e1d26e02a43
tree4bdada4dc7c2afba943f24fee13f3b7988455d81
parentfe7cfa5c3f195b477f0d6ce499315415b2604b67
lib/classifier: Optimize megaflows for single rule case.

When, during a classifier lookup, we narrow down to a single potential
rule, it is enough to match on ("unwildcard") one bit that differs
between the packet and the rule.

This is a special case of the more general algorithm, where it is
sufficient to match on enough bits that separates the packet from all
higher priority rules than the matched rule.  For a miss that would be
all the rules.  Implementing this is expensive for a more than a few
rules.  This patch starts by doing this for a single rule when we
already have it, also reducing the lookup cost by finishing the lookup
earlier than before.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/classifier.c
lib/flow.h
tests/classifier.at
tests/ofproto-dpif.at