[ovs-dev] [PATCH v3 1/3] ofproto: Add reference count for Openflow groups.

Ryan Wilson 76511 wryan at vmware.com
Wed May 21 05:16:01 UTC 2014


>>
>> 1) Use refs for buckets (this seems unnecessarily heavyweight)
>> 2) Always try bucket_lookup when adding stats to a bucket via the cache.
>> If the bucket is not there in the list, we know its been removed via
>> modify_group() and we simply don't update stats.
>> 3) Use ofgroup->rw_lock to protect writing to stats via the xlate cache
>> (this seems to break modularity in the code but it would be the simplest
>> to do).
>> 4) Similar to netdev, remove the group then re-add the group to ofproto
>> instead of modifying the group in place. Thus, the bucket will only be
>> invalid when its group parent is also invalid.
>
>On balance, #4 seems to be the most straight forward way of dealing with
>it.

Sweet, I'm working on implementing this. Its taking a surprising amount of
refactoring to make it look somewhat clean, so I'll send the new patch out
tomorrow.

>>
>> Let me know if you have any other ideas. I don't particularly like any
>>of
>> these, but these are what I could come up with on the top of my head.
>
>How about we remove the rwlock and only use ref count?

We need the ref count to determine when we can free the group / bucket.
The rwlock is to serialize access to the ofgroup's properties. For
example, 2 threads could be accessing ofgroup's properties, but a ref
count doesn't prevent them from both editing its properties
simultaneously. Unfortunately, I think we still need both here.




More information about the dev mailing list