[ovs-dev] [PATCH 3/4] lib/classifier: Return all matching prefix lengths from trie lookup.

Jarno Rajahalme jrajahalme at nicira.com
Fri Jul 18 09:33:59 UTC 2014


Thanks for the review. Pushed with also the preceding bigger comment updated.

  Jarno

On Jul 17, 2014, at 7:13 AM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:

> 
> On Jul 15, 2014, at 2:24 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
>> On Fri, Jul 11, 2014 at 04:55:56AM -0700, Jarno Rajahalme wrote:
>>> Previously we only returned the last matching prefix length
>>> encountered during a trie lookup, and skipped subtables that had
>>> prefixes longer than that.  This patch changes the trie lookup
>>> functions to return all matching prefix lengths seen, so that all
>>> non-matching prefix lengths can be skipped.
>>> 
>>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>> 
>> Here, should the comment on match_plens be something more like
>> "Prefixes that could possible match.”?
> 
> You are right, I forgot to update the comment. It is now a bitmask, one bit for each potentially matching prefix length. Each bit indicates one prefix length with potential matches, what do you think of this:
> 
> “Bitmask of prefix lengths with possible matches.”
> 
>   Jarno
>> 
> 
>> struct trie_ctx {
>>     const struct cls_trie *trie;
>>     bool lookup_done;        /* Status of the lookup. */
>>     uint8_t be32ofs;         /* U32 offset of the field in question. */
>> -    unsigned int match_plen; /* Longest prefix than could possibly match. */
>>     unsigned int maskbits;   /* Prefix length needed to avoid false matches. */
>> +    union mf_value match_plens; /* Longest prefix than could possibly match. */
>> };
>> 
>> Acked-by: Ben Pfaff <blp at nicira.com>
> 




More information about the dev mailing list