Skip to content

Commit

Permalink
classifier: classifier_lookup_miniflow_batch() indicate failures.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
ejj committed Aug 5, 2014
1 parent ae2ceeb commit 5639429
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *,
Expand Down

0 comments on commit 5639429

Please sign in to comment.