Skip to content

Commit

Permalink
classifier: Do not insert duplicate rules in indices.
Browse files Browse the repository at this point in the history
There is no point in adding duplicate information into prefix tries.

Also, since the lower-priority duplicate rules are not visible to
lookups, they do not need to be in staged lookup indices directly
either (the head rule is).

Finally, now that cmap operations return the number of elements in the
cmap, subtable's 'n_rules' member is not needed any more.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
Jarno Rajahalme committed Nov 14, 2014
1 parent d07ac93 commit f47eef1
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 145 deletions.
5 changes: 3 additions & 2 deletions lib/classifier-private.h
Expand Up @@ -31,11 +31,12 @@ struct cls_subtable {
struct cmap_node cmap_node; /* Within struct classifier 'subtables_map'. */

/* The fields are only used by writers. */
int n_rules OVS_GUARDED; /* Number of rules, including
* duplicates. */
int max_priority OVS_GUARDED; /* Max priority of any rule in subtable. */
unsigned int max_count OVS_GUARDED; /* Count of max_priority rules. */

/* Identical, but lower priority rules are not inserted to any of the
* following data structures. */

/* These fields are accessed by readers who care about wildcarding. */
const tag_type tag; /* Tag generated from mask for partitioning. */
const uint8_t n_indices; /* How many indices to use. */
Expand Down

0 comments on commit f47eef1

Please sign in to comment.