diff options
author | Ethan Jackson <ethan@nicira.com> | 2014-07-27 17:51:48 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2014-08-05 14:13:20 -0700 |
commit | 56394293b807ab811903e3655cdf522f0d7146db (patch) | |
tree | 3ca9cb623c36bb65f173a0e0cf3c6cef26967b46 | |
parent | ae2ceebd675cce9608aaf74b0d48e5412695aa94 (diff) | |
download | openvswitch-56394293b807ab811903e3655cdf522f0d7146db.tar.gz |
classifier: classifier_lookup_miniflow_batch() indicate failures.
This patch causes classifier_lookup_miniflow_batch() to return a
boolean indicating whether any rules could not be successfully looked
up. Used in future patches.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
-rw-r--r-- | lib/classifier.c | 10 | ||||
-rw-r--r-- | lib/classifier.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/classifier.c b/lib/classifier.c index a6a582cd3..ae03251e2 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -1004,8 +1004,10 @@ find_match_miniflow(const struct cls_subtable *subtable, * This function is optimized for use in the userspace datapath and therefore * does not implement a lot of features available in the standard * classifier_lookup() function. Specifically, it does not implement - * priorities, instead returning any rule which matches the flow. */ -void + * priorities, instead returning any rule which matches the flow. + * + * Returns true if all flows found a corresponding rule. */ +bool classifier_lookup_miniflow_batch(const struct classifier *cls, const struct miniflow **flows, struct cls_rule **rules, size_t len) @@ -1034,9 +1036,11 @@ classifier_lookup_miniflow_batch(const struct classifier *cls, begin++; } if (begin >= len) { - break; + return true; } } + + return false; } /* Finds and returns a rule in 'cls' with exactly the same priority and diff --git a/lib/classifier.h b/lib/classifier.h index 4203eb874..b394724be 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -295,7 +295,7 @@ void classifier_remove(struct classifier *, struct cls_rule *); struct cls_rule *classifier_lookup(const struct classifier *, const struct flow *, struct flow_wildcards *); -void classifier_lookup_miniflow_batch(const struct classifier *cls, +bool classifier_lookup_miniflow_batch(const struct classifier *cls, const struct miniflow **flows, struct cls_rule **rules, size_t len); bool classifier_rule_overlaps(const struct classifier *, |