]> git.proxmox.com Git - mirror_ovs.git/commit - tests/test-classifier.c
classifier: Defer pvector publication.
authorJarno Rajahalme <jrajahalme@nicira.com>
Thu, 13 Nov 2014 19:54:31 +0000 (11:54 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Sat, 15 Nov 2014 00:00:46 +0000 (16:00 -0800)
commit802f84ffd71a6c94234cec43f4a5abaf02b56fa8
treebeb41962362454c8f6b362dcc8c2f47ead7c2042
parentd0999f1b34ecaefc5b3ab7bef3e7804383cdc3f7
classifier: Defer pvector publication.

This patch adds a new functions classifier_defer() and
classifier_publish(), which control when the classifier modifications
are made available to lookups.  By default, all modifications are made
available to lookups immediately.  Modifications made after a
classifier_defer() call MAY be 'deferred' for later 'publication'.  A
call to classifier_publish() will both publish any deferred
modifications, and cause subsequent changes to to be published
immediately.

Currently any deferring is limited to the visibility of the subtable
vector changes.  pvector now processes modifications mostly in a
working copy, which needs to be explicitly published with
pvector_publish().  pvector_publish() sorts the working copy and
removes gaps before publishing it.

This change helps avoiding O(n**2) memory behavior in corner cases,
where large number of rules with different masks are inserted or
deleted.

VMware-BZ: #1322017
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/classifier.c
lib/classifier.h
lib/dpif-netdev.c
lib/ovs-router.c
lib/pvector.c
lib/pvector.h
ofproto/ofproto.c
tests/test-classifier.c
utilities/ovs-ofctl.c