[ovs-dev] [threaded-learning v2 23/25] ofproto: Add global locking around flow table changes.

Ben Pfaff blp at nicira.com
Mon Sep 16 16:43:46 UTC 2013


On Fri, Sep 13, 2013 at 03:22:34PM -0700, Jarno Rajahalme wrote:
> 
> On Sep 12, 2013, at 5:07 PM, Ethan Jackson <ethan at nicira.com> wrote:
> 
> >> + * Rules
> >> + * -----
> >> + *
> >> + * A rule 'rule' may be accessed without a risk of being freed by code that
> >> + * holds a read-lock or write-lock on 'cls->rwlock' or that owns a reference to
> >> + * 'rule->ref_count' (or both).  Code that needs to hold onto a rule for a
> >> + * while should take 'cls->rwlock', find the rule it needs, increment
> >> + * 'rule->ref_count' with ofproto_rule_ref(), and drop 'cls->rwlock'.
> >> + *
> >> + * 'rule->ref_count' protects 'rule' from being freed.  It doesn't protect the
> >> + * rule from being deleted from 'cls' (that's 'cls->rwlock') and it doesn't
> >> + * protect members of 'rule' from modification (that's 'rule->rwlock').
> 
> /s/rule->rwlock/rule->mutex/
> 

Thanks, I sent out a fix:
        http://openvswitch.org/pipermail/dev/2013-September/031922.html



More information about the dev mailing list