match: New function minimatch_matches_flow().

Signed-off-by: Ben Pfaff <blp@nicira.com>
tag: Reintroduce tag library.

It is needed for the classifier partitioning optimization.  This commit
only reintroduces the parts that are actually needed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
classifier: Speed up lookup when metadata partitions the flow table.

We have a controller that puts many rules with different metadata values
into the flow table, where metadata is used (by "resubmit"s) to distinguish
stages in a pipeline.  Thus, any given flow only needs to be hashed into
classifier "cls_table"s that contain a match for the flow's metadata value.
This commit optimizes the classifier lookup by (probabilistically) skipping
the "cls_table"s that can't possibly match.

(The "metadata" referred to here is the OpenFlow 1.1+ "metadata" field,
which is a 64-bit field similar in purpose to the "registers" defined by
Open vSwitch.)

Previous versions of this patch, with earlier versions of the controller in
question, improved flow setup performance by about 19%.

Bug #14282.
Signed-off-by: Ben Pfaff <blp@nicira.com>
classifier: Avoid accumulating junk in cls_partition 'tags'.

It's easy to add two tags together, but it's hard to subtract them.  The
new "tag_tracker" data structure provides a solution.

Signed-off-by: Ben Pfaff <blp@nicira.com>