[ovs-dev] [PATCH] datapath: Add mask check during flow lookup

Pravin Shelar pshelar at nicira.com
Fri Jul 19 23:53:09 UTC 2013


Thanks,
I pushed patch to master.

On Fri, Jul 19, 2013 at 2:29 PM, Andy Zhou <azhou at nicira.com> wrote:
> Thanks Pravin.
>
>
> On Fri, Jul 19, 2013 at 2:20 PM, Pravin Shelar <pshelar at nicira.com> wrote:
>>
>> On Fri, Jul 19, 2013 at 11:11 AM, Andy Zhou <azhou at nicira.com> wrote:
>> > A mega flow matches when the masked key matches and the mask applied
>> > is the same as the mask used to create the mega flow.
>> >
>> > This patch adds the implementation of the second match condition
>> > mentioned above. Without this fix, mega flow lookup may result false
>> > match.
>> >
>> > Bug #18584
>> >
>> > Signed-off-by: Andy Zhou <azhou at nicira.com>
>>
>> Looks good.
>>
>> Acked-by: Pravin B Shelar <pshelar at nicira.com>.
>>
>> > ---
>> >  datapath/flow.c |    3 ++-
>> >  1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/datapath/flow.c b/datapath/flow.c
>> > index 752c8d6..d9040ce 100644
>> > --- a/datapath/flow.c
>> > +++ b/datapath/flow.c
>> > @@ -1048,7 +1048,8 @@ static struct sw_flow
>> > *ovs_masked_flow_lookup(struct flow_table *table,
>> >         hash = ovs_flow_hash(&masked_key, key_start, key_len);
>> >         head = find_bucket(table, hash);
>> >         hlist_for_each_entry_rcu(flow, head, hash_node[table->node_ver])
>> > {
>> > -               if (__flow_cmp_key(flow, &masked_key, key_start,
>> > key_len))
>> > +               if (flow->mask == mask &&
>> > +                       __flow_cmp_key(flow, &masked_key, key_start,
>> > key_len))
>> >                         return flow;
>> >         }
>> >         return NULL;
>> > --
>> > 1.7.9.5
>> >
>> > _______________________________________________
>> > dev mailing list
>> > dev at openvswitch.org
>> > http://openvswitch.org/mailman/listinfo/dev
>
>



More information about the dev mailing list