lib/classifier: Make classifier_remove() more robust.
authorJarno Rajahalme <jrajahalme@nicira.com>
Fri, 10 Oct 2014 22:38:57 +0000 (15:38 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Fri, 10 Oct 2014 22:38:57 +0000 (15:38 -0700)
commit747f140a9940cbd56f0a5ffd4869d8bf93464559
tree85a23f59ddca81653d5175bb82ae4b500da8a4be
parentbd7fe4e925d73dff879a4a1ac19a4365365e0dd7
lib/classifier: Make classifier_remove() more robust.

classifier already provides lockless lookups, and protected
modifications.  When user wants to remove a flow, we currently require
the flow to exist in the classifier.  To be thread safe, this requires
the caller to introduce their own mutex, lock it before a lookup, and
then issue classifier_remove() while the lock is still held.

This patch relaxes the "existence requirement" of the rule in
classifier_remove(), allowing it to be called on a rule that may have
already been removed from the classifier.  This allows users to do a
classifier_lookup() and classifier_remove() without additional
syncronization.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/classifier.c
lib/classifier.h