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

2014-05-21 Thread Ryan Wilson 76511
>>>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 p

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

2014-05-21 Thread Andy Zhou
>>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 t

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

2014-05-20 Thread Ryan Wilson 76511
>> >> 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

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

2014-05-20 Thread Joe Stringer
On 21 May 2014 14:25, Andy Zhou wrote: > On Tue, May 20, 2014 at 5:27 PM, Joe Stringer > wrote: > > On 21 May 2014 10:33, Joe Stringer wrote: > >> > >> On 21 May 2014 10:05, Ryan Wilson 76511 wrote: > >> > >>> Hey Andy, > >>> > >>> >At a high level, ofgroup struct current has rwlock that esse

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

2014-05-20 Thread Andy Zhou
> > 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 protec

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

2014-05-20 Thread Andy Zhou
On Tue, May 20, 2014 at 5:27 PM, Joe Stringer wrote: > On 21 May 2014 10:33, Joe Stringer wrote: >> >> On 21 May 2014 10:05, Ryan Wilson 76511 wrote: >> >>> Hey Andy, >>> >>> >At a high level, ofgroup struct current has rwlock that essentially >>> >solving >>> >the same problem as the ref count

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

2014-05-20 Thread Ryan Wilson 76511
fine. > >> >> Ryan >> >> From: Joe Stringer >> Date: Tuesday, May 20, 2014 3:33 PM >> To: Ryan Wilson >> Cc: Andy Zhou , Ryan Wilson , >> "dev@openvswitch.org" >> Subject: Re: [ovs-dev] [PATCH v3 1/3] ofproto: Add reference count for >&g

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

2014-05-20 Thread Andy Zhou
ed to my patch. So it > might be better to do them in a separate patch. Let me know what you think. That's fine. > > Ryan > > From: Joe Stringer > Date: Tuesday, May 20, 2014 3:33 PM > To: Ryan Wilson > Cc: Andy Zhou , Ryan Wilson , > "dev@openvswitch.or

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

2014-05-20 Thread Joe Stringer
On 21 May 2014 10:33, Joe Stringer wrote: > On 21 May 2014 10:05, Ryan Wilson 76511 wrote: > > Hey Andy, >> >> >At a high level, ofgroup struct current has rwlock that essentially >> >solving >> >the same problem as the ref count proposed in this patch. It would be >> >better >> >it seems confu

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

2014-05-20 Thread Ryan Wilson 76511
ware.com>> Cc: Andy Zhou mailto:az...@nicira.com>>, Ryan Wilson mailto:wr...@nicira.com>>, "dev@openvswitch.org<mailto:dev@openvswitch.org>" mailto:dev@openvswitch.org>> Subject: Re: [ovs-dev] [PATCH v3 1/3] ofproto: Add reference count for Openflow

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

2014-05-20 Thread Joe Stringer
On 21 May 2014 10:05, Ryan Wilson 76511 wrote: > Hey Andy, > > >At a high level, ofgroup struct current has rwlock that essentially > >solving > >the same problem as the ref count proposed in this patch. It would be > >better > >it seems confusing if we use both method together. > > > >Looking a

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

2014-05-20 Thread Ryan Wilson 76511
Hey Andy, >At a high level, ofgroup struct current has rwlock that essentially >solving >the same problem as the ref count proposed in this patch. It would be >better >it seems confusing if we use both method together. > >Looking at the code, I'd think extending rwlock to cover xlate >fastpath is

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

2014-05-20 Thread Andy Zhou
At a high level, ofgroup struct current has rwlock that essentially solving the same problem as the ref count proposed in this patch. It would be better it seems confusing if we use both method together. Looking at the code, I'd think extending rwlock to cover xlate fastpath is the most straight

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

2014-05-19 Thread Alex Wang
Hey Andy, Could you review the first two packets? The second patch looks good to me, For this patch, I'm concerned about the use of ovsrcu_postpone(), since there is no rcu protected variable in 'struct ofgroup'. I suggest, we could move the code in group_destroy_cb() to ofproto_group_unref().

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

2014-05-19 Thread Ryan Wilson
Signed-off-by: Ryan Wilson --- v2: Fixed bug with group stats all buckets, cleaned up ofgroup unref code, added Andy Zhou's test for more complete test coverage v3: Split group reference count, support for group and bucket stats into 2 patches. Commit Andy Zhou's test patch separately. --- o