diff options
author | Ben Pfaff <blp@nicira.com> | 2012-07-20 14:46:15 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-09-04 12:24:27 -0700 |
commit | 3ca1de08b4d0374e4b9389d98351b2b0192c8189 (patch) | |
tree | b66a9c7ec61144a3916dac1c785b701629b49991 /lib/classifier.h | |
parent | 48d28ac16112f72ef0985ec2d013425202af8f5c (diff) |
classifier: Optimize iteration with a catch-all target rule.
When cls_cursor_init() is given a NULL target, it can skip an expensive
step comparing the rule against the target for every table and every rule
in the classifier. collect_rule_loose() and other callers could take
advantage of this optimization, except that they actually pass in a rule
that matches everything instead of a NULL rule (e.g. for "ovs-ofctl
dump-flows <bridge>" without specifying a matching rule).
This optimizes that case.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/classifier.h')
-rw-r--r-- | lib/classifier.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/classifier.h b/lib/classifier.h index 341c3441..ebb1bbad 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -78,6 +78,8 @@ uint32_t cls_rule_hash(const struct cls_rule *, uint32_t basis); void cls_rule_format(const struct cls_rule *, struct ds *); +bool cls_rule_is_catchall(const struct cls_rule *); + bool cls_rule_is_loose_match(const struct cls_rule *rule, const struct match *criteria); |