mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
A cls_rule is 324 bytes on i386 now. The cost of a flow table lookup is
currently proportional to this size, which is going to continue to grow.
However, the required cost of a flow table lookup, with the classifier that
we currently use, is only proportional to the number of bits that a rule
actually matches. This commit implements that optimization by replacing
the match inside "struct cls_rule" by a sparse representation.
This reduces struct cls_rule to 100 bytes on i386.
There is still some headroom for further optimization following this
commit:
- I suspect that adding an 'n' member to struct miniflow would make
miniflow operations faster, since popcount() has some cost.
- It's probably possible to replace the "struct minimatch" in cls_rule
by just a "struct miniflow", since the cls_rule's cls_table has a
copy of the minimask.
- Some of the miniflow operations aren't well-optimized.
Signed-off-by: Ben Pfaff <blp@nicira.com>
25 lines
652 B
Plaintext
25 lines
652 B
Plaintext
AT_BANNER([flow classifier unit tests])
|
|
m4_foreach(
|
|
[testname],
|
|
[[empty],
|
|
[destroy-null],
|
|
[single-rule],
|
|
[rule-replacement],
|
|
[many-rules-in-one-list],
|
|
[many-rules-in-one-table],
|
|
[many-rules-in-two-tables],
|
|
[many-rules-in-five-tables]],
|
|
[AT_SETUP([flow classifier - m4_bpatsubst(testname, [-], [ ])])
|
|
AT_CHECK([test-classifier testname], [0], [], [])
|
|
AT_CLEANUP])])
|
|
|
|
AT_BANNER([miniflow unit tests])
|
|
m4_foreach(
|
|
[testname],
|
|
[[miniflow],
|
|
[minimask_has_extra],
|
|
[minimask_combine]],
|
|
[AT_SETUP([miniflow - m4_bpatsubst(testname, [-], [ ])])
|
|
AT_CHECK([test-classifier testname], [0], [], [])
|
|
AT_CLEANUP])])
|