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

Jarno Rajahalme jrajahalme at nicira.com
Fri Sep 13 22:22:34 UTC 2013


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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130913/999bfaaf/attachment-0003.html>


More information about the dev mailing list