[ovs-dev] [PATCH v2 7/7] flow: Add struct flowmap.

Jarno Rajahalme jrajahalme at nicira.com
Fri Aug 7 00:39:41 UTC 2015


> On Aug 6, 2015, at 16:29, Jesse Gross <jesse at nicira.com> wrote:

> 
>> On Thu, Aug 6, 2015 at 4:17 PM, Jarno Rajahalme <jrajahalme at nicira.com> 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>
> 
> I think this patch may need a rebase after the tunnel metadata flow
> patches that I applied last night.
> 
> Sorry about that.

Thanks for the heads up! I just sent a v3.

  Jarno


More information about the dev mailing list