[ovs-dev] [PATCH 2/4] datapath: Add flow mask cache.

Pravin Shelar pshelar at nicira.com
Mon Apr 14 15:59:28 UTC 2014


On Mon, Apr 14, 2014 at 8:19 PM, Thomas Graf <tgraf at redhat.com> wrote:
> On 04/14/2014 08:54 AM, Pravin Shelar wrote:
>>
>> On Wed, Apr 9, 2014 at 4:05 PM, Thomas Graf <tgraf at redhat.com> wrote:
>>>
>>> I believe skb_get_hash() can be 0 and that would result in mistaking any
>>> empty slot to be a cached entry and we would only look at the first flow
>>> mask.
>>
>>
>> software skb_get_hash() returns zero for error case which should be
>> rare. Thats why I avoided special check for zero hash for every cache
>> lookup.
>
>
> I agree but in those rare cases the lookup will be incorrect. With
> an appropriate unlikely() hint to the compiler the additional cost is
> minimal.

I am not sure why lookup would be incorrect. If cached mask is not
correct then lookup fails and it does fallback to complete mask list
search anyways.



More information about the dev mailing list