Re: [ovs-dev] [PATCH 4/7] ofproto: New cookie-counters module.

2017-03-08 Thread Daniele Di Proietto





On 07/03/2017 10:35, "Ben Pfaff"  wrote:

>On Fri, Feb 24, 2017 at 06:57:58PM -0800, Daniele Di Proietto wrote:
>> The new module will be used by ofproto to keep track of the number of
>> learned flows with the same cookie in the same table.
>> 
>> The counters are used to implement limits for the learn action.
>> 
>> The module implements its own internal locking, because the counters can
>> be increased/decreased from handlers and revalidators.
>> 
>> Signed-off-by: Daniele Di Proietto 
>
>There's an existing hindex of flows by their cookies, the 'cookies'
>member of struct ofproto, and even a 'learned_cookies' hmap.  Is there a
>graceful way to avoid having more indexes of flows by cookie?

Good point, it looks redundant.

This module was necessary due to the extra locking requirements.  The
other map were only protected by ofproto_mutex, while this had its own
mutex.  Due to the different design in v2 this won't be necessary at all.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 4/7] ofproto: New cookie-counters module.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:58PM -0800, Daniele Di Proietto wrote:
> The new module will be used by ofproto to keep track of the number of
> learned flows with the same cookie in the same table.
> 
> The counters are used to implement limits for the learn action.
> 
> The module implements its own internal locking, because the counters can
> be increased/decreased from handlers and revalidators.
> 
> Signed-off-by: Daniele Di Proietto 

There's an existing hindex of flows by their cookies, the 'cookies'
member of struct ofproto, and even a 'learned_cookies' hmap.  Is there a
graceful way to avoid having more indexes of flows by cookie?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev