classifier: classifier_lookup_miniflow_batch() indicate failures.
authorEthan Jackson <ethan@nicira.com>
Mon, 28 Jul 2014 00:51:48 +0000 (17:51 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 5 Aug 2014 21:13:20 +0000 (14:13 -0700)
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>
lib/classifier.c
lib/classifier.h

index a6a582c..ae03251 100644 (file)
@@ -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
index 4203eb8..b394724 100644 (file)
@@ -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 *,