[ovs-dev] [PATCH 2/3] revalidator: Use xcache when revalidation is required.

Joe Stringer joestringer at nicira.com
Wed May 21 21:23:51 UTC 2014


I agree, the NULL set line is wrong. I can remove that in a future version.

Ethan, would you mind taking a look at this patch?

On 21 May 2014 17:37, Alex Wang <alexw at nicira.com> wrote:

> Based on the discussion offline,  we should not set the
>
> "+            ukey->xcache = NULL;"
>
> And this change deserves further discussion~.
>
>
> On Tue, May 20, 2014 at 8:45 PM, Joe Stringer <joestringer at nicira.com>wrote:
>
>> One of the reasons that xlate_cache was introduced was to ensure that
>> statistics were attributed to the correct rules and interfaces according
>> to the flow that was installed into the datapath, rather than according
>> to the current state of the flow table.
>>
>> This patch makes the revalidators use the xlate_cache to attribute stats
>> when full revalidation is required.
>>
>> Signed-off-by: Joe Stringer <joestringer at nicira.com>
>> ---
>>  ofproto/ofproto-dpif-upcall.c |   16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
>> index 3e8dda5..7dae150 100644
>> --- a/ofproto/ofproto-dpif-upcall.c
>> +++ b/ofproto/ofproto-dpif-upcall.c
>> @@ -1256,10 +1256,17 @@ revalidate_ukey(struct udpif *udpif, struct
>> udpif_key *ukey,
>>      }
>>
>>      may_learn = push.n_packets > 0;
>> -    if (ukey->xcache && !udpif->need_revalidate) {
>> +    if (ukey->xcache) {
>>          xlate_push_stats(ukey->xcache, may_learn, &push);
>> -        ok = true;
>> -        goto exit;
>> +        if (udpif->need_revalidate) {
>> +            xlate_cache_clear(ukey->xcache);
>> +            ukey->xcache = NULL;
>> +            push.n_packets = 0;
>> +            push.n_bytes = 0;
>> +        } else {
>> +            ok = true;
>> +            goto exit;
>> +        }
>>      }
>>
>>      error = xlate_receive(udpif->backer, NULL, ukey->key, ukey->key_len,
>> &flow,
>> @@ -1268,9 +1275,6 @@ revalidate_ukey(struct udpif *udpif, struct
>> udpif_key *ukey,
>>          goto exit;
>>      }
>>
>> -    if (udpif->need_revalidate) {
>> -        xlate_cache_clear(ukey->xcache);
>> -    }
>>      if (!ukey->xcache) {
>>          ukey->xcache = xlate_cache_new();
>>      }
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140522/cdf07cfa/attachment-0005.html>


More information about the dev mailing list