[ovs-dev] [PATCH v4 8/9] flow: Add struct flowmap.

Jarno Rajahalme jrajahalme at nicira.com
Fri Aug 21 17:59:59 UTC 2015


> On Aug 21, 2015, at 8:33 AM, Ben Pfaff <blp at nicira.com> wrote:
> 
> On Fri, Aug 07, 2015 at 04:57:41PM -0700, Jarno Rajahalme wrote:
>> Struct miniflow is now sometimes used just as a map.  Define a new
>> struct flowmap for that purpose.  The flowmap is defined as an array of
>> maps, and it is automatically sized according to the size of struct
>> flow, so it will be easier to maintain in the future.
>> 
>> It would have been tempting to use the existing struct bitmap for this
>> purpose. The main reason this is not feasible at the moment is that
>> some flowmap algorithms are simpler when it can be assumed that no
>> struct flow member requires more bits than can fit to a single map
>> unit. The tunnel member already requires more than 32 bits, so the map
>> unit needs to be 64 bits wide.
>> 
>> Performance critical algorithms enumerate the flowmap array units
>> explicitly, as it is easier for the compiler to optimize, compared to
>> the normal iterator.  Without this optimization a classifier lookup
>> without wildcard masks would be about 25% slower.
>> 
>> With this more general (and maintainable) algorithm the classifier
>> lookups are about 5% slower, when the struct flow actually becomes big
>> enough to require a second map.  This negates the performance gained
>> in the "Pre-compute stage masks" patch earlier in the series.
>> 
>> Requested-by: Ben Pfaff <blp at nicira.com>
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
> 
> Having some trouble applying this, would you mind reposting what remains
> of the series?
> 

Will do.

  Jarno

> Thanks,
> 
> Ben.




More information about the dev mailing list