[ovs-dev] [PATCH v5 6/6] meta-flow: Avoid unnecessary large memset.

Jarno Rajahalme jrajahalme at nicira.com
Thu Aug 27 00:44:35 UTC 2015


> On Aug 26, 2015, at 4:57 PM, Jesse Gross <jesse at nicira.com> wrote:
> 
> On Fri, Aug 21, 2015 at 3:25 PM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>> mf_mask_field_and_prereqs() used to memset a static variable again and
>> again.  Now that mf_value is larger (due to tun_metadata field), this
>> is more expensive.  Avoid this by using static initialization.
>> 
>> mf_mask_field_and_prereqs() is used only for set field and reg move,
>> which never deal with the tun_metadata field as a whole.
> 
> I'm not sure that it's really true that this is never called for
> tunnel metadata. This wouldn't be called on the whole 256 byte
> tun_metadata field but an individual option can be up to 124 bytes, so
> still larger than an IPv6 address. The size of mf_value actually
> should represent the size of an individual element.

I missed the max size of the Geneve options, sorry. I sent a patch that fixes this.

  Jarno




More information about the dev mailing list