[ovs-dev] [PATCH v4 6/9] classifier: Do not use mf_value.

Jarno Rajahalme jrajahalme at nicira.com
Thu Aug 13 00:06:46 UTC 2015


> On Aug 12, 2015, at 4:51 PM, Joe Stringer <joestringer at nicira.com> wrote:
> 
> On 12 August 2015 at 16:48, Jarno Rajahalme <jrajahalme at nicira.com <mailto:jrajahalme at nicira.com>> wrote:
>> 
>> On Aug 12, 2015, at 2:18 PM, Joe Stringer <joestringer at nicira.com> wrote:
>> 
>> On 7 August 2015 at 16:57, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>> 
>> mf_value has grown bigger than needed for storing the biggest
>> supported prefix (IPv6 address length).  Define a new type to be used
>> instead of mf_value.
>> 
>> This makes classifier lookups a bit faster.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>> ---
>> lib/classifier.c | 14 ++++++++++----
>> 1 file changed, 10 insertions(+), 4 deletions(-)
>> 
>> diff --git a/lib/classifier.c b/lib/classifier.c
>> index 4adee2d..040d04f 100644
>> --- a/lib/classifier.c
>> +++ b/lib/classifier.c
>> @@ -138,12 +138,18 @@ next_visible_rule_in_list(const struct cls_match
>> *rule, cls_version_t version)
>>    return rule;
>> }
>> 
>> +/* Type with maximum supported prefix length. */
>> +typedef union {
>> +    struct in6_addr ipv6;  /* For sizing. */
>> +    ovs_be32 be32;         /* For access. */
>> +} trie_prefix_t;
>> 
>> 
>> Typically I believe that we try to avoid typedefs, instead using the
>> expanded "union trie_prefix" so that the actual type can be determined
>> at a glance (See CodingStyle.md for more explanation).
>> 
>> 
>> OK, changed to “union trie_prefix”.
>> 
>> Other than that, this change seems to make sense.
>> 
>> 
>> Is this an Acked-by?
> 
> Sorry, yeah this is fine. I thought it might be dependent on an
> earlier change, but it seems like it's good by itself.
> 
> Acked-by: Joe Stringer <joestringer at nicira.com <mailto:joestringer at nicira.com>>

Pushed to master,

  Jarno




More information about the dev mailing list